Biproducts and binary biproducts
We introduce the notion of (finite) biproducts and binary biproducts.
These are slightly unusual relative to the other shapes in the library, as they are simultaneously limits and colimits. (Zero objects are similar; they are "biterminal".)
We treat first the case of a general category with zero morphisms, and subsequently the case of a preadditive category.
In a category with zero morphisms, we model the (binary) biproduct of P Q : C
using a binary_bicone
, which has a cone point X
,
and morphisms fst : X ⟶ P
, snd : X ⟶ Q
, inl : P ⟶ X
and inr : X ⟶ Q
,
such that inl ≫ fst = 𝟙 P
, inl ≫ snd = 0
, inr ≫ fst = 0
, and inr ≫ snd = 𝟙 Q
.
Such a binary_bicone
is a biproduct if the cone is a limit cone, and the cocone is a colimit cocone.
In a preadditive category,
- any
binary_biproduct
satisfiestotal : fst ≫ inl + snd ≫ inr = 𝟙 X
- any
binary_product
is abinary_biproduct
- any
binary_coproduct
is abinary_biproduct
For biproducts indexed by a fintype J
, a bicone
again consists of a cone point X
and morphisms π j : X ⟶ F j
and ι j : F j ⟶ X
for each j
,
such that ι j ≫ π j'
is the identity when j = j'
and zero otherwise.
In a preadditive category,
- any
biproduct
satisfiestotal : ∑ j : J, biproduct.π f j ≫ biproduct.ι f j = 𝟙 (⨁ f)
- any
product
is abiproduct
- any
coproduct
is abiproduct
Notation
As ⊕
is already taken for the sum of types, we introduce the notation X ⊞ Y
for
a binary biproduct. We introduce ⨁ f
for the indexed biproduct.
- X : C
- π : Π (j : J), c.X ⟶ F j
- ι : Π (j : J), F j ⟶ c.X
- ι_π : ∀ (j j' : J), c.ι j ≫ c.π j' = dite (j = j') (λ (h : j = j'), category_theory.eq_to_hom _) (λ (h : ¬j = j'), 0)
A c : bicone F
is:
- an object
c.X
and - morphisms
π j : X ⟶ F j
andι j : F j ⟶ X
for eachj
, - such that
ι j ≫ π j'
is the identity whenj = j'
and zero otherwise.
Extract the cone from a bicone.
Extract the cocone from a bicone.
- bicone : category_theory.limits.bicone F
- is_limit : category_theory.limits.is_limit category_theory.limits.has_biproduct.bicone.to_cone
- is_colimit : category_theory.limits.is_colimit category_theory.limits.has_biproduct.bicone.to_cocone
has_biproduct F
represents a particular chosen bicone which is
simultaneously a limit and a colimit of the diagram F
.
- has_biproduct : Π (F : J → C), category_theory.limits.has_biproduct F
C
has biproducts of shape J
if we have chosen
a particular limit and a particular colimit, with the same cone points,
of every function F : J → C
.
- has_biproducts_of_shape : Π (J : Type ?) [_inst_4 : decidable_eq J] [_inst_5 : fintype J], category_theory.limits.has_biproducts_of_shape J C
has_finite_biproducts C
represents a choice of biproduct for every family of objects in C
indexed by a finite type with decidable equality.
Equations
- category_theory.limits.has_finite_products_of_has_finite_biproducts C = λ (J : Type v) (_x : decidable_eq J) (_x_1 : fintype J), {has_limit := λ (F : category_theory.discrete J ⥤ C), category_theory.limits.has_limit_of_iso category_theory.discrete.nat_iso_functor.symm}
Equations
- category_theory.limits.has_finite_coproducts_of_has_finite_biproducts C = λ (J : Type v) (_x : decidable_eq J) (_x_1 : fintype J), {has_colimit := λ (F : category_theory.discrete J ⥤ C), category_theory.limits.has_colimit_of_iso category_theory.discrete.nat_iso_functor}
The isomorphism between the specified limit and the specified colimit for a functor with a bilimit.
Equations
biproduct f
computes the biproduct of a family of elements f
. (It is defined as an
abbreviation for limit (discrete.functor f)
, so for most facts about biproduct f
, you will
just use general facts about limits and colimits.)
The chosen bicone over a family of elements.
The cone coming from the chosen bicone is a limit cone.
The cocone coming from the chosen bicone is a colimit cocone.
The projection onto a summand of a biproduct.
The inclusion into a summand of a biproduct.
Given a collection of maps into the summands, we obtain a map into the biproduct.
Given a collection of maps out of the summands, we obtain a map out of the biproduct.
Given a collection of maps between corresponding summands of a pair of biproducts indexed by the same type, we obtain a map between the biproducts.
An alternative to biproduct.map
constructed via colimits.
This construction only exists in order to show it is equal to biproduct.map
.
Equations
- category_theory.limits.biproduct.ι_mono f b = {retraction := category_theory.limits.biproduct.desc (λ (b' : J), dite (b' = b) (λ (h : b' = b), category_theory.eq_to_hom _) (λ (h : ¬b' = b), category_theory.limits.biproduct.ι f b' ≫ category_theory.limits.biproduct.π f b)), id' := _}
Equations
- category_theory.limits.biproduct.π_epi f b = {section_ := category_theory.limits.biproduct.lift (λ (b' : J), dite (b = b') (λ (h : b = b'), category_theory.eq_to_hom _) (λ (h : ¬b = b'), category_theory.limits.biproduct.ι f b ≫ category_theory.limits.biproduct.π f b')), id' := _}
- X : C
- fst : c.X ⟶ P
- snd : c.X ⟶ Q
- inl : P ⟶ c.X
- inr : Q ⟶ c.X
- inl_fst' : c.inl ≫ c.fst = 𝟙 P . "obviously"
- inl_snd' : c.inl ≫ c.snd = 0 . "obviously"
- inr_fst' : c.inr ≫ c.fst = 0 . "obviously"
- inr_snd' : c.inr ≫ c.snd = 𝟙 Q . "obviously"
A binary bicone for a pair of objects P Q : C
consists of the cone point X
,
maps from X
to both P
and Q
, and maps from both P
and Q
to X
,
so that inl ≫ fst = 𝟙 P
, inl ≫ snd = 0
, inr ≫ fst = 0
, and inr ≫ snd = 𝟙 Q
Extract the cone from a binary bicone.
Equations
Extract the cocone from a binary bicone.
Equations
Convert a bicone
over a function on walking_pair
to a binary_bicone.
Equations
- b.to_binary_bicone = {X := b.X, fst := b.π category_theory.limits.walking_pair.left, snd := b.π category_theory.limits.walking_pair.right, inl := b.ι category_theory.limits.walking_pair.left, inr := b.ι category_theory.limits.walking_pair.right, inl_fst' := _, inl_snd' := _, inr_fst' := _, inr_snd' := _}
If the cone obtained from a bicone over pair X Y
is a limit cone,
so is the cone obtained by converting that bicone to a binary_bicone, then to a cone.
Equations
- category_theory.limits.bicone.to_binary_bicone_is_limit c = {lift := λ (s : category_theory.limits.cone (category_theory.limits.pair X Y)), c.lift s, fac' := _, uniq' := _}
If the cocone obtained from a bicone over pair X Y
is a colimit cocone,
so is the cocone obtained by converting that bicone to a binary_bicone, then to a cocone.
Equations
- category_theory.limits.bicone.to_binary_bicone_is_colimit c = {desc := λ (s : category_theory.limits.cocone (category_theory.limits.pair X Y)), c.desc s, fac' := _, uniq' := _}
- bicone : category_theory.limits.binary_bicone P Q
- is_limit : category_theory.limits.is_limit category_theory.limits.has_binary_biproduct.bicone.to_cone
- is_colimit : category_theory.limits.is_colimit category_theory.limits.has_binary_biproduct.bicone.to_cocone
has_binary_biproduct P Q
represents a particular chosen bicone which is
simultaneously a limit and a colimit of the diagram pair P Q
.
- has_binary_biproduct : Π (P Q : C), category_theory.limits.has_binary_biproduct P Q
has_binary_biproducts C
represents a particular chosen bicone which is
simultaneously a limit and a colimit of the diagram pair P Q
, for every P Q : C
.
A category with finite biproducts has binary biproducts.
This is not an instance as typically in concrete categories there will be an alternative construction with nicer definitional properties.
Equations
- category_theory.limits.has_binary_biproducts_of_finite_biproducts C = {has_binary_biproduct := λ (P Q : C), {bicone := (category_theory.limits.biproduct.bicone (category_theory.limits.pair P Q).obj).to_binary_bicone, is_limit := category_theory.limits.bicone.to_binary_bicone_is_limit (category_theory.limits.biproduct.is_limit (category_theory.limits.pair P Q).obj), is_colimit := category_theory.limits.bicone.to_binary_bicone_is_colimit (category_theory.limits.biproduct.is_colimit (category_theory.limits.pair P Q).obj)}}
The isomorphism between the specified binary product and the specified binary coproduct for a pair for a binary biproduct.
Equations
The chosen biproduct of a pair of objects.
The projection onto the first summand of a binary biproduct.
The projection onto the second summand of a binary biproduct.
The inclusion into the first summand of a binary biproduct.
The inclusion into the second summand of a binary biproduct.
Given a pair of maps into the summands of a binary biproduct, we obtain a map into the binary biproduct.
Given a pair of maps out of the summands of a binary biproduct, we obtain a map out of the binary biproduct.
Given a pair of maps between the summands of a pair of binary biproducts, we obtain a map between the binary biproducts.
Given a pair of isomorphisms between the summands of a pair of binary biproducts, we obtain an isomorphism between the binary biproducts.
Equations
- category_theory.limits.biprod.map_iso f g = {hom := category_theory.limits.biprod.map f.hom g.hom, inv := category_theory.limits.biprod.map f.inv g.inv, hom_inv_id' := _, inv_hom_id' := _}
An alternative to biprod.map
constructed via colimits.
This construction only exists in order to show it is equal to biprod.map
.
The braiding isomorphism which swaps a binary biproduct.
Equations
- category_theory.limits.biprod.braiding P Q = {hom := category_theory.limits.biprod.lift category_theory.limits.biprod.snd category_theory.limits.biprod.fst, inv := category_theory.limits.biprod.lift category_theory.limits.biprod.snd category_theory.limits.biprod.fst, hom_inv_id' := _, inv_hom_id' := _}
An alternative formula for the braiding isomorphism which swaps a binary biproduct, using the fact that the biproduct is a coproduct.
Equations
- category_theory.limits.biprod.braiding' P Q = {hom := category_theory.limits.biprod.desc category_theory.limits.biprod.inr category_theory.limits.biprod.inl, inv := category_theory.limits.biprod.desc category_theory.limits.biprod.inr category_theory.limits.biprod.inl, hom_inv_id' := _, inv_hom_id' := _}
The braiding isomorphism can be passed through a map by swapping the order.
The braiding isomorphism is symmetric.
In a preadditive category, we can construct a biproduct for f : J → C
from
any bicone b
for f
satisfying total : ∑ j : J, b.π j ≫ b.ι j = 𝟙 b.X
.
(That is, such a bicone is a limit cone and a colimit cocone.)
Equations
- category_theory.limits.has_biproduct_of_total b total = {bicone := b, is_limit := {lift := λ (s : category_theory.limits.cone (category_theory.discrete.functor f)), finset.univ.sum (λ (j : category_theory.discrete J), s.π.app j ≫ b.ι j), fac' := _, uniq' := _}, is_colimit := {desc := λ (s : category_theory.limits.cocone (category_theory.discrete.functor f)), finset.univ.sum (λ (j : J), b.π j ≫ s.ι.app j), fac' := _, uniq' := _}}
In a preadditive category, if the product over f : J → C
exists,
then the biproduct over f
exists.
Equations
- category_theory.limits.has_biproduct.of_has_product f = category_theory.limits.has_biproduct_of_total {X := ∏ f, π := category_theory.limits.pi.π f _inst_5, ι := λ (j : J), category_theory.limits.pi.lift (λ (j' : J), dite (j = j') (λ (h : j = j'), category_theory.eq_to_hom _) (λ (h : ¬j = j'), 0)), ι_π := _} _
In a preadditive category, if the coproduct over f : J → C
exists,
then the biproduct over f
exists.
Equations
- category_theory.limits.has_biproduct.of_has_coproduct f = category_theory.limits.has_biproduct_of_total {X := ∐ f, π := λ (j : J), category_theory.limits.sigma.desc (λ (j' : J), dite (j' = j) (λ (h : j' = j), category_theory.eq_to_hom _) (λ (h : ¬j' = j), 0)), ι := category_theory.limits.sigma.ι f _inst_5, ι_π := _} _
A preadditive category with finite products has finite biproducts.
Equations
- category_theory.limits.has_finite_biproducts.of_has_finite_products = {has_biproducts_of_shape := λ (J : Type v) (_x : decidable_eq J) (_x_1 : fintype J), {has_biproduct := λ (F : J → C), category_theory.limits.has_biproduct.of_has_product F}}
A preadditive category with finite coproducts has finite biproducts.
Equations
- category_theory.limits.has_finite_biproducts.of_has_finite_coproducts = {has_biproducts_of_shape := λ (J : Type v) (_x : decidable_eq J) (_x_1 : fintype J), {has_biproduct := λ (F : J → C), category_theory.limits.has_biproduct.of_has_coproduct F}}
In any preadditive category, any biproduct satsifies
∑ j : J, biproduct.π f j ≫ biproduct.ι f j = 𝟙 (⨁ f)
In a preadditive category, we can construct a binary biproduct for X Y : C
from
any binary bicone b
satisfying total : b.fst ≫ b.inl + b.snd ≫ b.inr = 𝟙 b.X
.
(That is, such a bicone is a limit cone and a colimit cocone.)
Equations
- category_theory.limits.has_binary_biproduct_of_total b total = {bicone := b, is_limit := {lift := λ (s : category_theory.limits.cone (category_theory.limits.pair X Y)), category_theory.limits.binary_fan.fst s ≫ b.inl + category_theory.limits.binary_fan.snd s ≫ b.inr, fac' := _, uniq' := _}, is_colimit := {desc := λ (s : category_theory.limits.cocone (category_theory.limits.pair X Y)), b.fst ≫ category_theory.limits.binary_cofan.inl s + b.snd ≫ category_theory.limits.binary_cofan.inr s, fac' := _, uniq' := _}}
In a preadditive category, if the product of X
and Y
exists, then the
binary biproduct of X
and Y
exists.
Equations
- category_theory.limits.has_binary_biproduct.of_has_binary_product X Y = category_theory.limits.has_binary_biproduct_of_total {X := X ⨯ Y, fst := category_theory.limits.prod.fst _inst_5, snd := category_theory.limits.prod.snd _inst_5, inl := category_theory.limits.prod.lift (𝟙 X) 0, inr := category_theory.limits.prod.lift 0 (𝟙 Y), inl_fst' := _, inl_snd' := _, inr_fst' := _, inr_snd' := _} _
In a preadditive category, if all binary products exist, then all binary biproducts exist.
In a preadditive category, if the coproduct of X
and Y
exists, then the
binary biproduct of X
and Y
exists.
Equations
- category_theory.limits.has_binary_biproduct.of_has_binary_coproduct X Y = category_theory.limits.has_binary_biproduct_of_total {X := X ⨿ Y, fst := category_theory.limits.coprod.desc (𝟙 X) 0, snd := category_theory.limits.coprod.desc 0 (𝟙 Y), inl := category_theory.limits.coprod.inl _inst_5, inr := category_theory.limits.coprod.inr _inst_5, inl_fst' := _, inl_snd' := _, inr_fst' := _, inr_snd' := _} _
In a preadditive category, if all binary coproducts exist, then all binary biproducts exist.
In any preadditive category, any binary biproduct satsifies
biprod.fst ≫ biprod.inl + biprod.snd ≫ biprod.inr = 𝟙 (X ⊞ Y)
.