Skip to content

Commit 0009e18

Browse files
authored
Merge branch 'master' into ps/rr/biproducts
2 parents 3266da5 + f14c526 commit 0009e18

File tree

162 files changed

+2515
-1487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+2515
-1487
lines changed

.dir-locals.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
((nil . ((mode . visual-line))))

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -566,28 +566,28 @@ jobs:
566566
runs-on: ubuntu-latest
567567
steps:
568568
# Delete workspace artifacts
569-
- uses: geekyeggo/delete-artifact@v1
569+
- uses: geekyeggo/delete-artifact@v5
570570
with:
571571
name: workspace-${{ env.coq-version-supported }}
572-
- uses: geekyeggo/delete-artifact@v1
572+
- uses: geekyeggo/delete-artifact@v5
573573
with:
574574
name: workspace-latest
575-
- uses: geekyeggo/delete-artifact@v1
575+
- uses: geekyeggo/delete-artifact@v5
576576
with:
577577
name: workspace-dev
578578
# Delete documentation artifacts
579-
- uses: geekyeggo/delete-artifact@v1
579+
- uses: geekyeggo/delete-artifact@v5
580580
with:
581581
name: dep-graphs
582-
- uses: geekyeggo/delete-artifact@v1
582+
- uses: geekyeggo/delete-artifact@v5
583583
with:
584584
name: file-dep-graphs
585-
- uses: geekyeggo/delete-artifact@v1
585+
- uses: geekyeggo/delete-artifact@v5
586586
with:
587587
name: alectryon-html
588-
- uses: geekyeggo/delete-artifact@v1
588+
- uses: geekyeggo/delete-artifact@v5
589589
with:
590590
name: coqdoc-html
591-
- uses: geekyeggo/delete-artifact@v1
591+
- uses: geekyeggo/delete-artifact@v5
592592
with:
593593
name: timing-html

STYLE.md

Lines changed: 403 additions & 349 deletions
Large diffs are not rendered by default.

contrib/HoTTBook.v

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ Definition Book_3_3_1 := fun A => @HoTT.Basics.Overture.IsTrunc (-1) A.
390390
(* ================================================== thm:inhabprop-eqvunit *)
391391
(** Lemma 3.3.2 *)
392392

393-
Definition Book_3_3_2 := @HoTT.HProp.if_hprop_then_equiv_Unit.
393+
Definition Book_3_3_2 := @HoTT.Universes.HProp.if_hprop_then_equiv_Unit.
394394

395395
(* ================================================== lem:equiv-iff-hprop *)
396396
(** Lemma 3.3.3 *)
@@ -694,12 +694,12 @@ Definition Book_4_8_2 := @HoTT.HFiber.equiv_fibration_replacement.
694694
(* ================================================== thm:nobject-classifier-appetizer *)
695695
(** Theorem 4.8.3 *)
696696

697-
Definition Book_4_8_3 := @HoTT.ObjectClassifier.equiv_sigma_fibration.
697+
Definition Book_4_8_3 := @HoTT.Universes.ObjectClassifier.equiv_sigma_fibration.
698698

699699
(* ================================================== thm:object-classifier *)
700700
(** Theorem 4.8.4 *)
701701

702-
Definition Book_4_8_4 := @HoTT.ObjectClassifier.ispullback_objectclassifier_square.
702+
Definition Book_4_8_4 := @HoTT.Universes.ObjectClassifier.ispullback_objectclassifier_square.
703703

704704
(* ================================================== weakfunext *)
705705
(** Definition 4.9.1 *)
@@ -1000,7 +1000,7 @@ Definition Book_7_1_9 := @HoTT.Basics.Trunc.istrunc_forall.
10001000
(* ================================================== thm:hleveln-of-hlevelSn *)
10011001
(** Theorem 7.1.11 *)
10021002

1003-
Definition Book7_1_11 := @HoTT.TruncType.istrunc_trunctype.
1003+
Definition Book7_1_11 := @HoTT.Universes.TruncType.istrunc_trunctype.
10041004

10051005
(* ================================================== thm:h-set-uip-K *)
10061006
(** Theorem 7.2.1 *)
@@ -1010,7 +1010,7 @@ Definition Book7_1_11 := @HoTT.TruncType.istrunc_trunctype.
10101010
(* ================================================== thm:h-set-refrel-in-paths-sets *)
10111011
(** Theorem 7.2.2 *)
10121012

1013-
Definition Book_7_2_2 := @HoTT.HSet.ishset_hrel_subpaths.
1013+
Definition Book_7_2_2 := @HoTT.Universes.HSet.ishset_hrel_subpaths.
10141014

10151015
(* ================================================== notnotstable-equality-to-set *)
10161016
(** Corollary 7.2.3 *)

