| 1 |
(* Inductive paths {A} (x : A) : A -> Type := idpath : paths x x where "x = y" := (@paths _ x y) : type_scope. *) |
| 2 |
(* Goal forall A B : Set, @paths Type A B -> @paths Set A B. *) |
| 3 |
(* intros A B H. *) |
| 4 |
(* Fail exact H. *) |
| 5 |
(* Section . *) |
| 6 |
|
| 7 |
Unset Strict Universe Declaration. |
| 8 |
|
| 9 |
#[universes(polymorphic)] |
| 10 |
Section lift_strict. |
| 11 |
Polymorphic Definition liftlt := |
| 12 |
let t := Type@{i} : Type@{k} in |
| 13 |
fun A : Type@{i} => A : Type@{k}. |
| 14 |
|
| 15 |
Polymorphic Definition liftle := |
| 16 |
fun A : Type@{i} => A : Type@{k}. |
| 17 |
End lift_strict. |
| 18 |
|
| 19 |
|
| 20 |
Set Universe Polymorphism. |
| 21 |
|
| 22 |
(* Inductive option (A : Type) : Type := *) |
| 23 |
(* | None : option A *) |
| 24 |
(* | Some : A -> option A. *) |
| 25 |
|
| 26 |
Inductive option (A : Type@{i}) : Type@{i} := |
| 27 |
| None : option A |
| 28 |
| Some : A -> option A. |
| 29 |
|
| 30 |
Definition foo' {A : Type@{i}} (o : option@{i} A) : option@{i} A := |
| 31 |
o. |
| 32 |
|
| 33 |
Definition foo'' {A : Type@{i}} (o : option@{j} A) : option@{k} A := |
| 34 |
o. |
| 35 |
|
| 36 |
|
| 37 |
Definition testm (A : Type@{i}) : Type@{max(i,j)} := A. |
| 38 |
|
| 39 |
(* Inductive prod (A : Type@{i}) (B : Type@{j}) := *) |
| 40 |
(* | pair : A -> B -> prod A B. *) |
| 41 |
|
| 42 |
(* Definition snd {A : Type@{i}} (B : Type@{j}) (p : prod A B) : B := *) |
| 43 |
(* match p with *) |
| 44 |
(* | pair _ _ a b => b *) |
| 45 |
(* end. *) |
| 46 |
|
| 47 |
(* Definition snd' {A : Type@{i}} (B : Type@{i}) (p : prod A B) : B := *) |
| 48 |
(* match p with *) |
| 49 |
(* | pair _ _ a b => b *) |
| 50 |
(* end. *) |
| 51 |
|
| 52 |
(* Inductive paths {A : Type} : A -> A -> Type := *) |
| 53 |
(* | idpath (a : A) : paths a a. *) |
| 54 |
|
| 55 |
Inductive paths {A : Type@{i}} : A -> A -> Type@{i} := |
| 56 |
| idpath (a : A) : paths a a. |
| 57 |
|
| 58 |
Definition Funext := |
| 59 |
forall (A : Type) (B : A -> Type), |
| 60 |
forall f g : (forall a, B a), (forall x : A, paths (f x) (g x)) -> paths f g. |
| 61 |
|
| 62 |
Definition paths_lift_closed (A : Type@{i}) (x y : A) : |
| 63 |
paths x y -> @paths (liftle@{j Type} A) x y. |
| 64 |
Proof. |
| 65 |
intros. destruct X. exact (idpath _). |
| 66 |
Defined. |
| 67 |
|
| 68 |
Definition paths_lift (A : Type@{i}) (x y : A) : |
| 69 |
paths x y -> paths@{j} x y. |
| 70 |
Proof. |
| 71 |
intros. destruct X. exact (idpath _). |
| 72 |
Defined. |
| 73 |
|
| 74 |
Definition paths_lift_closed_strict (A : Type@{i}) (x y : A) : |
| 75 |
paths x y -> @paths (liftlt@{j Type} A) x y. |
| 76 |
Proof. |
| 77 |
intros. destruct X. exact (idpath _). |
| 78 |
Defined. |
| 79 |
|
| 80 |
Definition paths_downward_closed_le (A : Type@{i}) (x y : A) : |
| 81 |
paths@{j} (A:=liftle@{i j} A) x y -> paths@{i} x y. |
| 82 |
Proof. |
| 83 |
intros. destruct X. exact (idpath _). |
| 84 |
Defined. |
| 85 |
|
| 86 |
Definition paths_downward_closed_lt (A : Type@{i}) (x y : A) : |
| 87 |
@paths (liftlt@{j i} A) x y -> paths x y. |
| 88 |
Proof. |
| 89 |
intros. destruct X. exact (idpath _). |
| 90 |
Defined. |
| 91 |
|
| 92 |
Definition paths_downward_closed_lt_nolift (A : Type@{i}) (x y : A) : |
| 93 |
paths@{j} x y -> paths x y. |
| 94 |
Proof. |
| 95 |
intros. destruct X. exact (idpath _). |
| 96 |
Defined. |
| 97 |
|
| 98 |
Definition funext_downward_closed (F : Funext@{i' j' k'}) : |
| 99 |
Funext@{i j k}. |
| 100 |
Proof. |
| 101 |
intros A B f g H. red in F. |
| 102 |
pose (F A B f g (fun x => paths_lift _ _ _ (H x))). |
| 103 |
apply paths_downward_closed_lt_nolift. apply p. |
| 104 |
Defined. |
| 105 |
|