| 1 |
(* -*- coq-prog-args: ("-nois" "-R" "../theories" "Coq") -*- *) |
| 2 |
(* File reduced by coq-bug-finder from original input, then from 2236 lines to 1877 lines, then from 1652 lines to 160 lines, then from 102 lines to 34 lines *) |
| 3 |
(* coqc version trunk (December 2014) compiled on Dec 23 2014 22:6:43 with OCaml 4.01.0 |
| 4 |
coqtop version cagnode15:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (90ed6636dea41486ddf2cc0daead83f9f0788163) *) |
| 5 |
Generalizable All Variables. |
| 6 |
Require Import Corelib.Init.Notations. |
| 7 |
Require Import Corelib.Init.Ltac. |
| 8 |
Reserved Notation "x -> y" (at level 99, right associativity, y at level 200). |
| 9 |
Notation "A -> B" := (forall (_ : A), B) : type_scope. |
| 10 |
Axiom admit : forall {T}, T. |
| 11 |
Notation "g 'o' f" := (fun x => g (f x)) (at level 40, left associativity). |
| 12 |
Notation "g 'o' f" := ltac:(let g' := g in let f' := f in exact (fun x => g' (f' x))) (at level 40, left associativity). (* Ensure that x is not captured in [g] or [f] in case they contain holes *) |
| 13 |
Inductive eq {A} (x:A) : A -> Prop := eq_refl : x = x where "x = y" := (@eq _ x y) : type_scope. |
| 14 |
Arguments eq_refl {_ _}. |
| 15 |
Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with eq_refl => eq_refl end. |
| 16 |
Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A ; eisretr : forall x, f (equiv_inv x) = x }. |
| 17 |
Arguments eisretr {A B} f {_} _. |
| 18 |
Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'"). |
| 19 |
Create HintDb typeclass_instances discriminated. |
| 20 |
Global Instance isequiv_compose `{IsEquiv A B f} `{IsEquiv B C g} : IsEquiv (g o f) | 1000 := admit. |
| 21 |
Definition isequiv_homotopic {A B} (f : A -> B) (g : A -> B) `{IsEquiv A B f} (h : forall x, f x = g x) : IsEquiv g := admit. |
| 22 |
Global Instance isequiv_inverse {A B} (f : A -> B) {feq : IsEquiv f} : IsEquiv f^-1 | 10000 := admit. |
| 23 |
Definition cancelR_isequiv {A B C} (f : A -> B) {g : B -> C} `{IsEquiv A B f} `{IsEquiv A C (g o f)} : IsEquiv g. |
| 24 |
Proof. |
| 25 |
pose (fun H => @isequiv_homotopic _ _ ((g o f) o f^-1) _ H |
| 26 |
(fun b => ap g (eisretr f b))) as k. |
| 27 |
revert k. |
| 28 |
let x := match goal with |- let k := ?x in _ => constr:(x) end in |
| 29 |
intro k; clear k; |
| 30 |
pose (x _). |
| 31 |
pose (@isequiv_homotopic _ _ ((g o f) o f^-1) g _ |
| 32 |
(fun b => ap g (eisretr f b))). |
| 33 |
Undo. |
| 34 |
apply (@isequiv_homotopic _ _ ((g o f) o f^-1) g _ |
| 35 |
(fun b => ap g (eisretr f b))). |
| 36 |
Qed. |