-
Notifications
You must be signed in to change notification settings - Fork 199
biproducts, additive and abelian categories #1929
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
Draft
Alizter
wants to merge
40
commits into
HoTT:master
Choose a base branch
from
Alizter:biproducts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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 970f3c3
Endomorphism ring in an additive category
Alizter 7188dce
reorganise additive categories
Alizter 5e50233
shorten proof of swap and inl/inr
Alizter fb05a77
more comments + cleanup
Alizter b96d129
abelian categories
Alizter 6228057
Abstract out some idioms for dealing with decidable types
jdchristensen 528e832
rename cat_coprod_prod_incl -> cat_coprod_prod
Alizter 265023f
remove funext from biproduct_op
Alizter b10c9e0
fix 8.18 issues
Alizter 1ea6501
rename canonical abelian map
Alizter 2b8177d
optimize Additive.v
Alizter 7bdd036
optimize biproducts
Alizter 442f50d
Merge branch 'master' into biproducts
Alizter ef2848a
simplify proof of opposite coproducts
Alizter dc29a67
AbGroup has biproducts
Alizter 74c28c6
AbGroup is additive
Alizter 74ea8ee
remove try and use goal selectors
Alizter d7a027b
Homological/Additive: fix a few typos
jdchristensen 62c2290
review suggestions
Alizter 365399b
spelling
Alizter bb6077b
inline definition
Alizter f37c55c
simplify left_identity in Additive.v
Alizter 63c8cf7
update comment and order of arguments
Alizter ad2fcd5
Merge branch 'master' into biproducts
Alizter 9dc9007
Merge branch 'master' into biproducts
Alizter acfe860
two proofs of pentagon and simplifications in biproducts
Alizter 628ac55
short proof of hexagon
Alizter e1188e7
Merge remote-tracking branch 'origin/master' into biproducts
Alizter f6a4978
remove duplicated hexagon proof
Alizter 3eb10fd
undo whitespace changes
Alizter b8f6663
Merge remote-tracking branch 'origin/master' into biproducts
Alizter edd3c8d
monoids and comonoids
Alizter 04a1a3a
Merge branch 'monoids' into biproducts
Alizter 74166bf
fixup
Alizter 71a84d9
Merge remote-tracking branch 'origin/master' into biproducts
Alizter 2682657
Merge remote-tracking branch 'origin/master' into biproducts
Alizter 93182b2
wip cocommutative comonoid structure gives monoid structure
Alizter 7068aa8
Merge remote-tracking branch 'origin/master' into biproducts
Alizter 6fc082e
fix compilation issue in MonoidObject.v
Alizter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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} | ||
| {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); | ||
| }. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.