Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

biproducts, additive and abelian categories #1929

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0c6a1a3
biproducts, semiadditive and additive categories
Alizter Apr 25, 2024
970f3c3
Endomorphism ring in an additive category
Alizter Apr 25, 2024
7188dce
reorganise additive categories
Alizter Apr 25, 2024
5e50233
shorten proof of swap and inl/inr
Alizter Apr 25, 2024
fb05a77
more comments + cleanup
Alizter Apr 25, 2024
b96d129
abelian categories
Alizter Apr 27, 2024
6228057
Abstract out some idioms for dealing with decidable types
jdchristensen Apr 27, 2024
528e832
rename cat_coprod_prod_incl -> cat_coprod_prod
Alizter Apr 28, 2024
265023f
remove funext from biproduct_op
Alizter Apr 28, 2024
b10c9e0
fix 8.18 issues
Alizter Apr 28, 2024
1ea6501
rename canonical abelian map
Alizter Apr 28, 2024
2b8177d
optimize Additive.v
Alizter Apr 29, 2024
7bdd036
optimize biproducts
Alizter Apr 29, 2024
442f50d
Merge branch 'master' into biproducts
Alizter Apr 29, 2024
ef2848a
simplify proof of opposite coproducts
Alizter Apr 29, 2024
dc29a67
AbGroup has biproducts
Alizter Apr 29, 2024
74c28c6
AbGroup is additive
Alizter Apr 29, 2024
74ea8ee
remove try and use goal selectors
Alizter Apr 29, 2024
d7a027b
Homological/Additive: fix a few typos
jdchristensen Apr 29, 2024
62c2290
review suggestions
Alizter Apr 29, 2024
365399b
spelling
Alizter Apr 29, 2024
bb6077b
inline definition
Alizter Apr 29, 2024
f37c55c
simplify left_identity in Additive.v
Alizter Apr 29, 2024
63c8cf7
update comment and order of arguments
Alizter Apr 29, 2024
ad2fcd5
Merge branch 'master' into biproducts
Alizter Apr 30, 2024
9dc9007
Merge branch 'master' into biproducts
Alizter Apr 30, 2024
acfe860
two proofs of pentagon and simplifications in biproducts
Alizter May 1, 2024
628ac55
short proof of hexagon
Alizter May 1, 2024
e1188e7
Merge remote-tracking branch 'origin/master' into biproducts
Alizter May 2, 2024
f6a4978
remove duplicated hexagon proof
Alizter May 2, 2024
3eb10fd
undo whitespace changes
Alizter May 2, 2024
b8f6663
Merge remote-tracking branch 'origin/master' into biproducts
Alizter May 4, 2024
edd3c8d
monoids and comonoids
Alizter May 6, 2024
04a1a3a
Merge branch 'monoids' into biproducts
Alizter May 8, 2024
74166bf
fixup
Alizter May 8, 2024
71a84d9
Merge remote-tracking branch 'origin/master' into biproducts
Alizter May 15, 2024
2682657
Merge remote-tracking branch 'origin/master' into biproducts
Alizter May 25, 2024
93182b2
wip cocommutative comonoid structure gives monoid structure
Alizter May 26, 2024
7068aa8
Merge remote-tracking branch 'origin/master' into biproducts
Alizter Jul 2, 2024
6fc082e
fix compilation issue in MonoidObject.v
Alizter Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions theories/Algebra/Homological/Abelian.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
Require Import Basics.Overture Basics.Tactics Basics.Equivalences.
Require Import WildCat.Core WildCat.Equiv WildCat.PointedCat WildCat.Opposite.
Require Import Algebra.AbGroups.AbelianGroup Algebra.Rings.Ring.
Require Import Algebra.Homological.Additive.
Require Import canonical_names.

(** * Abelian Categories *)

Local Open Scope mc_scope.
Local Open Scope mc_add_scope.

(** ** Kernels and cokernels *)

(** *** Kernels *)

