module Cat.Instances.Shape.Two where
The two-object category🔗
We define the discrete category on two objects, which is useful for expressing binary products and coproducts as limits and colimits, respectively.
: Precategory _ _
2-object-category = Disc' (el! Bool) 2-object-category
A diagram of shape in simply consists of two objects of
module _ {o h} {C : Precategory o h} where
open Precategory C
: Ob → Ob → Functor 2-object-category C
2-object-diagram = Disc-diagram λ where
2-object-diagram a b → a
true → b false
Similarly, a natural transformation between two such diagrams consists of two morphisms in
2-object-nat-trans: ∀ {F G : Functor 2-object-category C}
→ Hom (F # true) (G # true) → Hom (F # false) (G # false)
→ F => G
= Disc-natural λ where
2-object-nat-trans f g → f
true → g false
We note that any functor is canonically equal, not just naturally isomorphic, to the one we defined above.
canonical-functors: ∀ (F : Functor 2-object-category C)
→ F ≡ 2-object-diagram (F # true) (F # false)
= Functor-path p q where
canonical-functors F : ∀ x → _
p = refl
p false = refl
p true
: ∀ {x y} (f : x ≡ y) → _
q {false} {false} p =
q .F₁ p ≡⟨ ap (F .F₁) (Bool-is-set _ _ _ _) ⟩
F .F₁ refl ≡⟨ F .F-id ⟩
F
id ∎{true} {true} p =
q .F₁ p ≡⟨ ap (F .F₁) (Bool-is-set _ _ _ _) ⟩
F .F₁ refl ≡⟨ F .F-id ⟩
F
id ∎{false} {true} p = absurd (true≠false (sym p))
q {true} {false} p = absurd (true≠false p) q