contrib/HoTTBookExercises.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ Defined.
803803
(* ================================================== ex:prop-inhabcontr *)
804804
(** Exercise 3.5 *)
805805

806-
Definition Book_3_5_solution_1 := @HoTT.HProp.equiv_hprop_inhabited_contr.
806+
Definition Book_3_5_solution_1 := @HoTT.Universes.HProp.equiv_hprop_inhabited_contr.
807807

808808
(* ================================================== ex:lem-mereprop *)
809809
(** Exercise 3.6 *)
@@ -1712,7 +1712,7 @@ End Book_6_9.
17121712
Section Book_7_1.
17131713
Lemma Book_7_1_part_i (H : forall A, merely A -> A) A : IsHSet A.
17141714
Proof.
1715-
apply (@HoTT.HSet.ishset_hrel_subpaths
1715+
apply (@HoTT.Universes.HSet.ishset_hrel_subpaths
17161716
A (fun x y => merely (x = y)));
17171717
try typeclasses eauto.
17181718
- intros ?.

contrib/SetoidRewrite.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
(* -*- mode: coq; mode: visual-line -*- *)
2-
31
(* Typeclass instances to allow rewriting in categories. Examples are given later in the file. *)
42

53
(* Init.Tactics contains the definition of the Coq stdlib typeclass_inferences database. It must be imported before Basics.Overture. *)
@@ -10,9 +8,11 @@ All files that import WildCat/SetoidRewrite.v will also recursively import the e
108

119
(** Because of this, this file needs to be the *first* file Require'd in any file that uses it. Otherwise, the typeclasses hintdb is cleared, breaking typeclass inference. Moreover, if Foo Requires this file, then Foo must also be the first file Require'd in any file that Requires Foo, and so on. In the long term it would be good if this could be avoided.*)
1210

11+
#[warnings="-deprecated-from-Coq"]
1312
From Coq Require Init.Tactics.
1413
From HoTT Require Import Basics.Overture Basics.Tactics.
1514
From HoTT Require Import Types.Forall.
15+
#[warnings="-deprecated-from-Coq"]
1616
From Coq Require Setoids.Setoid.
1717
Import CMorphisms.ProperNotations.
1818
From HoTT Require Import WildCat.Core

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
useDune = true;
3030
};
3131

32-
devShells.default = makeDevShell { coq = pkgs.coq_8_19; } { };
32+
devShells.default = makeDevShell { coq = pkgs.coq_8_20; } { };
33+
devShells.coq_8_19 = makeDevShell { coq = pkgs.coq_8_19; } { };
3334

3435
# To use, pass --impure to nix develop
3536
devShells.coq_master =

test/bugs/github754.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From HoTT Require Import Basics Types DProp Tactics.EquivalenceInduction.
1+
From HoTT Require Import Basics Types Universes.DProp Tactics.EquivalenceInduction.
22

33
Local Open Scope nat_scope.
44

theories/Algebra/AbGroups/AbelianGroup.v

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,28 @@ Proof.
2929
split; exact _.
3030
Defined.
3131