Class Kernel {A : Type} `{IsPointedCat A} {a b : A} (f : a $-> b) := {
cat_ker_obj : A;
cat_ker : cat_ker_obj $-> a;

cat_ker_zero : f $o cat_ker $== zero_morphism;

cat_ker_corec {x} (g : x $-> a) : f $o g $== zero_morphism -> x $-> cat_ker_obj;

cat_ker_corec_beta {x} (g : x $-> a) (p : f $o g $== zero_morphism)
: cat_ker $o cat_ker_corec g p $== g;

monic_cat_ker : Monic cat_ker;
}.

Arguments cat_ker_obj {A _ _ _ _ _ a b} f {_}.
Arguments cat_ker_corec {A _ _ _ _ _ a b f _ x} g p.
Arguments cat_ker {A _ _ _ _ _ a b} f {_}.
Arguments cat_ker_zero {A _ _ _ _ _ a b} f {_}.
Arguments monic_cat_ker {A _ _ _ _ _ a b} f {_}.

(** Kernels of monomorphisms are zero. *)
Definition ker_zero_monic {A : Type} `{IsPointedCat A}
{a b : A} (f : a $-> b) `{!Kernel f}
: Monic f -> cat_ker f $== zero_morphism.
Proof.
intros monic.
apply monic.
refine (cat_ker_zero f $@ _^$).
apply cat_zero_r.
Defined.

(** Maps with zero kernel are monic. *)
Definition monic_ker_zero {A : Type} `{IsAdditive A}
{a b : A} (f : a $-> b) `{!Kernel f}
: cat_ker f $== zero_morphism -> Monic f.
Proof.
intros ker_zero c g h p.
apply GpdHom_path.
apply path_hom in p.
change (@paths (AbHom c a) g h).
change (@paths (AbHom c b) (f $o g) (f $o h)) in p.
apply grp_moveL_1M.
apply grp_moveL_1M in p.
apply GpdHom_path in p.
apply path_hom.
refine ((cat_ker_corec_beta (g + (-h)) _)^$ $@ (ker_zero $@R _) $@ cat_zero_l _).
refine (addcat_dist_l _ _ _ $@ _ $@ p).
apply GpdHom_path.
f_ap.
apply path_hom.
symmetry.
apply addcat_comp_negate_r.
Defined.

(** *** Cokernels *)

Class Cokernel {A : Type} `{IsPointedCat A} {a b : A} (f : a $-> b)
:= cokernel_kernel_op :: Kernel (A := A^op) (f : Hom (A:= A^op) b a).

Arguments Cokernel {A _ _ _ _ _ a b} f.

Definition cat_coker_obj {A : Type} `{IsPointedCat A} {a b : A} (f : a $-> b)
`{!Cokernel f} : A
:= cat_ker_obj (A:=A^op) (a:=b) f.

Definition cat_coker {A : Type} `{IsPointedCat A} {a b : A} (f : a $-> b)
`{!Cokernel f} : b $-> cat_coker_obj f
:= cat_ker (A:=A^op) (a:=b) (b:=a) f.

Definition cat_coker_zero {A : Type} `{IsPointedCat A} {a b : A} (f : a $-> b)
`{!Cokernel f} : cat_coker f $o f $== zero_morphism
:= cat_ker_zero (A:=A^op) (a:=b) f.

Definition cat_coker_rec {A : Type} `{IsPointedCat A} {a b : A} {f : a $-> b}
`{!Cokernel f} {x} (g : b $-> x)
: g $o f $== zero_morphism -> cat_coker_obj f $-> x
:= cat_ker_corec (A:=A^op) (a:=b) (b:=a) g.

Definition cat_coker_rec_beta {A : Type} `{IsPointedCat A} {a b : A} (f : a $-> b)
`{!Cokernel f} {x} (g : b $-> x) (p : g $o f $== zero_morphism)
: cat_coker_rec g p $o cat_coker f $== g
:= cat_ker_corec_beta (A:=A^op) (a:=b) (b:=a) g p.

Definition epic_cat_coker {A : Type} `{IsPointedCat A}
{a b : A} (f : a $-> b) `{!Cokernel f}
: Epic (cat_coker f)
:= monic_cat_ker (A:=A^op) (a:=b) (b:=a) f.

Definition coker_zero_epic {A : Type} `{IsPointedCat A}
{a b : A} (f : a $-> b) `{!Cokernel f}
: Epic f -> cat_coker f $== zero_morphism
:= ker_zero_monic (A:=A^op) (a:=b) f.

(** Funext required all the way in Biproducts to show opposite of additive is additivef. *)
Definition epic_coker_zero `{Funext} {A : Type} `{IsAdditive A}
{a b : A} (f : a $-> b) {k : Cokernel f}
: cat_coker f $== zero_morphism -> Epic f
:= monic_ker_zero (A:=A^op) (a:=b) (b:=a) f.

(** ** Preabelian categories *)

Class IsPreAbelian {A : Type} `{IsAdditive A} := {
preabelian_has_kernels :: forall {a b : A} (f : a $-> b), Kernel f;
preabelian_has_cokernels :: forall {a b : A} (f : a $-> b), Cokernel f;
}.

Definition ispreabelian_canonical_map {A : Type} `{IsPreAbelian A}
Alizter marked this conversation as resolved.
Show resolved Hide resolved
{a b : A} (f : a $-> b)
: cat_coker_obj (cat_ker f) $-> cat_ker_obj (cat_coker f).
Proof.
snrapply cat_coker_rec.
- snrapply cat_ker_corec.
+ exact f.
+ apply cat_coker_zero.
- snrapply monic_cat_ker.
refine ((cat_assoc _ _ _)^$ $@ _).
refine ((_ $@R _) $@ _).
1: apply cat_ker_corec_beta.
refine (_ $@ (cat_zero_r _)^$).
apply cat_ker_zero.
Defined.

(** ** Abelian categories *)

Class IsAbelian {A : Type} `{IsPreAbelian A} := {
catie_preabelian_canonical_map : forall a b (f : a $-> b),
CatIsEquiv (ispreabelian_canonical_map f);
}.

Loading
Loading