Skip to content

Commit 6526cb5

Browse files
Merge pull request HoTT#2346 from jdchristensen/isabepistable_abgroup
The wild category AbGroup satisfies IsAbEpiStable
2 parents 5408bc2 + 7c7cfaa commit 6526cb5

File tree

13 files changed

+335
-173
lines changed

13 files changed

+335
-173
lines changed

test/WildCat/SetoidRewrite.v

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#[warnings="-deprecated-from-Coq"]
2-
From Coq Require Init.Tactics. (* TODO: Can remove this line and previous once Rocq 9.0 is our minimum. *)
31
From HoTT Require Import Basics.Overture Basics.Tactics.
42
From HoTT.WildCat Require Import Core NatTrans Equiv SetoidRewrite.
53

theories/Algebra/AbGroups.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Require Export HoTT.Algebra.AbGroups.AbPullback.
88
Require Export HoTT.Algebra.AbGroups.AbPushout.
99
Require Export HoTT.Algebra.AbGroups.Biproduct.
1010
Require Export HoTT.Algebra.AbGroups.AbHom.
11+
Require Export HoTT.Algebra.AbGroups.Coequalizer.
1112
Require Export HoTT.Algebra.AbGroups.Cyclic.
1213
Require Export HoTT.Algebra.AbGroups.Centralizer.
1314
Require Export HoTT.Algebra.AbGroups.FiniteSum.

theories/Algebra/AbGroups/AbHom.v

Lines changed: 30 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From HoTT Require Import Basics Types.
2-
From HoTT.WildCat Require Import Core Opposite Bifunctor Square Equiv.
2+
From HoTT.WildCat Require Import Core Opposite Bifunctor AbEnriched.
33
Require Import HSet Truncations.Core Modalities.ReflectiveSubuniverse.
4-
Require Import Groups.Group Groups.QuotientGroup AbelianGroup Biproduct.
4+
Require Import Groups.Group AbelianGroup Biproduct.
55

66
(** * Homomorphisms from a group to an abelian group form an abelian group. *)
77

@@ -38,126 +38,6 @@ Proof.
3838
apply commutativity.
3939
Defined.
4040

