# mathlibdocumentation

category_theory.limits.shapes.binary_products

# Binary (co)products

We define a category walking_pair, which is the index category for a binary (co)product diagram. A convenience method pair X Y constructs the functor from the walking pair, hitting the given objects.

We define prod X Y and coprod X Y as limits and colimits of such functors.

Typeclasses has_binary_products and has_binary_coproducts assert the existence of (co)limits shaped as walking pairs.

We include lemmas for simplifying equations involving projections and coprojections, and define braiding and associating isomorphisms, and the product comparison morphism.

## References

The type of objects for the diagram indexing a binary (co)product.

The equivalence swapping left and right.

Equations

An equivalence from walking_pair to bool, sometimes useful when reindexing limits.

Equations
def category_theory.limits.pair {C : Type u}  :

The diagram on the walking pair, sending the two points to X and Y.

Equations
@[simp]
theorem category_theory.limits.pair_obj_left {C : Type u} (X Y : C) :

@[simp]
theorem category_theory.limits.pair_obj_right {C : Type u} (X Y : C) :

The natural transformation between two functors out of the walking pair, specified by its components.

Equations
@[simp]

@[simp]

The natural isomorphism between two functors out of the walking pair, specified by its components.

Equations
@[simp]

@[simp]

def category_theory.limits.pair_comp {C : Type u} {D : Type u} (X Y : C) (F : C D) :
(F.obj Y)

The natural isomorphism between pair X Y ⋙ F and pair (F.obj X) (F.obj Y).

Equations

Every functor out of the walking pair is naturally isomorphic (actually, equal) to a pair

Equations
def category_theory.limits.binary_fan {C : Type u}  :
C → C → Type (max u v)

A binary fan is just a cone on a diagram indexing a product.

The first projection of a binary fan.

The second projection of a binary fan.

@[simp]
theorem category_theory.limits.binary_fan.π_app_left {C : Type u} {X Y : C}  :

@[simp]
theorem category_theory.limits.binary_fan.π_app_right {C : Type u} {X Y : C}  :

theorem category_theory.limits.binary_fan.is_limit.hom_ext {C : Type u} {W X Y : C} {f g : W s.X} :
f s.fst = g s.fstf s.snd = g s.sndf = g

def category_theory.limits.binary_cofan {C : Type u}  :
C → C → Type (max u v)

A binary cofan is just a cocone on a diagram indexing a coproduct.

The first inclusion of a binary cofan.

The second inclusion of a binary cofan.

@[simp]
theorem category_theory.limits.binary_cofan.ι_app_left {C : Type u} {X Y : C}  :

@[simp]
theorem category_theory.limits.binary_cofan.ι_app_right {C : Type u} {X Y : C}  :

theorem category_theory.limits.binary_cofan.is_colimit.hom_ext {C : Type u} {W X Y : C} {f g : s.X W} :
s.inl f = s.inl gs.inr f = s.inr gf = g

@[simp]
theorem category_theory.limits.binary_fan.mk_X {C : Type u} {X Y P : C} (π₁ : P X) (π₂ : P Y) :
= P

def category_theory.limits.binary_fan.mk {C : Type u} {X Y P : C} :
(P X)(P Y)

A binary fan with vertex P consists of the two projections π₁ : P ⟶ X and π₂ : P ⟶ Y.

