A schema is a Graph together with a congruence of path equivalence declarations (PEDs) — a Presentation of a Category. Category Theory for Scientists defines a schema morphism as a Graph Homomorphism that sends equivalent paths to equivalent paths:
Slogan (CTfS 4.4.1.3). Vertices go to vertices, arrows go to paths, and path equivalences go to path equivalences.
Schemas and schema morphisms form a category (composition is the composition in the Kleisli Category of the Monad on , CTfS Remark 5.3.2.7), and
Theorem (CTfS 4.4.2.3). The functors and form an Equivalence of Categories .
Sources: CTfS §4.4 (Exercise 4.4.1.1, Definition 4.4.1.2, Slogan 4.4.1.3, Examples 4.4.1.4, Exercises 4.4.1.5–4.4.1.7, Constructions 4.4.2.1–4.4.2.2, Theorem 4.4.2.3), Slogan 4.2.2.1, Remark 5.3.2.7; 7 Sketches §3.2.2 (presenting categories via graphs and equations).
The two functors
- (the category presented, CTfS Construction 4.4.2.1): objects are the vertices, morphisms are paths modulo the PEDs, composition is concatenation. This is the Free Category on the graph, quotiented.
- (the tautological presentation, CTfS Construction 4.4.2.2): the graph has a vertex per object and an arrow per morphism of , and a path is declared equivalent to the single arrow that is its composite.
, but is a much bigger schema than — it merely presents the same category. So the equivalence is not an isomorphism: the natural transformation is an isomorphism in (schema morphisms go both ways, since each arrow of can be sent to a path in ), not an equality of graphs. Two schemas are isomorphic in iff they present isomorphic categories; this is why a schema is a good finite handle on a possibly infinite category, and why one can “think of categories and schemas as the same” (CTfS Slogan 4.2.2.1).
Examples
- An infinite category from a tiny schema. The schema with one vertex , one arrow and no PEDs presents : the paths are (CTfS Exercise 4.2.2.2). A schema morphism sends both arrows of to paths, for example , (CTfS Exercise 4.4.1.1).
- A commutative triangle (CTfS Example 4.4.1.4): the linear order presented by is isomorphic in to the schema with arrows , , and PED — send to the path , and back send , .
- Counting (CTfS Exercise 4.4.1.5): if has no PED, schema morphisms with number 8 (choose where and go and a path for each arrow; the two paths and from to are now different), and morphisms with number 6 (the target is thin, so a morphism is just a choice of , with : ).
- Idempotent-ish loops (CTfS Exercises 4.4.1.6–4.4.1.7): is with the PED — the cyclic monoid of Presentation of a Monoid with elements. (there ) while has the two morphisms with . A morphism sends and must respect the PED, which in forces or ; so () and (). CTfS’s hint checks out: and .
Why it matters
Functors out of are determined by where the generating arrows go, subject to the PEDs — this is how instances (C-Sets), functors between presented categories and data migration are specified in practice, in CTfS and in Catlab’s @present/FinFunctor. The same “presentation vs. presented thing” split occurs for monoids, props and preorders.
Docs: FinCats · Theories & presentations
using Catlab
# A schema is a presentation; the category it presents may be infinite (Loop ↦ ℕ)
@present SchFather(FreeSchema) begin
(F, C)::Ob
c::Hom(F, C) # "a father has as first child a child"
f::Hom(C, F) # "a child has as father a father"
c ⋅ f == id(F) # the father's first child's father is the father (CTfS Exercise 3.5.2.18)
end
FC = FinCat(SchFather)
ob_generators(FC), hom_generators(FC) # the graph of the schema: 2 vertices, 2 arrows
# Schema morphisms L_m → L_n are f ↦ fᵏ respecting f^(m+1) = f^m (CTfS Exercise 4.4.1.7)
normal(a, n) = min(a, n) # in L_n, fᵃ = fᵇ iff min(a,n) = min(b,n)
homs(m, n) = [k for k in 0:n if normal(k * (m + 1), n) == normal(k * m, n)]
homs(3, 5), homs(5, 3), length(homs(4, 9)) # ([0, 2, 3, 4, 5], [0, 1, 2, 3], 8)import Mathlib
open CategoryTheory
-- the free category on a quiver (paths) and quotients by a relation on morphisms:
#check @Paths -- the path category of a quiver
#check @Quotient.functor -- C ⥤ Quotient r: impose path equations (PEDs)
#check @Quiver.Path -- paths in a graph
-- "arrows go to paths": a prefunctor V ⥤q Paths W extends to a functor Paths V ⥤ Paths W
#check @Paths.lift-- the schema L_n: one object, one arrow f with f^(n+1) = f^n;
-- morphisms are exponents, normalised by min · n
normal :: Int -> Int -> Int
normal n a = min a n
-- schema morphisms L_m → L_n: f ↦ f^k preserving the PED
homs :: Int -> Int -> [Int]
homs m n = [ k | k <- [0..n], normal n (k * (m + 1)) == normal n (k * m) ]
-- homs 3 5 == [0,2,3,4,5]; homs 5 3 == [0,1,2,3]; length (homs 4 9) == 8