41-
(** ** Coequalizers *)
42-
43-
(** Using the cokernel and addition and negation for the homs of abelian groups, we can define the coequalizer of two group homomorphisms as the cokernel of their difference. *)
44-
Definition ab_coeq {A B : AbGroup} (f g : A $-> B)
45-
:= ab_cokernel ((-f) + g).
46-
47-
Definition ab_coeq_in {A B : AbGroup} {f g : A $-> B} : B $-> ab_coeq f g.
48-
Proof.
49-
exact grp_quotient_map.
50-
Defined.
51-
52-
Definition ab_coeq_glue {A B : AbGroup} {f g : A $-> B}
53-
: ab_coeq_in (f:=f) (g:=g) $o f $== ab_coeq_in $o g.
54-
Proof.
55-
intros x.
56-
napply qglue.
57-
apply tr.
58-
by exists x.
59-
Defined.
60-
61-
Definition ab_coeq_rec {A B : AbGroup} {f g : A $-> B}
62-
{C : AbGroup} (i : B $-> C) (p : i $o f $== i $o g)
63-
: ab_coeq f g $-> C.
64-
Proof.
65-
snapply (grp_quotient_rec _ _ i).
66-
cbn.
67-
intros b H.
68-
strip_truncations.
69-
destruct H as [a q].
70-
destruct q; simpl.
71-
lhs napply grp_homo_op.
72-
lhs napply (ap (+ _)).
73-
1: apply grp_homo_inv.
74-
apply grp_moveL_M1^-1.
75-
exact (p a)^.
76-
Defined.
77-
78-
Definition ab_coeq_rec_beta_in {A B : AbGroup} {f g : A $-> B}
79-
{C : AbGroup} (i : B $-> C) (p : i $o f $== i $o g)
80-
: ab_coeq_rec i p $o ab_coeq_in $== i
81-
:= fun _ => idpath.
82-
83-
Definition ab_coeq_ind_hprop {A B f g} (P : @ab_coeq A B f g -> Type)
84-
`{forall x, IsHProp (P x)}
85-
(i : forall b, P (ab_coeq_in b))
86-
: forall x, P x.
87-
Proof.
88-
rapply Quotient_ind_hprop.
89-
exact i.
90-
Defined.
91-
92-
Definition ab_coeq_ind_homotopy {A B C f g}
93-
{l r : @ab_coeq A B f g $-> C}
94-
(p : l $o ab_coeq_in $== r $o ab_coeq_in)
95-
: l $== r.
96-
Proof.
97-
srapply ab_coeq_ind_hprop.
98-
exact p.
99-
Defined.
100-
101-
Definition functor_ab_coeq {A B : AbGroup} {f g : A $-> B} {A' B' : AbGroup} {f' g' : A' $-> B'}
102-
(a : A $-> A') (b : B $-> B') (p : f' $o a $== b $o f) (q : g' $o a $== b $o g)
103-
: ab_coeq f g $-> ab_coeq f' g'.
104-
Proof.
105-
snapply ab_coeq_rec.
106-
1: exact (ab_coeq_in $o b).
107-
refine (cat_assoc _ _ _ $@ _ $@ cat_assoc_opp _ _ _).
108-
refine ((_ $@L p^$) $@ _ $@ (_ $@L q)).
109-
refine (cat_assoc_opp _ _ _ $@ (_ $@R a) $@ cat_assoc _ _ _).
110-
exact ab_coeq_glue.
111-
Defined.
112-
113-
Definition functor2_ab_coeq {A B : AbGroup} {f g : A $-> B} {A' B' : AbGroup} {f' g' : A' $-> B'}
114-
{a a' : A $-> A'} {b b' : B $-> B'}
115-
(p : f' $o a $== b $o f) (q : g' $o a $== b $o g)
116-
(p' : f' $o a' $== b' $o f) (q' : g' $o a' $== b' $o g)
117-
(s : b $== b')
118-
: functor_ab_coeq a b p q $== functor_ab_coeq a' b' p' q'.
119-
Proof.
120-
snapply ab_coeq_ind_homotopy.
121-
intros x.
122-
exact (ap ab_coeq_in (s x)).
123-
Defined.
124-
125-
Definition functor_ab_coeq_compose {A B : AbGroup} {f g : A $-> B}
126-
{A' B' : AbGroup} {f' g' : A' $-> B'}
127-
(a : A $-> A') (b : B $-> B') (p : f' $o a $== b $o f) (q : g' $o a $== b $o g)
128-
{A'' B'' : AbGroup} {f'' g'' : A'' $-> B''}
129-
(a' : A' $-> A'') (b' : B' $-> B'')
130-
(p' : f'' $o a' $== b' $o f') (q' : g'' $o a' $== b' $o g')
131-
: functor_ab_coeq a' b' p' q' $o functor_ab_coeq a b p q
132-
$== functor_ab_coeq (a' $o a) (b' $o b) (hconcat p p') (hconcat q q').
133-
Proof.
134-
snapply ab_coeq_ind_homotopy.
135-
simpl; reflexivity.
136-
Defined.
137-
138-
Definition functor_ab_coeq_id {A B : AbGroup} (f g : A $-> B)
139-
: functor_ab_coeq (Id _) (Id _) (hrefl f) (hrefl g) $== Id _.
140-
Proof.
141-
snapply ab_coeq_ind_homotopy.
142-
reflexivity.
143-
Defined.
144-
145-
Definition grp_iso_ab_coeq {A B : AbGroup} {f g : A $-> B}
146-
{A' B' : AbGroup} {f' g' : A' $-> B'}
147-
(a : A $<~> A') (b : B $<~> B') (p : f' $o a $== b $o f) (q : g' $o a $== b $o g)
148-
: ab_coeq f g $<~> ab_coeq f' g'.
149-
Proof.
150-
snapply cate_adjointify.
151-
- exact (functor_ab_coeq a b p q).
152-
- exact (functor_ab_coeq a^-1$ b^-1$ (hinverse a _ p) (hinverse a _ q)).
153-
- nrefine (functor_ab_coeq_compose _ _ _ _ _ _ _ _
154-
$@ functor2_ab_coeq _ _ _ _ _ $@ functor_ab_coeq_id _ _).
155-
exact (cate_isretr b).
156-
- nrefine (functor_ab_coeq_compose _ _ _ _ _ _ _ _
157-
$@ functor2_ab_coeq _ _ _ _ _ $@ functor_ab_coeq_id _ _).
158-
exact (cate_issect b).
159-
Defined.
160-
16141
(** ** The bifunctor [ab_hom] *)
16242

16343
Instance is0functor_ab_hom01 `{Funext} {A : Group^op}
@@ -220,6 +100,34 @@ Proof.
220100
by apply equiv_path_grouphomomorphism.
221101
Defined.
222102

