Binary disjoint unions of categories #
We define the category instance on C ⊕ D
when C
and D
are categories.
We define:
inl_
: the functorC ⥤ C ⊕ D
inr_
: the functorD ⥤ C ⊕ D
swap
: the functorC ⊕ D ⥤ D ⊕ C
(and the fact this is an equivalence)
We further define sums of functors and natural transformations, written F.sum G
and α.sum β
.
instance
CategoryTheory.sum
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
sum C D
gives the direct sum of two categories.
Equations
- CategoryTheory.sum C D = CategoryTheory.Category.mk
theorem
CategoryTheory.hom_inl_inr_false
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{X : C}
{Y : D}
(f : Sum.inl X ⟶ Sum.inr Y)
:
theorem
CategoryTheory.hom_inr_inl_false
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{X : C}
{Y : D}
(f : Sum.inr X ⟶ Sum.inl Y)
:
@[simp]
theorem
CategoryTheory.sum_comp_inl
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{P : C}
{Q : C}
{R : C}
(f : Sum.inl P ⟶ Sum.inl Q)
(g : Sum.inl Q ⟶ Sum.inl R)
:
@[simp]
theorem
CategoryTheory.sum_comp_inr
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{P : D}
{Q : D}
{R : D}
(f : Sum.inr P ⟶ Sum.inr Q)
(g : Sum.inr Q ⟶ Sum.inr R)
:
@[simp]
theorem
CategoryTheory.Sum.inl__map
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
(X : C)
(Y : C)
(f : X ⟶ Y)
:
(CategoryTheory.Sum.inl_ C D).toPrefunctor.map f = f
@[simp]
theorem
CategoryTheory.Sum.inl__obj
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
(X : C)
:
(CategoryTheory.Sum.inl_ C D).toPrefunctor.obj X = Sum.inl X
def
CategoryTheory.Sum.inl_
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
CategoryTheory.Functor C (C ⊕ D)
inl_
is the functor X ↦ inl X
.
Equations
- CategoryTheory.Sum.inl_ C D = CategoryTheory.Functor.mk { obj := fun (X : C) => Sum.inl X, map := fun (X Y : C) (f : X ⟶ Y) => f }
Instances For
@[simp]
theorem
CategoryTheory.Sum.inr__map
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
(X : D)
(Y : D)
(f : X ⟶ Y)
:
(CategoryTheory.Sum.inr_ C D).toPrefunctor.map f = f
@[simp]
theorem
CategoryTheory.Sum.inr__obj
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
(X : D)
:
(CategoryTheory.Sum.inr_ C D).toPrefunctor.obj X = Sum.inr X
def
CategoryTheory.Sum.inr_
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
CategoryTheory.Functor D (C ⊕ D)
inr_
is the functor X ↦ inr X
.
Equations
- CategoryTheory.Sum.inr_ C D = CategoryTheory.Functor.mk { obj := fun (X : D) => Sum.inr X, map := fun (X Y : D) (f : X ⟶ Y) => f }
Instances For
def
CategoryTheory.Sum.swap
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
CategoryTheory.Functor (C ⊕ D) (D ⊕ C)
The functor exchanging two direct summand categories.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
CategoryTheory.Sum.swap_obj_inl
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
(X : C)
:
(CategoryTheory.Sum.swap C D).toPrefunctor.obj (Sum.inl X) = Sum.inr X
@[simp]
theorem
CategoryTheory.Sum.swap_obj_inr
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
(X : D)
:
(CategoryTheory.Sum.swap C D).toPrefunctor.obj (Sum.inr X) = Sum.inl X
@[simp]
theorem
CategoryTheory.Sum.swap_map_inl
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{X : C}
{Y : C}
{f : Sum.inl X ⟶ Sum.inl Y}
:
(CategoryTheory.Sum.swap C D).toPrefunctor.map f = f
@[simp]
theorem
CategoryTheory.Sum.swap_map_inr
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{X : D}
{Y : D}
{f : Sum.inr X ⟶ Sum.inr Y}
:
(CategoryTheory.Sum.swap C D).toPrefunctor.map f = f
def
CategoryTheory.Sum.Swap.equivalence
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
swap
gives an equivalence between C ⊕ D
and D ⊕ C
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
instance
CategoryTheory.Sum.Swap.isEquivalence
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
Equations
- CategoryTheory.Sum.Swap.isEquivalence C D = inferInstance
def
CategoryTheory.Sum.Swap.symmetry
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
The double swap on C ⊕ D
is naturally isomorphic to the identity functor.
Equations
- CategoryTheory.Sum.Swap.symmetry C D = (CategoryTheory.Sum.Swap.equivalence C D).unitIso.symm
Instances For
def
CategoryTheory.Functor.sum
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor C D)
:
CategoryTheory.Functor (A ⊕ C) (B ⊕ D)
The sum of two functors.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
CategoryTheory.Functor.sum_obj_inl
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor C D)
(a : A)
:
(CategoryTheory.Functor.sum F G).toPrefunctor.obj (Sum.inl a) = Sum.inl (F.toPrefunctor.obj a)
@[simp]
theorem
CategoryTheory.Functor.sum_obj_inr
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor C D)
(c : C)
:
(CategoryTheory.Functor.sum F G).toPrefunctor.obj (Sum.inr c) = Sum.inr (G.toPrefunctor.obj c)
@[simp]
theorem
CategoryTheory.Functor.sum_map_inl
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor C D)
{a : A}
{a' : A}
(f : Sum.inl a ⟶ Sum.inl a')
:
(CategoryTheory.Functor.sum F G).toPrefunctor.map f = F.toPrefunctor.map f
@[simp]
theorem
CategoryTheory.Functor.sum_map_inr
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor C D)
{c : C}
{c' : C}
(f : Sum.inr c ⟶ Sum.inr c')
:
(CategoryTheory.Functor.sum F G).toPrefunctor.map f = G.toPrefunctor.map f
def
CategoryTheory.NatTrans.sum
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
{F : CategoryTheory.Functor A B}
{G : CategoryTheory.Functor A B}
{H : CategoryTheory.Functor C D}
{I : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : H ⟶ I)
:
The sum of two natural transformations.
Equations
- CategoryTheory.NatTrans.sum α β = CategoryTheory.NatTrans.mk fun (X : A ⊕ C) => match X with | Sum.inl X => α.app X | Sum.inr X => β.app X
Instances For
@[simp]
theorem
CategoryTheory.NatTrans.sum_app_inl
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
{F : CategoryTheory.Functor A B}
{G : CategoryTheory.Functor A B}
{H : CategoryTheory.Functor C D}
{I : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : H ⟶ I)
(a : A)
:
(CategoryTheory.NatTrans.sum α β).app (Sum.inl a) = α.app a
@[simp]
theorem
CategoryTheory.NatTrans.sum_app_inr
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
{F : CategoryTheory.Functor A B}
{G : CategoryTheory.Functor A B}
{H : CategoryTheory.Functor C D}
{I : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : H ⟶ I)
(c : C)
:
(CategoryTheory.NatTrans.sum α β).app (Sum.inr c) = β.app c