definition example

The terminal category has one object and only the identity morphism. It is the Terminal Object of the category : for every there is a unique functor . A functor is the same as an object of (Global Element); a functor is a set; .

Sources: DaoFP §3.1 (“stick-figure categories”), §19.3 (limits as Kan extensions along ), §20.7; 7 Sketches Example 3.30 (the database schema with one table and no columns: instances are sets), §7.4.1 (the one-point space: ); Kittenlab Lecture 9.

Docs: ACSets API · ThCategory (GATlab) · Theories & presentations — Kittenlab Lecture 9

using Catlab
@present One(FreeCategory) begin X::Ob end          # the terminal category: one object, no generating arrows
# a functor 1 → Graph picks an object: an instance on the one-table schema is a set
@present SchSet(FreeSchema) begin X::Ob end
@acset_type SetInst(SchSet)
S = @acset SetInst begin X = 4 end                   # "a set with 4 elements"
import Mathlib
open CategoryTheory
#check @CategoryTheory.Discrete PUnit             -- the terminal category as Discrete PUnit
#check @CategoryTheory.Functor.star               -- the unique functor C ⥤ Discrete PUnit
-- the terminal category has one object; a functor out of it is just an object
data One = Star
pick :: c -> (One -> c)
pick x Star = x