103+
(** ** [AbGroup] has a wild enrichment in wild abelian groups *)
104+
105+
(** Using arguments very similar to the above, but without using [Funext], we can show that [AbGroup] is enriched in the wild sense. We could use this combined with [Funext] to deduce the results above, but we wouldn't get the extra generality where the domain group does not need to be abelian. And conversely we don't want to use the above results here, since we don't need to rely on [Funext]. *)
106+
107+
Instance abenriched_abgroup : IsAbEnriched AbGroup.
108+
Proof.
109+
snapply Build_IsAbEnriched.
110+
- intros A B.
111+
snapply (Build_IsAbGroup_0gpd _ _ _ _ sgop_hom grp_homo_const inverse_hom).
112+
3-8: hnf; intros; intro; cbn.
113+
+ srapply Build_Is0Bifunctor'.
114+
snapply Build_Is0Functor.
115+
intros [f f'] [g g'] [p p'] a; cbn in *.
116+
exact (ap011 _ (p a) (p' a)).
117+
+ snapply Build_Is0Functor.
118+
intros f g p a; cbn.
119+
apply (ap _ (p a)).
120+
+ symmetry; apply associativity.
121+
+ apply left_identity.
122+
+ apply right_identity.
123+
+ apply left_inverse.
124+
+ apply right_inverse.
125+
+ apply commutativity.
126+
- intros A B C g f f' a; cbn.
127+
apply grp_homo_op.
128+
- intros A B C f g g' a; cbn. reflexivity.
129+
Defined.
130+
223131
(** ** Properties of [ab_hom] *)
224132

225133
(** Precomposition with a surjection is an embedding. *)

theories/Algebra/AbGroups/AbPullback.v

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
From HoTT Require Import Basics.
1+
From HoTT Require Import Basics Types.Universe.
2+
Require Import Truncations.Core HIT.epi Modalities.ReflectiveSubuniverse.
23
Require Import Limits.Pullback Cubical.PathSquare.
34
Require Export Algebra.Groups.GrpPullback.
4-
Require Import Algebra.AbGroups.AbelianGroup.
5-
Require Import WildCat.Core.
5+
Require Import AbelianGroup AbHom.
6+
Require Import WildCat.Core WildCat.Pullbacks WildCat.EpiStable.
67

78
Local Open Scope mc_add_scope.
89

@@ -28,3 +29,29 @@ Section AbPullback.
2829
(** The corecursion principle is inherited from [Group]; use [grp_pullback_corec] and friends from Groups/GrpPullback.v. *)
2930

3031
End AbPullback.
32+
33+
Instance haspullbacks_abgroup : HasPullbacks AbGroup.
34+
Proof.
35+
rapply (haspullbacks_induced abgroup_group).
36+
intros A B C f g.
37+
exists (ab_pullback f g).
38+
reflexivity.
39+
Defined.
40+
41+
Instance isepistable_abgroup `{Univalence} : IsEpiStable AbGroup.
42+
Proof.
43+
srapply Build_IsEpiStable.
44+
1: exact _. (* By the above, [AbGroup] has pullbacks. *)
45+
(* We have to show that the categorical epimorphisms are stable under pullback. *)
46+
intros A B C f g ef.
47+
intros Z k1 k2.
48+
(* Since surjections are epimorphisms in [Type], it's enough to show that the pulled back map is a surjection. *)
49+
rapply issurj_isepi_funext.
50+
(* Since surjections are stable under pullback, it's enough to show that [f] is a surjection. *)
51+
apply issurj_pullback_pr2.
52+
(* This follows from the fact the epimorphisms of abelian groups are surjections. *)
53+
by apply ab_issurj_epi.
54+
Defined.
55+
56+
(** Combining [isepistable_abgroup] with [abenriched_abgroup] from AbHom.v gives: *)
57+
Instance isabepistable_abgroup `{Univalence} : IsAbEpiStable AbGroup := {}.

theories/Algebra/AbGroups/AbelianGroup.v

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
From HoTT Require Import Basics Types.
22
From HoTT.WildCat Require Import Core Universe Equiv Induced PointedCat.
3+
Require Import Truncations.Core Modalities.ReflectiveSubuniverse.
34
Require Import Spaces.Nat.Core Spaces.Int.
45
Require Export Classes.interfaces.canonical_names (Zero, zero, Plus, plus, Negate, negate, Involutive, involutive).
56
Require Export Classes.interfaces.abstract_algebra (IsAbGroup(..), abgroup_group, abgroup_commutative).
@@ -275,8 +276,12 @@ Definition ab_mul_natural {A B : AbGroup}
275276
: f o ab_mul n == ab_mul n o f
276277
:= grp_pow_natural f n.
277278

278-
(** The image of an inclusion is a normal subgroup. *)
279-
Definition ab_image_embedding {A B : AbGroup} (f : A $-> B) `{IsEmbedding f} : NormalSubgroup B
279+
(** The image of a homomorphism as a normal subgroup. *)
280+
Definition ab_image {A : Group} {B : AbGroup} (f : A $-> B) : NormalSubgroup B
281+
:= {| normalsubgroup_subgroup := grp_image f; normalsubgroup_isnormal := _ |}.
282+
283+
(** The image of an inclusion as a normal subgroup. *)
284+
Definition ab_image_embedding {A : Group} {B : AbGroup} (f : A $-> B) `{IsEmbedding f} : NormalSubgroup B
280285
:= {| normalsubgroup_subgroup := grp_image_embedding f; normalsubgroup_isnormal := _ |}.
281286

282287
Definition ab_image_in_embedding {A B : AbGroup} (f : A $-> B) `{IsEmbedding f}
@@ -299,3 +304,30 @@ Proof.
299304
induction q.
300305
exact (p g).
301306
Defined.
307+
308+
(** An epimorphism of abelian groups is surjective. This is likely true for general groups as well, but the proof is more complicated, probably needing an argument like the one given by Trimble, using a lemma by Lumsdaine, here: https://mathoverflow.net/questions/41208/are-all-group-monomorphisms-regular-constructively . However, the elementary proof for abelian groups also works when the domain is non-abelian, at the cost of having to explicitly state what we mean by epimorphism in this case. We state this version first. *)
309+
Definition grp_issurj_epi_ab `{Univalence} {A : Group} {B : AbGroup} (f : A $-> B)
310+
{ef : forall (C : AbGroup) (g h : Hom (A:=Group) B C), g $o f $== h $o f -> g $== h}
311+
: IsSurjection f.
312+
Proof.
313+
apply issurj_ismaximal_image.
314+
apply (ismaximalsubgroup_istrivial_grp_quotient_map _ (ab_image f)).
315+
(* The previous line uses univalence, the rest do not. *)
316+
change (grp_quotient_map (N:=ab_image f) $== grp_homo_const).
317+
rapply (ef (ab_cokernel f)).
318+
intro b.
319+
apply grp_quotient_map_trivial.
320+
apply (grp_homo_image_in f b).
321+
Defined.
322+
323+
(** The version when both [A] and [B] are abelian immediately follows, where here we assume that [f] is epic in the category of abelian groups. *)
324+
Definition ab_issurj_epi `{Univalence} {A B : AbGroup} (f : A $-> B) {ef : Epic f}
325+
: IsSurjection f
326+
:= @grp_issurj_epi_ab _ A B f ef.
327+
328+
(** We can also restate [grp_issurj_epi] using the a priori stronger assumption that [f] is epic in the category of groups. *)
329+
Definition grp_issurj_epi' `{Univalence} {A : Group} {B : AbGroup} (f : A $-> B) {ef : Epic f}
330+
: IsSurjection f
331+
:= @grp_issurj_epi_ab _ A B f (ef o abgroup_group).
332+
333+
(** Note that by [issurj_pullback_pr2], every surjection is an epimorphism in the wild category [Type], so it follows that a surjection of groups or abelian groups is an epimorphism in [Group] or [AbGroup]. *)

0 commit comments

Comments
 (0)