Skip to content

Commit 3e75e28

Browse files
Merge pull request #2344 from ThomatoTomato/homologicalalgebra-pr
Homological Algebra: Diagram chasing in practice
2 parents 4e1662f + 1010924 commit 3e75e28

File tree

3 files changed

+872
-6
lines changed

3 files changed

+872
-6
lines changed

theories/WildCat.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Require Export WildCat.DisplayedEquiv.
2020
Require Export WildCat.Pullbacks.
2121
Require Export WildCat.AbEnriched.
2222
Require Export WildCat.EpiStable.
23+
Require Export WildCat.HomologicalAlgebra.
2324

2425
Require Export WildCat.SetoidRewrite.
2526

theories/WildCat/EpiStable.v

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
Require Import WildCat.SetoidRewrite.
2-
Require Import Basics.Overture Basics.Tactics Basics.Equivalences.
3-
Require Import WildCat.Core WildCat.Equiv WildCat.EquivGpd WildCat.PointedCat
4-
WildCat.Yoneda WildCat.Graph WildCat.ZeroGroupoid WildCat.Pullbacks
5-
WildCat.AbEnriched WildCat.FunctorCat.
1+
From HoTT.Basics Require Import Overture Tactics Equivalences.
2+
From HoTT.WildCat Require Import Core SetoidRewrite Equiv EquivGpd PointedCat
3+
Yoneda Graph ZeroGroupoid Pullbacks
4+
AbEnriched FunctorCat.
65

76
(** * Epi-stable categories *)
87

@@ -186,7 +185,7 @@ End AbEpiStable.
186185

187186
(** ** Tactics *)
188187

189-
(** The [fix_left] tactic is the key to smooth diagram chasing in an [IsAbEpiStable] category. Given [lift : Lift ? ?]; we extract the lifted element using the provided name [d] and the proof it is a lift using the name [l]. Then we update all other generalized elements to have the same domain as [d]. We could also have a limited version of this tactic for an [IsEpiStable] category. *)
188+
(** The [fix_left] tactic is the key to smooth diagram chasing in an [IsAbEpiStable] category. Given [lift : Lift ? ?]; we extract the lifted element using the provided name [d] and the proof it is a lift using the name [l]. Then we update all other generalized elements to have the same domain as [d]. We could also have a limited version of this tactic for an [IsEpiStable] category. For examples of this tactic in use, see the EpiStableLemmas section below and the file HomologicalAlgebra.v. *)
190189
Ltac fix_lift lift d l :=
191190
let P2 := fresh "P" in
192191
let e := fresh "e" in
@@ -273,3 +272,53 @@ Ltac rewrite_with_assoc h :=
273272
(** Similar, with the other parenthesization. *)
274273
Ltac rewrite_with_assoc_opp h :=
275274
rewrite (cat_assoc _ _ _ $@ cat_postwhisker _ h $@ cat_assoc_opp _ _ _).
275+
276+
(** We can prove some lemmas about these categories using diagram chasing. *)
277+
278+
Section EpiStableLemmas.
279+
280+
Context {A : Type} `{IsEpiStable A}.
281+
282+
(** Morphisms that are both mono and epi are not necessarily iso. The two-out-of-three property is not true for monos and epis in general, but it holds for maps that are both monos and epi in EpiStable categories. *)
283+
284+
Context {X Y Z : A} (f : X $-> Y) (g : Y $-> Z).
285+
286+
(** We already know the following implications:
287+
- [f] mono/epi + [g] mono/epi => [g $o f] mono/epi
288+
- [g $o f] mono => [f] mono
289+
- [g $o f] epi => [g] epi
290+
291+
It remains to show:
292+
- [g $o f] mono + [f] epi => [g] mono
293+
- [g $o f] epi + [g] mono => [f] epi *)
294+
295+
Definition monic_cancel_epic `{!Monic (g $o f)} `{!Epic f} : Monic g.
296+
Proof.
297+
apply monic_via_elt; intros P y y' p.
298+
299+
elt_lift_epic f y x lx; elt_lift_epic f y' x' lx'.
300+
301+
lhs_V' napply lx.
302+
rhs_V' napply lx'.
303+
napply cat_postwhisker.
304+
apply (ismonic (g $o f)).
305+
lhs' napply cat_assoc.
306+
rhs' napply cat_assoc.
307+
lhs' napply (g $@L lx).
308+
rhs' napply (g $@L lx').
309+
exact p.
310+
Defined.
311+
312+
Definition epic_cancel_monic `{!Epic (g $o f)} `{!Monic g} : Epic f.
313+
Proof.
314+
apply epic_elt_lift; intros P y.
315+
316+
elt_lift_epic (g $o f) (g $o y) x lx.
317+
318+
provide_lift x.
319+
rapply ismonic.
320+
lhs' napply cat_assoc_opp.
321+
exact lx.
322+
Defined.
323+
324+
End EpiStableLemmas.

0 commit comments

Comments
 (0)