forked from HoTT/Coq-HoTT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExt.v
More file actions
178 lines (155 loc) · 5.69 KB
/
Copy pathExt.v
File metadata and controls
178 lines (155 loc) · 5.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
Require Import Basics Types Truncations.Core.
Require Import Pointed WildCat.
Require Import Truncations.SeparatedTrunc.
Require Import AbelianGroup AbHom AbProjective.
Require Import AbSES.Pullback AbSES.Pushout AbSES.BaerSum AbSES.Core.
Local Open Scope mc_scope.
Local Open Scope mc_add_scope.
(** * The set [Ext B A] of abelian group extensions *)
Definition Ext (B A : AbGroup@{u}) := pTr 0 (AbSES B A).
Global Instance is0bifunctor_ext `{Univalence}
: Is0Bifunctor (Ext : AbGroup^op -> AbGroup -> pType)
:= is0bifunctor_postcompose _ _ (bf:=is0bifunctor_abses).
Global Instance is1bifunctor_ext `{Univalence}
: Is1Bifunctor (Ext : AbGroup^op -> AbGroup -> pType)
:= is1bifunctor_postcompose _ _ (bf:=is1bifunctor_abses).
(** An extension [E : AbSES B A] is trivial in [Ext B A] if and only if [E] merely splits. *)
Proposition iff_ab_ext_trivial_split `{Univalence} {B A : AbGroup} (E : AbSES B A)
: merely {s : GroupHomomorphism B E & (projection _) $o s == idmap}
<~> (tr E = point (Ext B A)).
Proof.
refine (equiv_path_Tr _ _ oE _).
srapply equiv_iff_hprop;
apply Trunc_functor;
apply iff_abses_trivial_split.
Defined.
Definition Ext' (B A : AbGroup@{u}) := Tr 0 (AbSES' B A).
Global Instance is0bifunctor_ext' `{Univalence}
: Is0Bifunctor (Ext' : AbGroup^op -> AbGroup -> Type)
:= is0bifunctor_postcompose _ _ (bf:=is0bifunctor_abses').
Global Instance is1bifunctor_ext' `{Univalence}
: Is1Bifunctor (Ext' : AbGroup^op -> AbGroup -> Type)
:= is1bifunctor_postcompose _ _ (bf:=is1bifunctor_abses').
(** [Ext B A] is an abelian group for any [A B : AbGroup]. The proof of commutativity is a bit faster if we separate out the proof that [Ext B A] is a group. *)
Definition grp_ext `{Univalence} (B A : AbGroup@{u}) : Group.
Proof.
snrapply (Build_Group (Ext B A)).
- intros E F.
strip_truncations.
exact (tr (abses_baer_sum E F)).
- exact (point (Ext B A)).
- unfold Negate.
exact (Trunc_functor _ (abses_pullback (- grp_homo_id))).
- repeat split.
1: apply istrunc_truncation.
all: intro E. 1: intros F G.
all: strip_truncations; unfold mon_unit, point; apply (ap tr).
+ symmetry; apply baer_sum_associative.
+ apply baer_sum_unit_l.
+ apply baer_sum_unit_r.
+ apply baer_sum_inverse_r.
+ apply baer_sum_inverse_l.
Defined.
(** ** The bifunctor [ab_ext] *)
Definition ab_ext@{u v|u < v} `{Univalence} (B : AbGroup@{u}^op) (A : AbGroup@{u}) : AbGroup@{v}.
Proof.
snrapply (Build_AbGroup (grp_ext@{u v} B A)).
intros E F.
strip_truncations; cbn.
apply ap.
apply baer_sum_commutative.
Defined.
Global Instance is0functor_abext01 `{Univalence} (B : AbGroup^op)
: Is0Functor (ab_ext B).
Proof.
srapply Build_Is0Functor; intros ? ? f.
snrapply Build_GroupHomomorphism.
1: exact (fmap (Ext B) f).
rapply Trunc_ind; intro E0.
rapply Trunc_ind; intro E1.
apply (ap tr); cbn.
apply baer_sum_pushout.
Defined.
Global Instance is0functor_abext10 `{Univalence} (A : AbGroup)
: Is0Functor (fun B : AbGroup^op => ab_ext B A).
Proof.
srapply Build_Is0Functor; intros ? ? f; cbn.
snrapply Build_GroupHomomorphism.
1: exact (fmap (fun (B : AbGroup^op) => Ext B A) f).
rapply Trunc_ind; intro E0.
rapply Trunc_ind; intro E1.
apply (ap tr); cbn.
apply baer_sum_pullback.
Defined.
Global Instance is1functor_abext01 `{Univalence} (B : AbGroup^op)
: Is1Functor (ab_ext B).
Proof.
snrapply Build_Is1Functor.
- intros A C f g.
exact (fmap2 (Ext B)).
- exact (fmap_id (Ext B)).
- intros A C D.
exact (fmap_comp (Ext B)).
Defined.
Global Instance is1functor_abext10 `{Univalence} (A : AbGroup)
: Is1Functor (fun B : AbGroup^op => ab_ext B A).
Proof.
snrapply Build_Is1Functor.
- intros B C f g.
exact (fmap2 (fun B : AbGroup^op => Ext B A)).
- exact (fmap_id (fun B : AbGroup^op => Ext B A)).
- intros B C D.
exact (fmap_comp (fun B : AbGroup^op => Ext B A)).
Defined.
Global Instance is0bifunctor_abext `{Univalence}
: Is0Bifunctor (A:=AbGroup^op) ab_ext.
Proof.
rapply Build_Is0Bifunctor''.
Defined.
Global Instance is1bifunctor_abext `{Univalence}
: Is1Bifunctor (A:=AbGroup^op) ab_ext.
Proof.
snrapply Build_Is1Bifunctor''.
1,2: exact _.
intros A B.
exact (bifunctor_coh (Ext : AbGroup^op -> AbGroup -> pType)).
Defined.
(** We can push out a fixed extension while letting the map vary, and this defines a group homomorphism. *)
Definition abses_pushout_ext `{Univalence}
{B A G : AbGroup@{u}} (E : AbSES B A)
: GroupHomomorphism (ab_hom A G) (ab_ext B G).
Proof.
snrapply Build_GroupHomomorphism.
1: exact (fun f => fmap01 (A:=AbGroup^op) Ext' _ f (tr E)).
intros f g; cbn.
nrapply (ap tr).
exact (baer_sum_distributive_pushouts f g).
Defined.
(** ** Extensions ending in a projective are trivial *)
Proposition abext_trivial_projective `{Univalence}
(P : AbGroup) `{IsAbProjective P}
: forall A, forall E : AbSES P A, tr E = point (Ext P A).
Proof.
intros A E.
apply iff_ab_ext_trivial_split.
exact (fst (iff_isabprojective_surjections_split P) _ _ _ _).
Defined.
(** It follows that when [P] is projective, [Ext P A] is contractible. *)
Global Instance contr_abext_projective `{Univalence}
(P : AbGroup) `{IsAbProjective P} {A : AbGroup}
: Contr (Ext P A).
Proof.
apply (Build_Contr _ (point _)); intro E.
strip_truncations.
symmetry; by apply abext_trivial_projective.
Defined.
(* Converely, if all extensions ending in [P] are trivial, then [P] is projective. *)
Proposition abext_projective_trivial `{Univalence} (P : AbGroup)
(ext_triv : forall A, forall E : AbSES P A, tr E = point (Ext P A))
: IsAbProjective P.
Proof.
apply iff_isabprojective_surjections_split.
intros E p issurj_p.
apply (iff_ab_ext_trivial_split (abses_from_surjection p))^-1.
apply ext_triv.
Defined.