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)
:
theorem
CategoryTheory.sum_comp_inl
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{P Q R : C}
(f : Sum.inl P ⟶ Sum.inl Q)
(g : Sum.inl Q ⟶ Sum.inl R)
:
theorem
CategoryTheory.sum_comp_inr
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{P Q R : D}
(f : Sum.inr P ⟶ Sum.inr Q)
(g : Sum.inr Q ⟶ Sum.inr R)
:
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 = { obj := fun (X : C) => Sum.inl X, map := fun {x x_1 : C} (f : x ⟶ x_1) => f, map_id := ⋯, map_comp := ⋯ }
Instances For
@[simp]
theorem
CategoryTheory.Sum.inl__map
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{x✝ x✝¹ : C}
(f : x✝ ⟶ x✝¹)
:
(CategoryTheory.Sum.inl_ C D).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).obj X = Sum.inl 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 = { obj := fun (X : D) => Sum.inr X, map := fun {x x_1 : D} (f : x ⟶ x_1) => f, map_id := ⋯, map_comp := ⋯ }
Instances For
@[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).obj X = Sum.inr X
@[simp]
theorem
CategoryTheory.Sum.inr__map
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{x✝ x✝¹ : D}
(f : x✝ ⟶ x✝¹)
:
(CategoryTheory.Sum.inr_ C D).map f = f
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).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).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 Y : C}
{f : Sum.inl X ⟶ Sum.inl Y}
:
(CategoryTheory.Sum.swap C D).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 Y : D}
{f : Sum.inr X ⟶ Sum.inr Y}
:
(CategoryTheory.Sum.swap C D).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
@[simp]
theorem
CategoryTheory.Sum.Swap.equivalence_functor
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
(CategoryTheory.Sum.Swap.equivalence C D).functor = CategoryTheory.Sum.swap C D
@[simp]
theorem
CategoryTheory.Sum.Swap.equivalence_inverse
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
(CategoryTheory.Sum.Swap.equivalence C D).inverse = CategoryTheory.Sum.swap D C
instance
CategoryTheory.Sum.Swap.isEquivalence
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
(CategoryTheory.Sum.swap C D).IsEquivalence
Equations
- ⋯ = ⋯
def
CategoryTheory.Sum.Swap.symmetry
(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
:
(CategoryTheory.Sum.swap C D).comp (CategoryTheory.Sum.swap D C) ≅ CategoryTheory.Functor.id (C ⊕ 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
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]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
:
CategoryTheory.Functor (A ⊕ B) C
Similar to sum
, but both functors land in the same category C
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
CategoryTheory.Functor.inlCompSum'
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
:
(CategoryTheory.Sum.inl_ A B).comp (F.sum' G) ≅ F
The sum F.sum' G
precomposed with the left inclusion functor is isomorphic to F
Equations
- F.inlCompSum' G = CategoryTheory.NatIso.ofComponents (fun (x : A) => CategoryTheory.Iso.refl (((CategoryTheory.Sum.inl_ A B).comp (F.sum' G)).obj x)) ⋯
Instances For
@[simp]
theorem
CategoryTheory.Functor.inlCompSum'_inv_app
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
(X : A)
:
(F.inlCompSum' G).inv.app X = CategoryTheory.CategoryStruct.id ((F.sum' G).obj (Sum.inl X))
@[simp]
theorem
CategoryTheory.Functor.inlCompSum'_hom_app
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
(X : A)
:
(F.inlCompSum' G).hom.app X = CategoryTheory.CategoryStruct.id ((F.sum' G).obj (Sum.inl X))
def
CategoryTheory.Functor.inrCompSum'
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
:
(CategoryTheory.Sum.inr_ A B).comp (F.sum' G) ≅ G
The sum F.sum' G
precomposed with the right inclusion functor is isomorphic to G
Equations
- F.inrCompSum' G = CategoryTheory.NatIso.ofComponents (fun (x : B) => CategoryTheory.Iso.refl (((CategoryTheory.Sum.inr_ A B).comp (F.sum' G)).obj x)) ⋯
Instances For
@[simp]
theorem
CategoryTheory.Functor.inrCompSum'_inv_app
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
(X : B)
:
(F.inrCompSum' G).inv.app X = CategoryTheory.CategoryStruct.id ((F.sum' G).obj (Sum.inr X))
@[simp]
theorem
CategoryTheory.Functor.inrCompSum'_hom_app
{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
(X : B)
:
(F.inrCompSum' G).hom.app X = CategoryTheory.CategoryStruct.id ((F.sum' G).obj (Sum.inr X))
@[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)
:
@[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)
:
@[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}
(f : Sum.inl a ⟶ Sum.inl a')
:
(F.sum G).map f = F.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}
(f : Sum.inr c ⟶ Sum.inr c')
:
(F.sum G).map f = G.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 G : CategoryTheory.Functor A B}
{H I : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : H ⟶ I)
:
F.sum H ⟶ G.sum I
The sum of two natural transformations.
Equations
- CategoryTheory.NatTrans.sum α β = { app := fun (X : A ⊕ C) => match X with | Sum.inl X => α.app X | Sum.inr X => β.app X, naturality := ⋯ }
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 G : CategoryTheory.Functor A B}
{H 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 G : CategoryTheory.Functor A B}
{H I : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : H ⟶ I)
(c : C)
:
(CategoryTheory.NatTrans.sum α β).app (Sum.inr c) = β.app c