Skip to content

Commit 5c938e4

Browse files
Merge pull request #2319 from jdchristensen/misc
Miscellaneous small changes
2 parents cf42af7 + e617f21 commit 5c938e4

File tree

12 files changed

+85
-30
lines changed

12 files changed

+85
-30
lines changed

theories/Basics/Overture.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ Arguments transport {A}%_type_scope P%_function_scope {x y} p%_path_scope u : si
396396
Notation "p # u" := (transport _ p u) (only parsing) : path_scope.
397397

398398
(** The first time [rewrite] is used in each direction, it creates transport lemmas called [internal_paths_rew] and [internal_paths_rew_r]. See ../Tactics.v for how these compare to [transport]. We use [rewrite] here to trigger the creation of these lemmas. This ensures that they are defined outside of sections, so they are not unnecessarily polymorphic. The lemmas below are not used in the library. *)
399-
(** TODO: If Coq PR#18299 is merged (possibly in Coq 8.20), then we can instead register wrappers for [transport] to be used for rewriting. See the comment by Dan Christensen in that PR for how to do this. Then the tactics [internal_paths_rew_to_transport] and [rewrite_to_transport] can be removed from ../Tactics.v. *)
399+
(** TODO: Since Coq 8.20 has PR#18299, once that is our minimum version we can instead register wrappers for [transport] to be used for rewriting. See the comment by Dan Christensen in that PR for how to do this. Then the tactics [internal_paths_rew_to_transport] and [rewrite_to_transport] can be removed from ../Tactics.v. *)
400400
Local Lemma define_internal_paths_rew A x y P (u : P x) (H : x = y :> A) : P y.
401401
Proof. rewrite <- H. exact u. Defined.
402402

theories/Basics/Settings.v

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
(** This file contains all the tweaks and settings we make to Coq. *)
44

5-
(** ** Warnings *)
6-
75
(** ** Plugins *)
86

97
(** Load the Ltac plugin. This is the tactic language we use for proofs. *)

theories/Basics/Trunc.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ Definition nat_to_trunc_index@{} (n : nat) : trunc_index
5656

5757
Coercion nat_to_trunc_index : nat >-> trunc_index.
5858

59-
Definition trunc_index_inc'_0n (n : nat)
59+
Definition trunc_index_inc'_0n@{} (n : nat)
6060
: trunc_index_inc' 0%nat n = n.
6161
Proof.
62-
induction n as [|n p].
62+
simple_induction n n IHn.
6363
1: reflexivity.
6464
refine (trunc_index_inc'_succ _ _ @ _).
65-
exact (ap _ p).
65+
exact (ap _ IHn).
6666
Defined.
6767

6868
Definition int_to_trunc_index@{} (v : Decimal.int) : option trunc_index

theories/Categories/Category/Morphisms.v

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(** * Definitions and theorems about {iso,epi,mono,}morphisms in a precategory *)
22
Require Import Category.Core Functor.Core.
3-
Require Import HoTT.Tactics Basics.Trunc Basics.Tactics Types.Sigma Equivalences.
3+
Require Import HoTT.Tactics Basics.Trunc Basics.Tactics Basics.Equivalences Types.Sigma.
44

55
Set Universe Polymorphism.
66
Set Implicit Arguments.
@@ -44,9 +44,6 @@ Local Infix "<~=~>" := Isomorphic : category_scope.
4444
(** ** Theorems about isomorphisms *)
4545
Section iso_contr.
4646
Variable C : PreCategory.
47-
48-
49-
5047
Variables s d : C.
5148

5249
Local Notation IsIsomorphism_sig_T m :=

theories/Homotopy/HSpace/Moduli.v

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,30 @@ Proof.
7474
apply concat_p1.
7575
Defined.
7676

77-
(** Our next goal is to see that when [A] is a left-invertible H-space, then the fibration [ev A] is trivial. *)
77+
(** Our next goal is to see that when [A] is a left-invertible H-space, then the fibration [ev A] is trivial. We begin with two results that allow the domain to be a general pointed type [B]. We'll later just need the case when [B] is [A]. *)
7878

79-
(** This lemma says that the family [fun a => A ->* [A,a]] is trivial. *)
80-
Lemma equiv_pmap_hspace `{Funext} {A : pType}
79+
(** This lemma says that the family [fun a => B ->* [A,a]] is trivial. *)
80+
Lemma equiv_pmap_hspace `{Funext} {A B : pType}
8181
(a : A) `{IsHSpace A} `{!IsEquiv (hspace_op a)}
82-
: (A ->* A) <~> (A ->* [A,a]).
82+
: (B ->* A) <~> (B ->* [A,a]).
8383
Proof.
8484
napply pequiv_pequiv_postcompose.
8585
rapply pequiv_hspace_left_op.
8686
Defined.
8787

88-
(** The lemma gives us an equivalence on the total spaces (domains) of [ev A] and [psnd] (the projection out of the displayed product). *)
89-
Proposition equiv_map_pmap_hspace `{Funext} {A : pType}
88+
(** The next result is a consequence of the previous lemma. *)
89+
Proposition equiv_map_pmap_hspace `{Funext} {A B : pType}
9090
`{IsHSpace A} `{forall a:A, IsEquiv (a *.)}
91-
: (A ->* A) * A <~> (A -> A).
91+
: (B ->* A) * A <~> (B -> A).
9292
Proof.
93-
transitivity {a : A & {f : A -> A & f pt = a}}.
93+
transitivity {a : A & {f : B -> A & f pt = a}}.
9494
2: exact (equiv_sigma_contr _ oE (equiv_sigma_symm _)^-1%equiv).
9595
refine (_ oE (equiv_sigma_prod0 _ _)^-1%equiv oE equiv_prod_symm _ _).
9696
apply equiv_functor_sigma_id; intro a.
97-
exact ((issig_pmap A [A,a])^-1%equiv oE equiv_pmap_hspace a).
97+
exact ((issig_pmap B [A,a])^-1%equiv oE equiv_pmap_hspace a).
9898
Defined.
9999

100-
(** The above is a pointed equivalence. *)
100+
(** The equivalence [equiv_map_pmap_hspace] is pointed when [B] is [A]. (Note that [selfmaps A] is pointed at [idmap].) This is a pointed equivalence between the domains of [psnd : (A ->* A) * A ->* A] and [ev A : selfmaps A -> A], respectively. *)
101101
Proposition pequiv_map_pmap_hspace `{Funext} {A : pType}
102102
`{IsHSpace A} `{forall a:A, IsEquiv (a *.)}
103103
: [(A ->* A) * A, (pmap_idmap, pt)] <~>* selfmaps A.

theories/Homotopy/Join/Core.v

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Section Join.
3030

3131
Definition Join_ind {A B : Type} (P : Join A B -> Type)
3232
(P_A : forall a, P (joinl a)) (P_B : forall b, P (joinr b))
33-
(P_g : forall a b, transport P (jglue a b) (P_A a) = (P_B b))
33+
(P_g : forall a b, transport P (jglue a b) (P_A a) = P_B b)
3434
: forall (x : Join A B), P x.
3535
Proof.
3636
apply (Pushout_ind P P_A P_B).
@@ -145,7 +145,7 @@ Arguments joinr {A B}%_type_scope _ , A [B] _.
145145

146146
(** ** Zigzags in joins *)
147147

148-
(** These paths are very common, so we give them names. *)
148+
(** These paths are very common, so we give them names and prove a few results about them. *)
149149
Definition zigzag {A B : Type} (a a' : A) (b : B)
150150
: joinl a = joinl a'
151151
:= jglue a b @ (jglue a' b)^.
@@ -154,6 +154,14 @@ Definition zagzig {A B : Type} (a : A) (b b' : B)
154154
: joinr b = joinr b'
155155
:= (jglue a b)^ @ jglue a b'.
156156

157+
Definition zigzag_zigzag {A B : Type} (a a' : A) (b : B)
158+
: zigzag a a' b @ zigzag a' a b = 1
159+
:= concat_pp_p _ _ _ @ (1 @@ concat_V_pp _ _) @ concat_pV _.
160+
161+
Definition zigzag_inv {A B : Type} (a a' : A) (b : B)
162+
: (zigzag a a' b)^ = zigzag a' a b
163+
:= inv_pp _ _ @ (inv_V _ @@ 1).
164+
157165
(** And we give a beta rule for zigzags. *)
158166
Definition Join_rec_beta_zigzag {A B P : Type} (P_A : A -> P)
159167
(P_B : B -> P) (P_g : forall a b, P_A a = P_B b) a a' b

theories/Spaces/Nat/Core.v

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Scheme leq_ind := Induction for leq Sort Type.
135135
Scheme leq_rect := Induction for leq Sort Type.
136136
Scheme leq_rec := Induction for leq Sort Type.
137137

138-
Notation "n <= m" := (leq n m) : nat_scope.
138+
Infix "<=" := leq : nat_scope.
139139

140140
Existing Class leq.
141141
Existing Instances leq_refl leq_succ_r.
@@ -144,25 +144,27 @@ Existing Instances leq_refl leq_succ_r.
144144

145145
(** We define the less-than relation [lt] in terms of [leq] *)
146146
Definition lt n m : Type0 := leq (S n) m.
147+
Infix "<" := lt : nat_scope.
147148

148149
(** We declare it as an existing class so typeclass search is performed on its goals. *)
149150
Existing Class lt.
150151
#[export] Hint Unfold lt : typeclass_instances.
151-
Infix "<" := lt : nat_scope.
152152

153153
(** *** Greater than or equal To [>=] *)
154154

155155
Definition geq n m := leq m n.
156+
Infix ">=" := geq : nat_scope.
157+
156158
Existing Class geq.
157159
#[export] Hint Unfold geq : typeclass_instances.
158-
Infix ">=" := geq : nat_scope.
159160

160161
(*** Greater Than [>] *)
161162

162163
Definition gt n m := lt m n.
164+
Infix ">" := gt : nat_scope.
165+
163166
Existing Class gt.
164167
#[export] Hint Unfold gt : typeclass_instances.
165-
Infix ">" := gt : nat_scope.
166168

167169
(** *** Combined comparison predicates *)
168170

theories/Types/Equiv.v

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Defined.
222222
(** A version that shows that the underlying functions are equal. *)
223223
Definition transport_equiv' {A : Type} {B C : A -> Type}
224224
{x1 x2 : A} (p : x1 = x2) (f : B x1 <~> C x1)
225-
: transport (fun x => B x <~> C x) p f = (equiv_transport _ p) oE f oE (equiv_transport _ p^) :> (B x2 -> C x2).
225+
: transport (fun x => B x <~> C x) p f = (transport _ p) o f o (transport _ p^) :> (B x2 -> C x2).
226226
Proof.
227227
destruct p; auto.
228228
Defined.
@@ -235,3 +235,49 @@ Proof.
235235
apply path_equiv.
236236
destruct p; auto.
237237
Defined.
238+
239+
(** The special case when the codomain type is constant. *)
240+
Definition transport_equiv_toconst {A : Type} {B : A -> Type} {C : Type}
241+
{x1 x2 : A} (p : x1 = x2) (f : B x1 <~> C) (y : B x2)
242+
: (transport (fun x => B x <~> C) p f) y = f (p^ # y).
243+
Proof.
244+
by destruct p.
245+
Defined.
246+
247+
Definition transport_equiv_toconst' {A : Type} {B : A -> Type} {C : Type}
248+
{x1 x2 : A} (p : x1 = x2) (f : B x1 <~> C)
249+
: transport (fun x => B x <~> C) p f = f o (transport _ p^) :> (B x2 -> C).
250+
Proof.
251+
by destruct p.
252+
Defined.
253+
254+
Definition transport_equiv_toconst'' `{Funext} {A : Type} {B : A -> Type} {C : Type}
255+
{x1 x2 : A} (p : x1 = x2) (f : B x1 <~> C)
256+
: transport (fun x => B x <~> C) p f = f oE (equiv_transport _ p^).
257+
Proof.
258+
apply path_equiv.
259+
by destruct p.
260+
Defined.
261+
262+
(** The special case when the domain type is constant. *)
263+
Definition transport_equiv_fromconst {A B : Type} {C : A -> Type}
264+
{x1 x2 : A} (p : x1 = x2) (f : B <~> C x1) (y : B)
265+
: (transport (fun x => B <~> C x) p f) y = p # (f y).
266+
Proof.
267+
by destruct p.
268+
Defined.
269+
270+
Definition transport_equiv_fromconst' {A B : Type} {C : A -> Type}
271+
{x1 x2 : A} (p : x1 = x2) (f : B <~> C x1)
272+
: (transport (fun x => B <~> C x) p f) = transport C p o f :> (B -> C x2).
273+
Proof.
274+
by destruct p.
275+
Defined.
276+
277+
Definition transport_equiv_fromconst'' `{Funext} {A B : Type} {C : A -> Type}
278+
{x1 x2 : A} (p : x1 = x2) (f : B <~> C x1)
279+
: (transport (fun x => B <~> C x) p f) = equiv_transport C p oE f.
280+
Proof.
281+
apply path_equiv.
282+
by destruct p.
283+
Defined.

theories/Universes/HProp.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Proof.
128128
- exact (fun _ => p).
129129
Defined.
130130

131-
(** If an hprop is not inhabited, then it is equivalent to [Empty]. Note that we'd don't need the assumption that the type is an hprop here. *)
131+
(** If an hprop is not inhabited, then it is equivalent to [Empty]. Note that we don't need the assumption that the type is an hprop here. *)
132132
Definition if_not_hprop_then_equiv_Empty (hprop : Type) : ~hprop -> hprop <~> Empty
133133
:= equiv_to_empty.
134134

theories/WildCat/Category.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Require Import WildCat.Core WildCat.NatTrans WildCat.FunctorCat.
33

44
(** * Category of categories *)
55

6-
(** TODO: make into a bicategory *)
6+
(** TODO: make into a bicategory; define equivalences *)
77

88
(** ** Definition *)
99

0 commit comments

Comments
 (0)