cofree
Cofree is a dual notion in category theory used to describe a universal coalgebra construction. Given an endofunctor F: C → C, a cofree F-coalgebra on an object A in C consists of a coalgebra (C, γ: C → F(C)) together with a morphism ε: C → A such that for every coalgebra (D, δ: D → F(D)) and every morphism f: D → A, there exists a unique coalgebra morphism h: D → C with ε ∘ h = f. Here, a coalgebra morphism h satisfies γ ∘ h = F(h) ∘ δ. In other words, (C, γ, ε) is universal among coalgebras mapping to A, playing the dual role to a free object.
In practical terms, cofree coalgebras provide a canonical way to “coinductively” generate and reason about behaviors
A standard example appears in Set with F(X) = A × X. The cofree F-coalgebra on A is
Cofree constructions thus contrast with free constructions by dualizing initiality to terminality in the appropriate comma