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 provide an induction principle Sum.homInduction
to reason and work with morphisms in this
category.
The sum of two functors F : A ⥤ C
and G : B ⥤ C
is a functor A ⊕ B ⥤ C
, written F.sum' G
.
This construction should be preferred when defining functors out of a sum.
We provide natural isomorphisms inlCompSum' : inl_ ⋙ F.sum' G ≅ F
and
inrCompSum' : inl_ ⋙ F.sum' G ≅ G
.
Furthermore, we provide Functor.sumIsoExt
, which
constructs a natural isomorphism of functors out of a sum out of natural isomorphism with
their precomposition with the inclusion. This construction sholud be preferred when trying
to construct isomorphisms between functors out of a sum.
We further define sums of functors and natural transformations, written F.sum G
and α.sum β
.
sum C D
gives the direct sum of two categories.
Equations
- One or more equations did not get rendered due to their size.
inl_
is the functor X ↦ inl X
.
Equations
Instances For
inr_
is the functor X ↦ inr X
.
Equations
Instances For
An induction principle for morphisms in a sum of category: a morphism is either of the form
(inl_ _ _).map _
or of the form (inr_ _ _).map _)
.
Equations
- CategoryTheory.Sum.homInduction inl inr f_2 = inl x_2 y_2 f_2.down
- CategoryTheory.Sum.homInduction inl inr f_2 = inr x_2 y_2 f_2.down
Instances For
The sum of two functors that land in a given category C
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
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
The sum of two functors.
Equations
- F.sum G = (F.comp (CategoryTheory.Sum.inl_ B D)).sum' (G.comp (CategoryTheory.Sum.inr_ B D))
Instances For
A functor out of a sum is uniquely characterized by its precompositions with inl_
and inr_
.
Equations
- CategoryTheory.Functor.sumIsoExt e₁ e₂ = CategoryTheory.NatIso.ofComponents (fun (x : A ⊕ B) => match x with | Sum.inl x => e₁.app x | Sum.inr x => e₂.app x) ⋯
Instances For
Any functor out of a sum is the sum of its precomposition with the inclusions.
Equations
Instances For
The sum of two natural transformations, where all functors have the same target category.
Equations
Instances For
The sum of two natural transformations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The functor exchanging two direct summand categories.
Equations
- CategoryTheory.Sum.swap C D = (CategoryTheory.Sum.inr_ D C).sum' (CategoryTheory.Sum.inl_ D C)
Instances For
Precomposing swap
with the left inclusion gives the right inclusion.
Equations
- CategoryTheory.Sum.swapCompInl C D = ((CategoryTheory.Sum.inr_ D C).inlCompSum' (CategoryTheory.Sum.inl_ D C)).symm
Instances For
Precomposing swap
with the right inclusion gives the leftt inclusion.
Equations
- CategoryTheory.Sum.swapCompInr C D = ((CategoryTheory.Sum.inr_ D C).inrCompSum' (CategoryTheory.Sum.inl_ D C)).symm
Instances For
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
The double swap on C ⊕ D
is naturally isomorphic to the identity functor.