| 1 |
|
| 2 |
(* File reduced by coq-bug-finder from original input, then from 1889 lines to 144 lines, then from 158 lines to 144 lines *) |
| 3 |
(* coqc version 8.5pl1 (April 2016) compiled on Apr 18 2016 14:48:5 with OCaml 4.02.3 |
| 4 |
coqtop version 8.5pl1 (April 2016) *) |
| 5 |
Axiom proof_admitted : False. |
| 6 |
Tactic Notation "admit" := abstract case proof_admitted. |
| 7 |
Global Set Universe Polymorphism. |
| 8 |
Global Set Asymmetric Patterns. |
| 9 |
Notation "'exists' x .. y , p" := (sigT (fun x => .. (sigT (fun y => p)) ..)) |
| 10 |
(at level 200, x binder, right associativity, |
| 11 |
format "'[' 'exists' '/ ' x .. y , '/ ' p ']'") |
| 12 |
: type_scope. |
| 13 |
Definition relation (A : Type) := A -> A -> Type. |
| 14 |
Class Transitive {A} (R : relation A) := transitivity : forall x y z, R x y -> R y z -> R x z. |
| 15 |
Tactic Notation "etransitivity" open_constr(y) := |
| 16 |
let R := match goal with |- ?R ?x ?z => constr:(R) end in |
| 17 |
let x := match goal with |- ?R ?x ?z => constr:(x) end in |
| 18 |
let z := match goal with |- ?R ?x ?z => constr:(z) end in |
| 19 |
refine (@transitivity _ R _ x y z _ _). |
| 20 |
Tactic Notation "etransitivity" := etransitivity _. |
| 21 |
Notation "( x ; y )" := (existT _ x y) : fibration_scope. |
| 22 |
Open Scope fibration_scope. |
| 23 |
Notation pr1 := projT1. |
| 24 |
Notation pr2 := projT2. |
| 25 |
Notation "x .1" := (projT1 x) : fibration_scope. |
| 26 |
Notation "x .2" := (projT2 x) : fibration_scope. |
| 27 |
Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a. |
| 28 |
Arguments idpath {A a} , [A] a. |
| 29 |
Arguments paths_rect [A] a P f y p : rename. |
| 30 |
Notation "x = y :> A" := (@paths A x y) : type_scope. |
| 31 |
Notation "x = y" := (x = y :>_) : type_scope. |
| 32 |
Delimit Scope path_scope with path. |
| 33 |
Local Open Scope path_scope. |
| 34 |
Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z := |
| 35 |
match p, q with idpath, idpath => idpath end. |
| 36 |
#[export] Instance transitive_paths {A} : Transitive (@paths A) | 0 := @concat A. |
| 37 |
Definition inverse {A : Type} {x y : A} (p : x = y) : y = x |
| 38 |
:= match p with idpath => idpath end. |
| 39 |
Notation "1" := idpath : path_scope. |
| 40 |
Notation "p @ q" := (concat p q) (at level 20) : path_scope. |
| 41 |
Notation "p ^" := (inverse p) (at level 3) : path_scope. |
| 42 |
Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y := |
| 43 |
match p with idpath => u end. |
| 44 |
Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing) : path_scope. |
| 45 |
Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y |
| 46 |
:= match p with idpath => idpath end. |
| 47 |
Definition apD {A:Type} {B:A->Type} (f:forall a:A, B a) {x y:A} (p:x=y): |
| 48 |
p # (f x) = f y |
| 49 |
:= match p with idpath => idpath end. |
| 50 |
Lemma transport_compose {A B} {x y : A} (P : B -> Type) (f : A -> B) |
| 51 |
(p : x = y) (z : P (f x)) |
| 52 |
: transport (fun x => P (f x)) p z = transport P (ap f p) z. |
| 53 |
admit. |
| 54 |
Defined. |
| 55 |
Local Open Scope path_scope. |
| 56 |
Generalizable Variables X A B C f g n. |
| 57 |
Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P) |
| 58 |
(pq : {p : u.1 = v.1 & p # u.2 = v.2}) |
| 59 |
: u = v |
| 60 |
:= match pq with |
| 61 |
| existT p q => |
| 62 |
match u, v return (forall p0 : (u.1 = v.1), (p0 # u.2 = v.2) -> (u=v)) with |
| 63 |
| (x;y), (x';y') => fun p1 q1 => |
| 64 |
match p1 in (_ = x'') return (forall y'', (p1 # y = y'') -> (x;y)=(x'';y'')) with |
| 65 |
| idpath => fun y' q2 => |
| 66 |
match q2 in (_ = y'') return (x;y) = (x;y'') with |
| 67 |
| idpath => 1 |
| 68 |
end |
| 69 |
end y' q1 |
| 70 |
end p q |
| 71 |
end. |
| 72 |
Definition path_sigma {A : Type} (P : A -> Type) (u v : sigT P) |
| 73 |
(p : u.1 = v.1) (q : p # u.2 = v.2) |
| 74 |
: u = v |
| 75 |
:= path_sigma_uncurried P u v (p;q). |
| 76 |
Definition projT1_path `{P : A -> Type} {u v : sigT P} (p : u = v) |
| 77 |
: u.1 = v.1 |
| 78 |
:= |
| 79 |
ap (@projT1 _ _) p. |
| 80 |
Notation "p ..1" := (projT1_path p) (at level 3) : fibration_scope. |
| 81 |
Definition projT2_path `{P : A -> Type} {u v : sigT P} (p : u = v) |
| 82 |
: p..1 # u.2 = v.2 |
| 83 |
:= (transport_compose P (@projT1 _ _) p u.2)^ |
| 84 |
@ (@apD {x:A & P x} _ (@projT2 _ _) _ _ p). |
| 85 |
Notation "p ..2" := (projT2_path p) (at level 3) : fibration_scope. |
| 86 |
Definition eta_path_sigma_uncurried `{P : A -> Type} {u v : sigT P} |
| 87 |
(p : u = v) |
| 88 |
: path_sigma_uncurried _ _ _ (p..1; p..2) = p. |
| 89 |
admit. |
| 90 |
Defined. |
| 91 |
Definition eta_path_sigma `{P : A -> Type} {u v : sigT P} (p : u = v) |
| 92 |
: path_sigma _ _ _ (p..1) (p..2) = p |
| 93 |
:= eta_path_sigma_uncurried p. |
| 94 |
|
| 95 |
Definition path_path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P) |
| 96 |
(p q : u = v) |
| 97 |
(rs : {r : p..1 = q..1 & transport (fun x => transport P x u.2 = v.2) r p..2 = q..2}) |
| 98 |
: p = q. |
| 99 |
Proof. |
| 100 |
destruct rs, p, u. |
| 101 |
etransitivity; [ | apply eta_path_sigma ]. |
| 102 |
simpl in *. |
| 103 |
induction p0. |
| 104 |
admit. |
| 105 |
Defined. |