module Cat.Instances.Shape.Join where

Join of categories🔗

The join of two categories is the category obtained by “bridging” the disjoint union with a unique morphism between each object of and each object of

module _ {o ℓ o' ℓ'} (C : Precategory o ℓ) (D : Precategory o' ℓ') where
  private
    module C = Precategory C
    module D = Precategory D
    open Precategory

  ⋆Ob : Type (o ⊔ o')
  ⋆Ob = C.Ob ⊎ D.Ob

  ⋆Hom : (A B : ⋆Ob)  Type (ℓ ⊔ ℓ')
  ⋆Hom (inl x) (inl y) = Lift ℓ' (C.Hom x y)
  ⋆Hom (inl x) (inr y) = Lift (ℓ ⊔ ℓ')
  ⋆Hom (inr x) (inl y) = Lift (ℓ ⊔ ℓ')
  ⋆Hom (inr x) (inr y) = Lift ℓ (D.Hom x y)

  ⋆compose :  {A B C : ⋆Ob}  ⋆Hom B C  ⋆Hom A B  ⋆Hom A C
  ⋆compose {inl x} {inl y} {inl z} (lift f) (lift g) = lift (f C.∘ g)
  ⋆compose {inl x} {inl y} {inr z} (lift f) (lift g) = lift tt
  ⋆compose {inl x} {inr y} {inr z} (lift f) (lift g) = lift tt
  ⋆compose {inr x} {inr y} {inr z} (lift f) (lift g) = lift (f D.∘ g)

  __ : Precategory _ _
  __ .Ob = ⋆Ob
  __ .Hom = ⋆Hom
  __ .Hom-set x y = iss x y where
    iss :  x y  is-set (⋆Hom x y)
    iss (inl x) (inl y) = hlevel 2
    iss (inl x) (inr y) _ _ p q i j = lift tt
    iss (inr x) (inr y) = hlevel 2
  __ .id {inl x} = lift C.id
  __ .id {inr x} = lift D.id
  __ .__ = ⋆compose
  __ .idr {inl x} {inl y} (lift f) = ap lift (C.idr f)
  __ .idr {inl x} {inr y} (lift f) = refl
  __ .idr {inr x} {inr y} (lift f) = ap lift (D.idr f)
  __ .idl {inl x} {inl y} (lift f) = ap lift (C.idl f)
  __ .idl {inl x} {inr y} (lift f) = refl
  __ .idl {inr x} {inr y} (lift f) = ap lift (D.idl f)
  __ .assoc {inl w} {inl x} {inl y} {inl z} (lift f) (lift g) (lift h) = ap lift (C.assoc f g h)
  __ .assoc {inl w} {inl x} {inl y} {inr z} (lift f) (lift g) (lift h) = refl
  __ .assoc {inl w} {inl x} {inr y} {inr z} (lift f) (lift g) (lift h) = refl
  __ .assoc {inl w} {inr x} {inr y} {inr z} (lift f) (lift g) (lift h) = refl
  __ .assoc {inr w} {inr x} {inr y} {inr z} (lift f) (lift g) (lift h) = ap lift (D.assoc f g h)