module Cat.Functor.Adjoint.Cofree
{o ℓ o' ℓ'} {C : Precategory o ℓ} {D : Precategory o' ℓ'} where
Cofree objects🔗
Cofree objects are formally dual to free objects, as opposed to coffee objects.
private
module C = Precategory C
module D = Precategory D
module _ (F : Functor C D) where
private
open module F = Functor F hiding (op)
record Cofree-object (X : D.Ob) : Type (adj-level C D) where
field
{cofree} : C.Ob
: D.Hom (F₀ cofree) X
counit
: ∀ {Y} (f : D.Hom (F₀ Y) X) → C.Hom Y cofree
unfold : ∀ {Y} {f : D.Hom (F₀ Y) X} → counit D.∘ F₁ (unfold f) ≡ f
commute
unique: ∀ {Y} {f : D.Hom (F₀ Y) X} (g : C.Hom Y cofree)
→ counit D.∘ F₁ g ≡ f
→ g ≡ unfold f
module _ {F : Functor C D} where
private
module F = Functor F
: ∀ {X} → Free-object F.op X → Cofree-object F X
co-free→cofree = record
co-free→cofree free { Free-object free renaming (free to cofree; fold to unfold; unit to counit) }
: ∀ {X} → Cofree-object F X → Free-object F.op X
cofree→co-free = record
cofree→co-free cofree { Cofree-object cofree renaming
(cofree to free; unfold to fold; counit to unit) }
: {U : Functor D C} → F ⊣ U → ∀ X → Cofree-object F X
right-adjoint→cofree-objects =
right-adjoint→cofree-objects F⊣U (opposite-adjunction F⊣U)
co-free→cofree ⊙ left-adjoint→free-objects
cofree-objects→right-adjoint: (∀ X → Cofree-object F X) → (Σ[ U ∈ Functor D C ] F ⊣ U)
= _ , adjoint-natural-isol ni adj where
cofree-objects→right-adjoint cofree-objs : unopF F.op ≅ⁿ F
ni = trivial-isoⁿ!
ni
: unopF F.op ⊣ _
adj = unop-adjunction (free-objects≃left-adjoint .fst (cofree→co-free ⊙ cofree-objs) .snd) adj