diff options
Diffstat (limited to 'Category')
| -rw-r--r-- | Category/BinaryBiproducts.agda | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/Category/BinaryBiproducts.agda b/Category/BinaryBiproducts.agda new file mode 100644 index 0000000..c96d3bf --- /dev/null +++ b/Category/BinaryBiproducts.agda @@ -0,0 +1,166 @@ +{-# OPTIONS --without-K --safe #-} + +open import Categories.Category using (Category) +open import Level using (Level; levelOfTerm) +open import Level using (_β_) + +module Category.BinaryBiproducts {o β e : Level} (π : Category o β e) where + +import Categories.Morphism.Reasoning as β-Reasoning + +open import Categories.Category.BinaryCoproducts π using (BinaryCoproducts) +open import Categories.Category.BinaryProducts π using (BinaryProducts) +open import Morphism.Zero using (IsZeroβ) +open import Object.Biproduct π using (Biproduct; BiproductβProduct; BiproductβCoproduct) + +record BinaryBiproducts : Set (levelOfTerm π) where + + infixr 7 _β_ + + field + biproduct : β {A B} β Biproduct A B + + open Category π + + private + module biproduct {A} {B} = Biproduct (biproduct {A} {B}) + + open biproduct using (Οββiββid; Οββiββid; permute; πβ; πβ; Οββiβ-isZero; Οββiβ-isZero; β¨β©-unique; []-unique) public + + _β_ : Obj β Obj β Obj + A β B = Biproduct.AβB (biproduct {A} {B}) + + module _ where + binaryProducts : BinaryProducts + binaryProducts = record { product = BiproductβProduct biproduct } + open BinaryProducts binaryProducts public + hiding (_Γ_) + renaming (_Γβ_ to infixr 10 _Γβ_; Γ-comm to β-comm; Γ-assoc to β-assoc) + + module _ where + binaryCoproducts : BinaryCoproducts + binaryCoproducts = record { coproduct = BiproductβCoproduct biproduct } + open BinaryCoproducts binaryCoproducts public + hiding (_+_) + renaming (_+β_ to infixr 10 _+β_; +-comm to β-commβ²; +-assoc to β-assocβ²) + + private + module Οβiβ {A} {B} = IsZeroβ (Οββiβ-isZero {A} {B}) + module Οβiβ {A} {B} = IsZeroβ (Οββiβ-isZero {A} {B}) + + open β-Reasoning π + open HomReasoning + + ΟβiββΟβiβ : {A B : Obj} β Οβ β iβ β ΟβΒ {A} {B} β iβ + ΟβiββΟβiβ {A} {B} = begin + Οβ β iβ ββ¨ identityΚ³ β¨ + (Οβ β iβ) β id ββ¨ Οβiβ.constant id ((Οβ β iβ) β (Οβ β iβ)) β© + (Οβ β iβ) β ((Οβ β iβ) β (Οβ β iβ)) ββ¨ sym-assoc β© + ((Οβ β iβ) β (Οβ β iβ)) β (Οβ β iβ) ββ¨ Οβiβ.coconstant ((Οβ β iβ) β (Οβ β iβ)) id β© + id β Οβ β iβ ββ¨ pullΛ‘ identityΛ‘ β© + Οβ β iβ β + + module _ {A B C : Obj} where + + Οβiβ-absorbΛ‘ : (f : A β C) β f β πβ {A} {B} β πβ + Οβiβ-absorbΛ‘ f = begin + f β πβ ββ¨ Οβiβ.coconstant f (πβ β πβ) β© + (πβ β πβ) β πβ ββ¨ assoc β© + πβ β (πβ β πβ) ββ¨ Οβiβ.constant (πβ β πβ) id β© + πβ β id ββ¨ identityΚ³ β© + πβ β + + Οβiβ-absorbΚ³ : (f : C β B) β πβ {A} {B} β f β πβ + Οβiβ-absorbΚ³ f = begin + πβ β f ββ¨ Οβiβ.constant f (πβ β πβ) β© + πβ β πβ β πβ ββ¨ sym-assoc β© + (πβ β πβ) β πβ ββ¨ Οβiβ.coconstant (πβ β πβ) id β© + id β πβ ββ¨ identityΛ‘ β© + πβ β + + Οβiβ-absorbΛ‘ : (f : B β C) β f β πβ {A} {B} β πβ + Οβiβ-absorbΛ‘ f = begin + f β πβ ββ¨ Οβiβ.coconstant f (πβ β πβ) β© + (πβ β πβ) β πβ ββ¨ assoc β© + πβ β (πβ β πβ) ββ¨ Οβiβ.constant (πβ β πβ) id β© + πβ β id ββ¨ identityΚ³ β© + πβ β + + Οβiβ-absorbΚ³ : (f : C β A) β πβ {A} {B} β f β πβ + Οβiβ-absorbΚ³ f = begin + πβ β f ββ¨ Οβiβ.constant f (πβ β πβ) β© + πβ β πβ β πβ ββ¨ sym-assoc β© + (πβ β πβ) β πβ ββ¨ Οβiβ.coconstant (πβ β πβ) id β© + id β πβ ββ¨ identityΛ‘ β© + πβ β + + module _ {A B : Obj} (f g : A β B) where + + Οββ+β : Οβ β f +β g β f β Οβ + Οββ+β = begin + Οβ β [ iβ β f , iβ β g ] ββ¨ β[] β© + [ Οβ β iβ β f , Οβ β iβ β g ] ββ¨ []-congΛ‘ sym-assoc β© + [ Οβ β iβ β f , (Οβ β iβ) β g ] ββ¨ []-congβ (cancelΛ‘ Οββiββid) (Οβiβ-absorbΚ³ g) β© + [ f , Οβ β iβ ] ββ¨ []-congβ (insertΚ³ Οββiββid) (Equiv.sym (Οβiβ-absorbΛ‘ f)) β© + [ (f β Οβ) β iβ , f β Οβ β iβ ] ββ¨ []-congΛ‘ sym-assoc β© + [ (f β Οβ) β iβ , (f β Οβ) β iβ ] ββ¨ +-g-Ξ· β© + f β Οβ β + + Οββ+β : Οβ β f +β g β g β Οβ + Οββ+β = begin + Οβ β [ iβ β f , iβ β g ] ββ¨ β[] β© + [ Οβ β iβ β f , Οβ β iβ β g ] ββ¨ []-congΚ³ sym-assoc β© + [ (Οβ β iβ) β f , Οβ β iβ β g ] ββ¨ []-congβ (Οβiβ-absorbΚ³ f) (cancelΛ‘ Οββiββid) β© + [ Οβ β iβ , g ] ββ¨ []-congβ (Equiv.sym (Οβiβ-absorbΛ‘ g)) (insertΚ³ Οββiββid) β© + [ g β Οβ β iβ , (g β Οβ) β iβ ] ββ¨ []-congΚ³ sym-assoc β© + [ (g β Οβ) β iβ , (g β Οβ) β iβ ] ββ¨ +-g-Ξ· β© + g β Οβ β + + Γβ-+β : f Γβ g β f +β g + Γβ-+β = β¨β©-unique Οββ+β Οββ+β + + β-assoc : {A : Obj} β β {A} β β +β id β β β id +β β β +-assocΛ‘ + β-assoc = begin + β β β +β id ββ¨ ββ+β β© + [ β , id ] ββ¨ []β+-assocΚ³ β¨ + [ id , β ] β +-assocΛ‘ ββ¨ pushΛ‘ (Equiv.sym ββ+β) β© + β β id +β β β +-assocΛ‘ β + + Ξ-assoc : {A : Obj} β id Γβ Ξ β Ξ {A} β assocΛ‘ β Ξ Γβ id β Ξ + Ξ-assoc = begin + id Γβ Ξ β Ξ ββ¨ ΓββΞ β© + β¨ id , Ξ β© ββ¨ assocΛ‘ββ¨β© β¨ + assocΛ‘ β β¨ Ξ , id β© ββ¨ reflβ©ββ¨ ΓββΞ β¨ + assocΛ‘ β Ξ Γβ id β Ξ β + + module _ {A : Obj} where + + β-identityΛ‘ : β β iβ β id {A} + β-identityΛ‘ = injectβ + + β-identityΚ³ : β β iβ β id {A} + β-identityΚ³ = injectβ + + Ξ-identityΛ‘ : Οβ β Ξ β id {A} + Ξ-identityΛ‘ = projectβ + + Ξ-identityΚ³ : Οβ β Ξ β id {A} + Ξ-identityΚ³ = projectβ + + β-comm : {A : Obj} β β {A} β +-swap β β + β-comm = []β+-swap + + Ξ-comm : {A : Obj} β swap β Ξ {A} β Ξ + Ξ-comm = swapββ¨β© + + ββ : {A B : Obj} {f : A β B} β f β β β β β f +β f + ββ {f = f} = begin + f β β ββ¨ ββ β© + [ f , f ] ββ¨ ββ+β β¨ + β β f +β f β + + βΞ : {A B : Obj} {f : A β B} β Ξ β f β f Γβ f β Ξ + βΞ {A} {B} {f} = begin + Ξ β f ββ¨ ΞβΒ β© + β¨ f , f β© ββ¨ ΓββΞ β¨ + f Γβ f β Ξ β |