Equations
• = {X := P, π := {app := λ (j : , category_theory.limits.walking_pair.cases_on j π₁ π₂, naturality' := _}}
@[simp]
theorem category_theory.limits.binary_cofan.mk_X {C : Type u} {X Y P : C} (ι₁ : X P) (ι₂ : Y P) :
= P

def category_theory.limits.binary_cofan.mk {C : Type u} {X Y P : C} :
(X P)(Y P)

A binary cofan with vertex P consists of the two inclusions ι₁ : X ⟶ P and ι₂ : Y ⟶ P.

Equations
• = {X := P, ι := {app := λ (j : , category_theory.limits.walking_pair.cases_on j ι₁ ι₂, naturality' := _}}
@[simp]
theorem category_theory.limits.binary_fan.mk_π_app_left {C : Type u} {X Y P : C} (π₁ : P X) (π₂ : P Y) :

@[simp]
theorem category_theory.limits.binary_fan.mk_π_app_right {C : Type u} {X Y P : C} (π₁ : P X) (π₂ : P Y) :

@[simp]
theorem category_theory.limits.binary_cofan.mk_ι_app_left {C : Type u} {X Y P : C} (ι₁ : X P) (ι₂ : Y P) :

@[simp]
theorem category_theory.limits.binary_cofan.mk_ι_app_right {C : Type u} {X Y P : C} (ι₁ : X P) (ι₂ : Y P) :

def category_theory.limits.binary_fan.is_limit.lift' {C : Type u} {W X Y : C} (f : W X) (g : W Y) :
{l // l s.fst = f l s.snd = g}

If s is a limit binary fan over X and Y, then every pair of morphisms f : W ⟶ X and g : W ⟶ Y induces a morphism l : W ⟶ s.X satisfying l ≫ s.fst = f and l ≫ s.snd = g.

Equations
@[simp]
theorem category_theory.limits.binary_fan.is_limit.lift'_coe {C : Type u} {W X Y : C} (f : W X) (g : W Y) :

def category_theory.limits.binary_cofan.is_colimit.desc' {C : Type u} {W X Y : C} (f : X W) (g : Y W) :
{l // s.inl l = f s.inr l = g}

If s is a colimit binary cofan over X and Y,, then every pair of morphisms f : X ⟶ W and g : Y ⟶ W induces a morphism l : s.X ⟶ W satisfying s.inl ≫ l = f and s.inr ≫ l = g.

Equations
@[simp]
theorem category_theory.limits.binary_cofan.is_colimit.desc'_coe {C : Type u} {W X Y : C} (f : X W) (g : Y W) :

def category_theory.limits.has_binary_product {C : Type u}  :
C → C → Prop

An abbreviation for has_limit (pair X Y).

Instances
def category_theory.limits.has_binary_coproduct {C : Type u}  :
C → C → Prop

An abbreviation for has_colimit (pair X Y).

def category_theory.limits.prod {C : Type u} (X Y : C)  :
C

If we have a product of X and Y, we can access it using prod X Y or X ⨯ Y.

def category_theory.limits.coprod {C : Type u} (X Y : C)  :
C

If we have a coproduct of X and Y, we can access it using coprod X Y or X ⨿ Y.

def category_theory.limits.prod.fst {C : Type u} {X Y : C}  :
X Y X

The projection map to the first component of the product.

def category_theory.limits.prod.snd {C : Type u} {X Y : C}  :
X Y Y

The projecton map to the second component of the product.

def category_theory.limits.coprod.inl {C : Type u} {X Y : C}  :
X X ⨿ Y

The inclusion map from the first component of the coproduct.

def category_theory.limits.coprod.inr {C : Type u} {X Y : C}  :
Y X ⨿ Y

The inclusion map from the second component of the coproduct.

@[ext]
theorem category_theory.limits.prod.hom_ext {C : Type u} {W X Y : C} {f g : W X Y} :

@[ext]
theorem category_theory.limits.coprod.hom_ext {C : Type u} {W X Y : C} {f g : X ⨿ Y W} :

def category_theory.limits.prod.lift {C : Type u} {W X Y : C}  :
(W X)(W Y)(W X Y)

If the product of X and Y exists, then every pair of morphisms f : W ⟶ X and g : W ⟶ Y induces a morphism prod.lift f g : W ⟶ X ⨯ Y.

def category_theory.limits.diag {C : Type u} (X : C)  :
X X X

diagonal arrow of the binary product in the category fam I

def category_theory.limits.coprod.desc {C : Type u} {W X Y : C}  :
(X W)(Y W)(X ⨿ Y W)

If the coproduct of X and Y exists, then every pair of morphisms f : X ⟶ W and g : Y ⟶ W induces a morphism coprod.desc f g : X ⨿ Y ⟶ W.

def category_theory.limits.codiag {C : Type u} (X : C)  :
X ⨿ X X

codiagonal arrow of the binary coproduct

@[simp]
theorem category_theory.limits.prod.lift_fst_assoc {C : Type u} {W X Y : C} (f : W X) (g : W Y) {X' : C} (f' : X X') :

@[simp]
theorem category_theory.limits.prod.lift_fst {C : Type u} {W X Y : C} (f : W X) (g : W Y) :

@[simp]
theorem category_theory.limits.prod.lift_snd {C : Type u} {W X Y : C} (f : W X) (g : W Y) :

@[simp]
theorem category_theory.limits.prod.lift_snd_assoc {C : Type u} {W X Y : C} (f : W X) (g : W Y) {X' : C} (f' : Y X') :

@[simp]
theorem category_theory.limits.coprod.inl_desc {C : Type u} {W X Y : C} (f : X W) (g : Y W) :

theorem category_theory.limits.coprod.inl_desc_assoc {C : Type u} {W X Y : C} (f : X W) (g : Y W) {X' : C} (f' : W X') :

theorem category_theory.limits.coprod.inr_desc_assoc {C : Type u} {W X Y : C} (f : X W) (g : Y W) {X' : C} (f' : W X') :

@[simp]
theorem category_theory.limits.coprod.inr_desc {C : Type u} {W X Y : C} (f : X W) (g : Y W) :

@[instance]
def category_theory.limits.prod.mono_lift_of_mono_left {C : Type u} {W X Y : C} (f : W X) (g : W Y)  :

@[instance]
def category_theory.limits.prod.mono_lift_of_mono_right {C : Type u} {W X Y : C} (f : W X) (g : W Y)  :

@[instance]
def category_theory.limits.coprod.epi_desc_of_epi_left {C : Type u} {W X Y : C} (f : X W) (g : Y W)  :

@[instance]
def category_theory.limits.coprod.epi_desc_of_epi_right {C : Type u} {W X Y : C} (f : X W) (g : Y W)  :

def category_theory.limits.prod.lift' {C : Type u} {W X Y : C} (f : W X) (g : W Y) :
{l //

If the product of X and Y exists, then every pair of morphisms f : W ⟶ X and g : W ⟶ Y induces a morphism l : W ⟶ X ⨯ Y satisfying l ≫ prod.fst = f and l ≫ prod.snd = g.

Equations
def category_theory.limits.coprod.desc' {C : Type u} {W X Y : C} (f : X W) (g : Y W) :
{l //

If the coproduct of X and Y exists, then every pair of morphisms f : X ⟶ W and g : Y ⟶ W induces a morphism l : X ⨿ Y ⟶ W satisfying coprod.inl ≫ l = f and coprod.inr ≫ l = g.

Equations
def category_theory.limits.prod.map {C : Type u} {W X Y Z : C}  :
(W Y)(X Z)(W X Y Z)

If the products W ⨯ X and Y ⨯ Z exist, then every pair of morphisms f : W ⟶ Y and g : X ⟶ Z induces a morphism prod.map f g : W ⨯ X ⟶ Y ⨯ Z.

Equations
def category_theory.limits.coprod.map {C : Type u} {W X Y Z : C}  :
(W Y)(X Z)(W ⨿ X Y ⨿ Z)

If the coproducts W ⨿ X and Y ⨿ Z exist, then every pair of morphisms f : W ⟶ Y and g : W ⟶ Z induces a morphism coprod.map f g : W ⨿ X ⟶ Y ⨿ Z.

Equations
theorem category_theory.limits.prod.comp_lift_assoc {C : Type u} {V W X Y : C} (f : V W) (g : W X) (h : W Y) {X' : C} (f' : X Y X') :
f = (f h) f'

@[simp]
theorem category_theory.limits.prod.comp_lift {C : Type u} {V W X Y : C} (f : V W) (g : W X) (h : W Y) :
= (f h)

theorem category_theory.limits.prod.comp_diag {C : Type u} {X Y : C} (f : X Y) :

@[simp]
theorem category_theory.limits.prod.map_fst {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

@[simp]
theorem category_theory.limits.prod.map_fst_assoc {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) {X' : C} (f' : Y X') :

@[simp]
theorem category_theory.limits.prod.map_snd_assoc {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) {X' : C} (f' : Z X') :

@[simp]
theorem category_theory.limits.prod.map_snd {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

@[simp]
theorem category_theory.limits.prod.map_id_id {C : Type u} {X Y : C}  :
(𝟙 Y) = 𝟙 (X Y)

@[simp]

@[simp]
theorem category_theory.limits.prod.lift_map_assoc {C : Type u} {V W X Y Z : C} (f : V W) (g : V X) (h : W Y) (k : X Z) {X' : C} (f' : Y Z X') :
= (g k) f'

@[simp]
theorem category_theory.limits.prod.lift_map {C : Type u} {V W X Y Z : C} (f : V W) (g : V X) (h : W Y) (k : X Z) :

@[simp]
theorem category_theory.limits.prod.lift_fst_comp_snd_comp {C : Type u} {W X Y Z : C} (g : W X) (g' : Y Z) :

@[simp]
theorem category_theory.limits.prod.map_map_assoc {C : Type u} {A₁ A₂ A₃ B₁ B₂ B₃ : C} (f : A₁ A₂) (g : B₁ B₂) (h : A₂ A₃) (k : B₂ B₃) {X' : C} (f' : A₃ B₃ X') :
= (g k) f'

@[simp]
theorem category_theory.limits.prod.map_map {C : Type u} {A₁ A₂ A₃ B₁ B₂ B₃ : C} (f : A₁ A₂) (g : B₁ B₂) (h : A₂ A₃) (k : B₂ B₃) :

theorem category_theory.limits.prod.map_swap {C : Type u} {A B X Y : C} (f : A B) (g : X Y)  :

theorem category_theory.limits.prod.map_swap_assoc {C : Type u} {A B X Y : C} (f : A B) (g : X Y) {X' : C} (f' : Y B X') :
f' = f'

theorem category_theory.limits.prod.map_comp_id_assoc {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z) {X' : C} (f' : Z W X') :
(𝟙 W) f' = f'

theorem category_theory.limits.prod.map_comp_id {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z)  :
(𝟙 W) =

theorem category_theory.limits.prod.map_id_comp {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z)  :
(f g) =

theorem category_theory.limits.prod.map_id_comp_assoc {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z) {X' : C} (f' : W Z X') :
(f g) f' = f'

@[simp]
theorem category_theory.limits.prod.map_iso_hom {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

@[simp]
theorem category_theory.limits.prod.map_iso_inv {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

def category_theory.limits.prod.map_iso {C : Type u} {W X Y Z : C}  :
(W Y)(X Z)(W X Y Z)

If the products W ⨯ X and Y ⨯ Z exist, then every pair of isomorphisms f : W ≅ Y and g : X ≅ Z induces an isomorphism prod.map_iso f g : W ⨯ X ≅ Y ⨯ Z.

Equations
@[simp]
theorem category_theory.limits.prod.diag_map {C : Type u} {X Y : C} (f : X Y)  :

@[simp]
theorem category_theory.limits.prod.diag_map_assoc {C : Type u} {X Y : C} (f : X Y) {X' : C} (f' : Y Y X') :

@[simp]
theorem category_theory.limits.prod.diag_map_fst_snd_assoc {C : Type u} {X Y : C} [ (X Y)] {X' : C} (f' : X Y X') :

@[simp]
theorem category_theory.limits.prod.diag_map_fst_snd {C : Type u} {X Y : C} [ (X Y)] :

@[simp]
theorem category_theory.limits.prod.diag_map_fst_snd_comp {C : Type u} {X X' Y Y' : C} (g : X Y) (g' : X' Y') :

@[simp]
theorem category_theory.limits.prod.diag_map_fst_snd_comp_assoc {C : Type u} {X X' Y Y' : C} (g : X Y) (g' : X' Y') {X'_1 : C} (f' : Y Y' X'_1) :

@[instance]

Equations
@[simp]
theorem category_theory.limits.coprod.desc_comp {C : Type u} {V W X Y : C} (f : V W) (g : X V) (h : Y V) :
= (h f)

@[simp]
theorem category_theory.limits.coprod.desc_comp_assoc {C : Type u} {V W X Y : C} (f : V W) (g : X V) (h : Y V) {X' : C} (f' : W X') :
f f' = (h f) f'

theorem category_theory.limits.coprod.diag_comp {C : Type u} {X Y : C} (f : X Y) :

@[simp]
theorem category_theory.limits.coprod.inl_map {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

@[simp]
theorem category_theory.limits.coprod.inl_map_assoc {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) {X' : C} (f' : Y ⨿ Z X') :

@[simp]
theorem category_theory.limits.coprod.inr_map_assoc {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) {X' : C} (f' : Y ⨿ Z X') :

@[simp]
theorem category_theory.limits.coprod.inr_map {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

@[simp]
theorem category_theory.limits.coprod.map_id_id {C : Type u} {X Y : C}  :
(𝟙 Y) = 𝟙 (X ⨿ Y)

@[simp]

@[simp]
theorem category_theory.limits.coprod.map_desc {C : Type u} {S T U V W : C} (f : U S) (g : W S) (h : T U) (k : V W) :

theorem category_theory.limits.coprod.map_desc_assoc {C : Type u} {S T U V W : C} (f : U S) (g : W S) (h : T U) (k : V W) {X' : C} (f' : S X') :
= (k g) f'

@[simp]
theorem category_theory.limits.coprod.desc_comp_inl_comp_inr {C : Type u} {W X Y Z : C} (g : W X) (g' : Y Z) :

@[simp]
theorem category_theory.limits.coprod.map_map_assoc {C : Type u} {A₁ A₂ A₃ B₁ B₂ B₃ : C} (f : A₁ A₂) (g : B₁ B₂) (h : A₂ A₃) (k : B₂ B₃) {X' : C} (f' : A₃ ⨿ B₃ X') :
= (g k) f'

@[simp]
theorem category_theory.limits.coprod.map_map {C : Type u} {A₁ A₂ A₃ B₁ B₂ B₃ : C} (f : A₁ A₂) (g : B₁ B₂) (h : A₂ A₃) (k : B₂ B₃) :

theorem category_theory.limits.coprod.map_swap {C : Type u} {A B X Y : C} (f : A B) (g : X Y)  :

theorem category_theory.limits.coprod.map_swap_assoc {C : Type u} {A B X Y : C} (f : A B) (g : X Y) {X' : C} (f' : Y ⨿ B X') :
f' = f'

theorem category_theory.limits.coprod.map_comp_id {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z)  :
(𝟙 W) =

theorem category_theory.limits.coprod.map_comp_id_assoc {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z) {X' : C} (f' : Z ⨿ W X') :
(𝟙 W) f' = f'

theorem category_theory.limits.coprod.map_id_comp_assoc {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z) {X' : C} (f' : W ⨿ Z X') :
(f g) f' = f'

theorem category_theory.limits.coprod.map_id_comp {C : Type u} {X Y Z W : C} (f : X Y) (g : Y Z)  :
(f g) =

@[simp]
theorem category_theory.limits.coprod.map_iso_hom {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

@[simp]
theorem category_theory.limits.coprod.map_iso_inv {C : Type u} {W X Y Z : C} (f : W Y) (g : X Z) :

def category_theory.limits.coprod.map_iso {C : Type u} {W X Y Z : C}  :
(W Y)(X Z)(W ⨿ X Y ⨿ Z)

If the coproducts W ⨿ X and Y ⨿ Z exist, then every pair of isomorphisms f : W ≅ Y and g : W ≅ Z induces a isomorphism coprod.map_iso f g : W ⨿ X ≅ Y ⨿ Z.

Equations
@[simp]
theorem category_theory.limits.coprod.map_codiag {C : Type u} {X Y : C} (f : X Y)  :

theorem category_theory.limits.coprod.map_codiag_assoc {C : Type u} {X Y : C} (f : X Y) {X' : C} (f' : Y X') :

@[simp]
theorem category_theory.limits.coprod.map_inl_inr_codiag {C : Type u} {X Y : C} [ (X ⨿ Y)] :

theorem category_theory.limits.coprod.map_inl_inr_codiag_assoc {C : Type u} {X Y : C} [ (X ⨿ Y)] {X' : C} (f' : X ⨿ Y X') :

@[simp]
theorem category_theory.limits.coprod.map_comp_inl_inr_codiag {C : Type u} {X X' Y Y' : C} (g : X Y) (g' : X' Y') :

theorem category_theory.limits.coprod.map_comp_inl_inr_codiag_assoc {C : Type u} {X X' Y Y' : C} (g : X Y) (g' : X' Y') {X'_1 : C} (f' : Y ⨿ Y' X'_1) :

def category_theory.limits.has_binary_products (C : Type u)  :
Prop

has_binary_products represents a choice of product for every pair of objects.

See https://stacks.math.columbia.edu/tag/001T.

Instances

has_binary_coproducts represents a choice of coproduct for every pair of objects.

See https://stacks.math.columbia.edu/tag/04AP.

Instances
theorem category_theory.limits.has_binary_products_of_has_limit_pair (C : Type u) [∀ {X Y : C}, ] :

If C has all limits of diagrams pair X Y, then it has all binary products

If C has all colimits of diagrams pair X Y, then it has all binary coproducts

@[simp]
theorem category_theory.limits.prod.functor_obj_obj {C : Type u} (X Y : C) :
= (X Y)

@[simp]
theorem category_theory.limits.prod.functor_obj_map {C : Type u} (X Y Z : C) (g : Y Z) :

@[simp]
theorem category_theory.limits.prod.functor_map_app {C : Type u} (Y Z : C) (f : Y Z) (T : C) :

def category_theory.limits.prod.functor {C : Type u}  :
C C C

The binary product functor.

Equations
def category_theory.limits.prod_comparison {C : Type u} {D : Type u₂} (F : C D) (A B : C) [ (F.obj B)] :
F.obj (A B) F.obj A F.obj B

The product comparison morphism.

In category_theory/limits/preserves we show this is always an iso iff F preserves binary products.

Equations
theorem category_theory.limits.prod_comparison_natural_assoc {C : Type u} {D : Type u₂} (F : C D) {A A' B B' : C} [ (F.obj B)] [ (F.obj B')] (f : A A') (g : B B') {X' : D} (f' : F.obj A' F.obj B' X') :
f' = (F.map g) f'

theorem category_theory.limits.prod_comparison_natural {C : Type u} {D : Type u₂} (F : C D) {A A' B B' : C} [ (F.obj B)] [ (F.obj B')] (f : A A') (g : B B') :
= (F.map g)

Naturality of the prod_comparison morphism in both arguments.

theorem category_theory.limits.inv_prod_comparison_map_fst_assoc {C : Type u} {D : Type u₂} (F : C D) {A B : C} [ (F.obj B)] {X' : D} (f' : F.obj A X') :

theorem category_theory.limits.inv_prod_comparison_map_fst {C : Type u} {D : Type u₂} (F : C D) {A B : C} [ (F.obj B)]  :

theorem category_theory.limits.inv_prod_comparison_map_snd {C : Type u} {D : Type u₂} (F : C D) {A B : C} [ (F.obj B)]  :

theorem category_theory.limits.inv_prod_comparison_map_snd_assoc {C : Type u} {D : Type u₂} (F : C D) {A B : C} [ (F.obj B)] {X' : D} (f' : F.obj B X') :

theorem category_theory.limits.prod_comparison_inv_natural {C : Type u} {D : Type u₂} (F : C D) {A A' B B' : C} [ (F.obj B)] [ (F.obj B')] (f : A A') (g : B B')  :

If the product comparison morphism is an iso, its inverse is natural.

theorem category_theory.limits.prod_comparison_inv_natural_assoc {C : Type u} {D : Type u₂} (F : C D) {A A' B B' : C} [ (F.obj B)] [ (F.obj B')] (f : A A') (g : B B') {X' : D} (f' : F.obj (A' B') X') :
= (F.map g)