| 1 |
Require Import TestSuite.admit. |
| 2 |
Inductive paths {A : Type} (a : A) : A -> Type := |
| 3 |
idpath : paths a a. |
| 4 |
|
| 5 |
Arguments idpath {A a} , [A] a. |
| 6 |
|
| 7 |
Arguments paths_ind [A] a P f y p : rename. |
| 8 |
Arguments paths_rec [A] a P f y p : rename. |
| 9 |
Arguments paths_rect [A] a P f y p : rename. |
| 10 |
|
| 11 |
Notation "x = y :> A" := (@paths A x y) : type_scope. |
| 12 |
Notation "x = y" := (x = y :>_) : type_scope. |
| 13 |
|
| 14 |
Definition Sect {A B : Type} (s : A -> B) (r : B -> A) := |
| 15 |
forall x : A, r (s x) = x. |
| 16 |
|
| 17 |
Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y |
| 18 |
:= match p with idpath => idpath end. |
| 19 |
|
| 20 |
(** A typeclass that includes the data making [f] into an adjoint equivalence. *) |
| 21 |
Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv { |
| 22 |
equiv_inv : B -> A ; |
| 23 |
eisretr : Sect equiv_inv f; |
| 24 |
eissect : Sect f equiv_inv; |
| 25 |
eisadj : forall x : A, eisretr (f x) = ap f (eissect x) |
| 26 |
}. |
| 27 |
|
| 28 |
Record Equiv A B := BuildEquiv { |
| 29 |
equiv_fun :> A -> B ; |
| 30 |
equiv_isequiv :> IsEquiv equiv_fun |
| 31 |
}. |
| 32 |
|
| 33 |
|
| 34 |
Definition equiv_path (A B : Type) (p : A = B) : Equiv A B. |
| 35 |
Admitted. |
| 36 |
|
| 37 |
Class Univalence := { |
| 38 |
isequiv_equiv_path :: forall (A B : Type), IsEquiv (equiv_path A B) |
| 39 |
}. |
| 40 |
|
| 41 |
Definition ua_downward_closed `{Univalence} : Univalence. |
| 42 |
constructor. |
| 43 |
intros A B. |
| 44 |
destruct H as [H]. |
| 45 |
generalize (fun A B => @eisretr _ _ _ (H (A : Type) (B : Type))). |
| 46 |
generalize (fun A B => @eissect _ _ _ (H (A : Type) (B : Type))). |
| 47 |
let g := match goal with |- _ -> _ -> ?g => constr:(g) end in |
| 48 |
let U0 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U0) end in |
| 49 |
let U1 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U1) end in |
| 50 |
let U2 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U2) end in |
| 51 |
let U3 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(U3) end in |
| 52 |
let f0 := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(f) end in |
| 53 |
let f' := match goal with |- (forall (A : ?U0) (B : ?U1), Sect (@?f A B) _) -> (forall (A : ?U2) (B : ?U3), Sect _ (@?f' A B)) -> ?g => constr:(f') end in |
| 54 |
change ((forall (A : U0) (B : U1), Sect (f0 A B) ((fun (A : U0) (B : U1) => @equiv_inv _ _ _ (H A B)) A B)) |
| 55 |
-> (forall (A : U2) (B : U3), Sect ((fun (A : U0) (B : U1) => @equiv_inv _ _ _ (H A B)) A B) (f' A B)) |
| 56 |
-> g); |
| 57 |
generalize (fun (A : U0) (B : U1) => @equiv_inv _ _ _ (H A B)); |
| 58 |
clear H; |
| 59 |
simpl; |
| 60 |
intros fi sect retr. |
| 61 |
pose proof fi as fi'. |
| 62 |
Set Printing All. |
| 63 |
change (forall (A : Type) (B : Type) (_ : Equiv A B), @paths Type A B) in fi'. |
| 64 |
(*refine (@isequiv_adjointify |
| 65 |
_ _ |
| 66 |
_ _ |
| 67 |
_ |
| 68 |
_); |
| 69 |
admit. |
| 70 |
Grab Existential Variables.*) |
| 71 |
admit. |
| 72 |
(*destruct p.*) |
| 73 |
(*specialize (H (A' : Type)).*) |
| 74 |
Defined. |
| 75 |
(* Error: Unsatisfied constraints: |
| 76 |
Top.62 < Top.61 |
| 77 |
Top.64 <= Top.62 |
| 78 |
Top.63 <= Top.62 |
| 79 |
(maybe a bugged tactic).*) |