Lecture VI — Definitions 6.3–6.5 (Scott 1981, PRG-19): functors, T-algebras, #
initial algebras
To state domain equations D ≅ T(D) and single out their canonical solutions,
Scott introduces
"a small amount of the terminology of category theory" and stresses that the next
few definitions
"could be given for any category". This module sets up a small, self-contained
category abstraction
and formalises that vocabulary:
- Definition 6.3 — a functor
Ton a category into itself (an endofunctor), preserving identities and composition. - Definition 6.4 — a
T-algebrak : T(E) → Eand a homomorphism ofT-algebras. - Definition 6.5 — an initial
T-algebra: one with a unique homomorphism into every algebra.
Everything is generic over an arbitrary Category, exactly as Scott emphasises.
As Scott also notes
in the prose preceding Definition 6.3 ("[the systems] form quite an interesting
category with respect
to the approximable maps"), the neighbourhood systems and approximable maps of the
project are a
category; that instance (DomainObj) is provided here as a witness that the
abstract definitions are
not vacuous.
Auxiliary categorical lemmas (identity and composition of algebra homomorphisms,
Iso) needed for
Propositions 6.6 and 6.7 are developed here as well.
All definitions and lemmas are constructive and choice-free
(#print axioms ⊆ {propext, Quot.sound}); the underlying composition laws are the
project's
idMap_comp/comp_idMap/comp_assoc (Theorem 2.5).
Why a bespoke Category rather than Mathlib's CategoryTheory.Category? #
Mathlib does have a fully developed category theory: CategoryTheory.Category
(structurally
identical to the class below — separate object/morphism universes, Hom, id,
comp, and the three
laws), functors C ⥤ D, Iso, CategoryTheory.Endofunctor.Algebra/Algebra.Hom
with the category
of algebras, Limits.IsInitial, and even Lambek's lemma as
Endofunctor.Algebra.Initial.strInv /
left_inv / right_inv. So Mathlib is expressive enough to state every one of
Definitions 6.3–6.5
(and Propositions 6.6–6.7) verbatim — it is not a question of missing vocabulary.
It is nonetheless the wrong tool here, and the reason is this project's headline invariant, not taste. The trade-off was checked empirically:
- The bare instance is fine: a
Category DomainObjbuilt onApproximableMap(Theorem 2.5 laws) is choice-free,#print axioms = [propext, Quot.sound]. - But the only reason to import Mathlib's hierarchy is to reuse its downstream
content — functor
algebras and the initial-algebra fixed-point theorem — and that content is
choice-bound:
Mathlib.CategoryTheory.Endofunctor.Algebra.Initial.left_inv(the inverse half of Lambek's lemma, i.e. Scott's Proposition 6.7) reports[propext, Classical.choice, Quot.sound], because Mathlib'sIsInitialrides on theLimitsframework. - By contrast, the project's own
initialIso(Proposition 6.6) andlambek(Proposition 6.7), built on the class below, depend on no axioms whatsoever (#print axiomsreports "does not depend on any axioms").
So adopting Mathlib would force one of two losing choices: (a) consume its
initial-algebra API and
thereby inject Classical.choice into the project's flagship Lecture VI results,
breaking the
#print axioms ⊆ {propext, Quot.sound} discipline that is the whole point; or (b)
take only the bare
class and re-prove 6.6–6.7 by hand anyway — paying a heavy transitive import and
the ≫
(diagrammatic, "f then g") vs ⊚ (Scott's "g after f") convention clash
for no reusable
content. Since Scott asks only for "a small amount of the terminology of category
theory", the
~50-line self-contained class below supplies exactly that vocabulary while keeping
every proof
constructive and choice-free. The Mathlib Category is therefore usable but
counterproductive for
this development, and is deliberately not used.
A category: objects (a type Obj), hom-sets Hom X Y, identities,
composition, and the three
category laws. We bundle it as a class so a fixed object type can carry its
categorical structure.
The composition comp g f reads "g after f" (the same convention as
ApproximableMap.comp).
- Hom : Obj → Obj → Type v
The morphisms from
XtoY. - id (X : Obj) : Hom X X
The identity morphism on each object.
Composition:
comp g fis "gafterf".Left identity law
I ∘ f = f.Right identity law
f ∘ I = f.Associativity
(h ∘ g) ∘ f = h ∘ (g ∘ f).
Instances
Composition: comp g f is "g after f".
Equations
- One or more equations did not get rendered due to their size.
Instances For
The category of neighbourhood systems and approximable maps #
Scott's running category (prose before Definition 6.3). Objects bundle a token type with a system; morphisms are approximable maps; the laws are Theorem 2.5.
An object of the category of domains: a token type together with a neighbourhood system on it.
- carrier : Type w
The token type.
- sys : NeighborhoodSystem self.carrier
The neighbourhood system (the "domain").
Instances For
The category of domains and approximable maps (Scott's prose preceding
Definition 6.3):
identities and associative composition come from Theorem 2.5 (idMap_comp,
comp_idMap,
comp_assoc).
Equations
- One or more equations did not get rendered due to their size.
Definition 6.3 — functors #
Definition 6.3 (Scott 1981, PRG-19). A functor on a category into itself
(an
endofunctor): an assignment obj on objects and map on morphisms preserving
identities
(map_id) and composition (map_comp).
- obj : Obj → Obj
The action on objects.
- map {X Y : Obj} : Category.Hom X Y → Category.Hom (self.obj X) (self.obj Y)
The action on morphisms.
T(I_X) = I_{T(X)}.- map_comp {X Y Z : Obj} (g : Category.Hom Y Z) (f : Category.Hom X Y) : self.map (g ⊚ f) = self.map g ⊚ self.map f
T(g ∘ f) = T(g) ∘ T(f).
Instances For
Definition 6.4 (Scott 1981, PRG-19). A T-algebra: a domain carrier
together with a
structure map str : T(carrier) → carrier.
- carrier : Obj
The underlying object
E. - str : Category.Hom (T.obj self.carrier) self.carrier
The structure map
k : T(E) → E.
Instances For
Definition 6.4 (Scott 1981, PRG-19). A homomorphism of T-algebras
(E,k) → (F,m): a map
hom : E → F making the square commute, i.e. hom ∘ k = m ∘ T(hom).
- hom : Category.Hom A.carrier B.carrier
The underlying morphism
h : E → F. The homomorphism square
h ∘ k = m ∘ T(h).
Instances For
The identity is a homomorphism: I ∘ k = k ∘ T(I).
Equations
- Domain.Neighborhood.AlgHom.id A = { hom := Domain.Neighborhood.Category.id A.carrier, comm := ⋯ }
Instances For
Composition of T-algebra homomorphisms (the T-algebras and homomorphisms
form a category —
the remark after Definition 6.4).
Instances For
Definition 6.5 (Scott 1981, PRG-19). A T-algebra A is initial iff
there is a (unique)
homomorphism from A into every T-algebra. We package the homomorphism as the
data desc and its
uniqueness as uniq.
Instances For
An isomorphism in the category: a pair of mutually inverse morphisms.
- hom : Category.Hom X Y
The forward morphism.
- inv : Category.Hom Y X
The inverse morphism.