-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lemma 5.8.2. from the book #2143
base: master
Are you sure you want to change the base?
Changes from all commits
da84429
07b908e
045f2f6
8b27a22
6c4630f
716d22a
8e7e6f8
5f2eb24
952cc85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Require Import Basics Types. | ||
Require Import HoTT.Tactics. | ||
|
||
(** A nice method for proving characterizations of path-types of nested sigma-types, due to Rijke. *) | ||
|
||
|
@@ -79,3 +80,114 @@ Ltac contr_sigsig a c := | |
|
||
(** For examples of the use of this tactic, see for instance [Factorization] and [Idempotents]. *) | ||
|
||
(** Given that some type family [R] is fiber-wise equivalent to identity types based at [a], then the total space [sig R] is contractible. This is part of Theorem 5.8.2, (iii) implies (iv). *) | ||
Definition contr_sigma_refl_rel {A : Type} | ||
(a : A) (R : A -> Type) (r0 : R a) | ||
(f : forall b, (a = b) <~> R b) | ||
: Contr (sig R). | ||
Proof. | ||
rapply contr_equiv'. | ||
1: exact (equiv_functor_sigma_id f). | ||
apply contr_basedpaths. | ||
Defined. | ||
|
||
(** There are also some additional properties that we can be use to characterize identity types. A pointed type family is an identity system if it satisfies the J-rule. *) | ||
Class IsIdentitySystem {A : Type} {a0 : A} (R : A -> Type) (r0 : R a0) | ||
:= | ||
{ IdentitySystem_ind (D : forall a : A, R a -> Type) (d : D a0 r0) (a : A) (r : R a) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually we use capitals in the name of a class or type, but not in the names of other results about that class or type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should also add that I had some trouble figuring out why some terms were not working, but I later realised my editor had substituted I would suggest calling this something like |
||
: D a r; | ||
IdentitySystem_ind_beta (D : forall a : A, R a -> Type) (d : D a0 r0) | ||
: IdentitySystem_ind D d a0 r0 = d | ||
}. | ||
|
||
(** The mapping space between two pointed type families over the same base point, is a family of maps that preserves the basepoint. *) | ||
Definition pfamMap {A : Type} {a0 : A} | ||
(R S : A -> Type) (r0 : R a0) (s0 : S a0) : Type | ||
:= {f : forall a : A, R a -> S a & f a0 r0 = s0}. | ||
|
||
(** We can also consider pointed homotopies between maps of pointed type families. *) | ||
Definition path_pfamMap {A : Type} {a0 : A} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing about capitalization of |
||
{R S : A -> Type} {r0 : R a0} {s0 : S a0} | ||
(f g : pfamMap R S r0 s0) : Type | ||
:= { p : forall a : A, pr1 f a == pr1 g a & p a0 r0 = pr2 f @ (pr2 g)^}. | ||
|
||
(** Given that a pointed type family [R], [r0] is an identity system, then the mapping space of pointed type families starting at [R] is homotopy contractible. This is a weak form of Theorem 5.8.2, (i) implies (ii). *) | ||
Definition homocontr_pfamMap_identitysystem {A : Type} {a0 : A} | ||
(R : A -> Type) (r0 : R a0) `{!IsIdentitySystem R r0} | ||
(S : A -> Type) (s0 : S a0) | ||
: exists f : pfamMap R S r0 s0, forall g, path_pfamMap f g. | ||
Proof. | ||
pose (to_S := IdentitySystem_ind (fun a _ => S a) s0). | ||
pose proof (to_S_beta := IdentitySystem_ind_beta (fun a _ => S a) s0). | ||
snrefine ((to_S; to_S_beta); _). | ||
intro g. | ||
exists (IdentitySystem_ind (fun a r => to_S a r = pr1 g a r) | ||
(to_S_beta @ (pr2 g)^)). | ||
snrapply IdentitySystem_ind_beta. | ||
Defined. | ||
|
||
(** If a pointed type family [R], [r0] has homotopy contractible mapping spaces as in the sense above, then [fun p => transport R p r0] is a fiber-wise equivalence. This is a strong form of Theorem 5.8.2, (ii) implies (iii). *) | ||
Definition equiv_path_homocontr_pfamMap {A : Type} {a0 : A} (R : A -> Type) (r0 : R a0) | ||
(H : forall S : A -> Type, forall s0 : S a0, exists f : pfamMap R S r0 s0, forall g, path_pfamMap f g) (a : A) | ||
: IsEquiv (fun p : a0 = a => transport R p r0). | ||
Proof. | ||
pose (inv (a : A) := (pr1 o pr1) (H (fun a => a0 = a) 1) a). | ||
pose proof (inv_beta := (pr2 o pr1) (H (fun a => a0 = a) 1)); | ||
cbn in inv_beta. | ||
snrapply (isequiv_adjointify _ (inv a)); cbn. | ||
- intro r. | ||
snrefine (_ @ _). | ||
+ exact ((pr1 o pr1) (H R r0) a r). | ||
+ exact ((pr1 (pr2 (H R r0) | ||
(fun a r => transport R (inv a r) r0; | ||
((ap (fun x => transport R x r0) inv_beta))))) a r)^. | ||
+ exact ((pr1 (pr2 (H R r0) (fun a r => r; (idpath r0)))) a r). | ||
- by intros []. | ||
Defined. | ||
|
||
(** For any pointed type family [R], [r0] such that the total space of [R] is contractible, then [R], [r0] is an identity system. This is Theorem 5.8.2, (iv) implies (i). *) | ||
Definition IsIdentitySystem_contr_sigma {A : Type} {a0 : A} (R : A -> Type) | ||
(r0 : R a0) {C : Contr (sig R)} | ||
: IsIdentitySystem R r0. | ||
Proof. | ||
snrapply Build_IsIdentitySystem. | ||
- intros D d0 a r. | ||
exact (transport | ||
(fun ar : sig R => D (pr1 ar) (pr2 ar)) | ||
((@contr _ C (a0; r0))^ @ @contr _ C (a; r)) d0). | ||
- intros D d0; cbn. | ||
by lhs nrapply (ap (fun x => transport _ x _) (concat_Vp _)). | ||
Defined. | ||
|
||
(** The fundamental theorem of identity systems tells us that these four different properties are logically equivalent. *) | ||
Definition FundamentalThmIdentitySystems {A : Type} {a0 : A} (R : A -> Type) (r0 : R a0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's worth stating this result. It's the individual implications that are useful. (For two equivalent things, it's sometimes handy to state an iff version using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be possible to write down a general term for "the following are equivalent" which would take a Mathcomp does something like this https://github.com/math-comp/math-comp/blob/0240d6c7c46015d333b12889b04acd179224d9d3/mathcomp/ssreflect/seq.v#L4704 |
||
: (IsIdentitySystem R r0 -> forall S : A -> Type, forall s0 : S a0, exists f : pfamMap R S r0 s0, forall g, path_pfamMap f g) | ||
* ((forall S : A -> Type, forall s0 : S a0, | ||
exists f : pfamMap R S r0 s0, forall g, path_pfamMap f g) | ||
-> forall a : A, IsEquiv (fun p : a0 = a => transport R p r0)) | ||
* ((forall a : A, IsEquiv (fun p : a0 = a => transport R p r0)) | ||
-> Contr (sig R)) | ||
* (Contr (sig R) -> IsIdentitySystem R r0). | ||
Proof. | ||
repeat split. | ||
- nrapply homocontr_pfamMap_identitysystem. | ||
- nrapply equiv_path_homocontr_pfamMap. | ||
- intros e_transport. | ||
exact (contr_sigma_refl_rel a0 R r0 | ||
(fun a => @Build_Equiv _ _ _ (e_transport a))). | ||
- nrapply IsIdentitySystem_contr_sigma. | ||
Defined. | ||
|
||
(** It is useful to have some composites of the above. Given an identity system, transporting the point [r0] induces a fiber-wise equivalence between the based path type on [a0] and [R]. This is Theorem 5.8.2 (i) implies (iii) from the Book. *) | ||
Global Instance isequiv_transport_IsIdentitySystem {A : Type} {a0 : A} | ||
(R : A -> Type) (r0 : R a0) `{!IsIdentitySystem _ r0} (a : A) | ||
: IsEquiv (fun p : a0 = a => transport R p r0). | ||
Proof. | ||
nrapply equiv_path_homocontr_pfamMap. | ||
by nrapply homocontr_pfamMap_identitysystem. | ||
Defined. | ||
|
||
Definition equiv_transport_IsIdentitySystem {A : Type} {a0 : A} | ||
(R : A -> Type) (r0 : R a0) `{!IsIdentitySystem _ r0} (a : A) | ||
: (a0 = a) <~> R a | ||
:= Build_Equiv _ _ (fun p => transport R p r0) _. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is a bit odd, since the method is much more general than nested sigma types. How about completely replacing it with a sentence saying that this file gives several characterizations of path types, following Theorem 5.8.2 in the book. And move the comment about EncodeDecode to this spot too.