32+
(** Easier way to build abelian groups without redundant information. *)
33+
Definition Build_AbGroup' (G : Type)
34+
`{Zero G, Negate G, Plus G, IsHSet G}
35+
(comm : Commutative (A:=G) (+))
36+
(assoc : Associative (A:=G) (+))
37+
(unit_l : LeftIdentity (A:=G) (+) 0)
38+
(inv_l : LeftInverse (A:=G) (+) (-) 0)
39+
: AbGroup.
40+
Proof.
41+
snrapply Build_AbGroup.
42+
- (* TODO: introduce smart constructor for [Build_Group] *)
43+
rapply (Build_Group G).
44+
repeat split; only 1-3, 5: exact _.
45+
+ intros x.
46+
lhs nrapply comm.
47+
exact (unit_l x).
48+
+ intros x.
49+
lhs nrapply comm.
50+
exact (inv_l x).
51+
- exact comm.
52+
Defined.
53+
3254
Definition issig_abgroup : _ <~> AbGroup := ltac:(issig).
3355

3456
Global Instance zero_abgroup (A : AbGroup) : Zero A := group_unit.
@@ -91,11 +113,7 @@ Global Instance isabgroup_quotient (G : AbGroup) (H : Subgroup G)
91113
Proof.
92114
nrapply Build_IsAbGroup.
93115
1: exact _.
94-
intro x.
95-
srapply Quotient_ind_hprop.
96-
intro y; revert x.
97-
srapply Quotient_ind_hprop.
98-
intro x.
116+
srapply Quotient_ind2_hprop; intros x y.
99117
apply (ap (class_of _)).
100118
apply commutativity.
101119
Defined.

theories/Algebra/AbGroups/Abelianization.v

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ End Abel.
164164
(** The [IsHProp] argument of [Abel_ind_hprop] can usually be found by typeclass resolution, but [srapply] is slow, so we use this tactic instead. *)
165165
Local Ltac Abel_ind_hprop x := snrapply Abel_ind_hprop; [exact _ | intro x].
166166

167-
(** We make sure that G is implicit in the arguments of [abel_in
167+
(** We make sure that [G] is implicit in the arguments of [abel_in]
168168
and [abel_in_comm]. *)
169169
Arguments abel_in {_}.
170170
Arguments abel_in_comm {_}.
@@ -176,9 +176,9 @@ Section AbelGroup.
176176
Context (G : Group).
177177

178178
(** Firstly we derive the operation on Abel G. This is defined as follows:
179-
<<
179+
<<
180180
abel_in x + abel_in y := abel_in (x * y)
181-
>>
181+
>>
182182
But we need to also check that it preserves ab_comm in the appropriate way. *)
183183
Global Instance abel_sgop : SgOp (Abel G).
184184
Proof.
@@ -251,13 +251,13 @@ Section AbelGroup.
251251
Defined.
252252

253253
(** Now we can define the negation. This is just
254-
<<
254+
<<
255255
- (abel_in g) := abel_in (- g)
256-
>>
256+
>>
257257
However when checking that it respects ab_comm we have to show the following:
258-
<<
258+
<<
259259
abel_in (- z * - y * - x) = abel_in (- y * - z * - x)
260-
>>
260+
>>
261261
there is no obvious way to do this, but we note that [abel_in (x * y)] is exactly the definition of [abel_in x + abel_in y]! Hence by commutativity we can show this. *)
262262
Global Instance abel_negate : Negate (Abel G).
263263
Proof.

theories/Algebra/AbGroups/Biproduct.v

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ Definition ab_biprod_corec {A B X : AbGroup} (f : X $-> A) (g : X $-> B)
138138
: X $-> ab_biprod A B
139139
:= grp_prod_corec f g.
140140

141-
Definition ab_corec_eta {X Y A B : AbGroup} (f : X $-> Y) (g0 : Y $-> A) (g1 : Y $-> B)
142-
: ab_biprod_corec g0 g1 $o f $== ab_biprod_corec (g0 $o f) (g1 $o f)
143-
:= fun _ => idpath.
144-
145141
(** *** Functoriality of [ab_biprod] *)
146142

147143
Definition functor_ab_biprod {A A' B B' : AbGroup} (f : A $-> A') (g: B $-> B')

theories/Algebra/AbGroups/Z.v

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ Local Open Scope int_scope.
1212

1313
Definition abgroup_Z@{} : AbGroup@{Set}.
1414
Proof.
15-
snrapply Build_AbGroup.
16-
- refine (Build_Group Int int_add 0 int_neg _); repeat split.
17-
+ exact _.
18-
+ exact int_add_assoc.
19-
+ exact int_add_0_r.
20-
+ exact int_add_neg_l.
21-
+ exact int_add_neg_r.
15+
snrapply Build_AbGroup'.
16+
- exact Int.
17+
- exact 0.
18+
- exact int_neg.
19+
- exact int_add.
20+
- exact _.
2221
- exact int_add_comm.
22+
- exact int_add_assoc.
23+
- exact int_add_0_l.
24+
- exact int_add_neg_l.
2325
Defined.
2426

2527
(** For every group [G] and element [g : G], the map sending an integer to that power of [g] is a homomorphism. See [ab_mul] for the homomorphism [G -> G] when [G] is abelian. *)

theories/Algebra/AbSES/Core.v

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -625,11 +625,17 @@ Proposition projection_split_beta {B A : AbGroup} (E : AbSES B A)
625625
: projection_split_iso E h o (inclusion _) == ab_biprod_inl.
626626
Proof.
627627
intro a.
628-
refine (ap _ (ab_corec_eta _ _ _ _) @ _).
629-
refine (ab_biprod_functor_beta _ _ _ _ _ @ _).
628+
(* The next two lines might help the reader, but both are definitional equalities:
629+
lhs nrapply (ap _ (grp_prod_corec_natural _ _ _ _)).
630+
lhs nrapply ab_biprod_functor_beta.
631+
*)
630632
nrapply path_prod'.
631633
2: rapply cx_isexact.
632-
refine (ap _ (projection_split_to_kernel_beta E h a) @ _).
634+
(* The LHS of the remaining goal is definitionally equal to
635+
(grp_iso_inverse (grp_iso_cxfib (isexact_inclusion_projection E)) $o
636+
(projection_split_to_kernel E h $o inclusion E)) a
637+
allowing us to do: *)
638+
lhs nrapply (ap _ (projection_split_to_kernel_beta E h a)).
633639
apply eissect.
634640
Defined.
635641

@@ -731,8 +737,7 @@ Proof.
731737
- apply isequiv_surj_emb.
732738
1: rapply cancelR_conn_map.
733739
apply isembedding_isinj_hset.
734-
srapply Quotient_ind_hprop; intro x.
735-
srapply Quotient_ind_hprop; intro y.
740+
srapply Quotient_ind2_hprop; intros x y.
736741
intro p.
737742
apply qglue; cbn.
738743
refine (isexact_preimage (Tr (-1)) _ _ (-x + y) _).

theories/Algebra/Aut.v

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
(* -*- mode: coq; mode: visual-line -*- *)
21
Require Import Basics.
32
Require Import Truncations.
43
Require Import Algebra.ooGroup.
5-
Require Import Spaces.BAut.
4+
Require Import Universes.BAut.
65
Require Import Pointed.Core.
76

87
Local Open Scope pointed_scope.

theories/Algebra/Groups/Group.v

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -831,20 +831,24 @@ Proof.
831831
Defined.
832832

833833
(** Maps into the direct product can be built by mapping separately into each factor. *)
834-
Proposition grp_prod_corec {G H K : Group}
835-
(f : GroupHomomorphism K G)
836-
(g : GroupHomomorphism K H)
837-
: GroupHomomorphism K (grp_prod G H).
834+
Proposition grp_prod_corec {G H K : Group} (f : K $-> G) (g : K $-> H)
835+
: K $-> (grp_prod G H).
838836
Proof.
839837
snrapply Build_GroupHomomorphism.
840-
- exact (fun x:K => (f x, g x)).
838+
- exact (fun x : K => (f x, g x)).
841839
- intros x y.
842-
refine (path_prod' _ _ ); try apply grp_homo_op.
840+
apply path_prod'; apply grp_homo_op.
843841
Defined.
844842

843+
(** [grp_prod_corec] satisfies a definitional naturality property. *)
844+
Definition grp_prod_corec_natural {X Y A B : Group}
845+
(f : X $-> Y) (g0 : Y $-> A) (g1 : Y $-> B)
846+
: grp_prod_corec g0 g1 $o f $== grp_prod_corec (g0 $o f) (g1 $o f)
847+
:= fun _ => idpath.
848+
845849
(** The left factor injects into the direct product. *)
846850
Definition grp_prod_inl {H K : Group}
847-
: GroupHomomorphism H (grp_prod H K)
851+
: H $-> (grp_prod H K)
848852
:= grp_prod_corec grp_homo_id grp_homo_const.
849853

850854
(** The left injection is an embedding. *)
@@ -858,7 +862,7 @@ Defined.
858862

859863
(** The right factor injects into the direct product. *)
860864
Definition grp_prod_inr {H K : Group}
861-
: GroupHomomorphism K (grp_prod H K)
865+
: K $-> (grp_prod H K)
862866
:= grp_prod_corec grp_homo_const grp_homo_id.
863867

864868
(** The right injection is an embedding. *)

theories/Algebra/Groups/QuotientGroup.v

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,11 @@ Section GroupCongruenceQuotient.
2727

2828
Global Instance congquot_sgop : SgOp CongruenceQuotient.
2929
Proof.
30-
intros x.
31-
srapply Quotient_rec.
32-
{ intro y; revert x.
33-
srapply Quotient_rec.
34-
{ intros x.
35-
apply class_of.
36-
exact (x * y). }
37-
intros a b r.
38-
cbn.
39-
apply qglue.
40-
by apply iscong. }
41-
intros a b r.
42-
revert x.
43-
srapply Quotient_ind_hprop.
44-
intro x.
45-
apply qglue.
46-
by apply iscong.
30+
srapply Quotient_rec2.
31+
- intros x y.
32+
exact (class_of _ (x * y)).
33+
- intros x x' y p. apply qglue. by apply iscong.
34+
- intros x y y' q. apply qglue. by apply iscong.
4735
Defined.
4836

4937
Global Instance congquot_mon_unit : MonUnit CongruenceQuotient.
@@ -72,10 +60,7 @@ Section GroupCongruenceQuotient.
7260

7361
Global Instance congquot_sgop_associative : Associative congquot_sgop.
7462
Proof.
75-
intros x y.
76-
srapply Quotient_ind_hprop; intro a; revert y.
77-
srapply Quotient_ind_hprop; intro b; revert x.
78-
srapply Quotient_ind_hprop; intro c.
63+
srapply Quotient_ind3_hprop; intros x y z.
7964
simpl; by rewrite associativity.
8065
Qed.
8166

0 commit comments

Comments
 (0)