| 1 |
Require Import TestSuite.admit. |
| 2 |
(* File reduced by coq-bug-finder from original input, then from 12105 lines to 142 lines, then from 83 lines to 57 lines *) |
| 3 |
Generalizable All Variables. |
| 4 |
Axiom admit : forall {T}, T. |
| 5 |
Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope. |
| 6 |
Arguments idpath {A a} , [A] a. |
| 7 |
Scheme Rewriting for paths. |
| 8 |
Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := match p with idpath => u end. |
| 9 |
Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing). |
| 10 |
Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with idpath => idpath end. |
| 11 |
Definition apD {A:Type} {B:A->Type} (f:forall a:A, B a) {x y:A} (p:x=y): transport _ p (f x) = f y := admit. |
| 12 |
Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := forall x : A, r (s x) = x. |
| 13 |
Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { |
| 14 |
equiv_inv : B -> A ; |
| 15 |
eisretr : Sect equiv_inv f; |
| 16 |
eissect : Sect f equiv_inv; |
| 17 |
eisadj : forall x : A, eisretr (f x) = ap f (eissect x) }. |
| 18 |
Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3). |
| 19 |
Axiom path_forall : forall {A : Type} {P : A -> Type} (f g : forall x : A, P x), (forall x, f x = g x) -> f = g. |
| 20 |
Axiom isequiv_adjointify : forall {A B} (f : A -> B) (g : B -> A) (isretr : Sect g f) (issect : Sect f g), IsEquiv f. |
| 21 |
Definition functor_forall `{P : A -> Type} `{Q : B -> Type} (f0 : B -> A) (f1 : forall b:B, P (f0 b) -> Q b) |
| 22 |
: (forall a:A, P a) -> (forall b:B, Q b) := (fun g b => f1 _ (g (f0 b))). |
| 23 |
Goal forall `{P : A -> Type} `{Q : B -> Type} `{IsEquiv B A f} `{forall b, @IsEquiv (P (f b)) (Q b) (g b)}, |
| 24 |
IsEquiv (functor_forall f g). |
| 25 |
Proof. |
| 26 |
intros. |
| 27 |
refine (isequiv_adjointify (functor_forall f g) |
| 28 |
(functor_forall (f^-1) |
| 29 |
(fun (x:A) (y:Q (f^-1 x)) => @eisretr _ _ f H x # (g (f^-1 x))^-1 y |
| 30 |
)) _ _); intros h. |
| 31 |
- abstract ( |
| 32 |
apply path_forall; intros b; unfold functor_forall; |
| 33 |
rewrite eisadj; |
| 34 |
admit |
| 35 |
). |
| 36 |
- abstract ( |
| 37 |
apply path_forall; intros a; unfold functor_forall; |
| 38 |
rewrite eissect; |
| 39 |
apply apD |
| 40 |
). |
| 41 |
Defined. |