definition example

The walking arrow (DaoFP; 7 Sketches writes ) is the Free Category on the graph : two objects and three morphisms . A Functor picks out a morphism of (DaoFP Exercise 8.2.1); a functor is a Function (7 Sketches §3.3.1: the schema of a function is “a labeled version of ”, two tables — e.g. Beatles and Instruments).

Sources: 7 Sketches Eq. (3.8), Example 3.36, Exercises 3.37, 3.40, 3.90; DaoFP §8.1–8.2, §9.4 (“picking objects”), §20.1 (the monoidal walking arrow = ); CTfS Exercise 4.1.2.28 (the free arrow category ), Example 4.3.1.4, Exercise 4.3.2.10

  • Functors : six of them, determined by where the two objects go, since is a preorder (Example 3.36, 7S Exercise 3.37). Functors into are not determined by objects (7S Exercise 3.40).
  • The walking iso adds an arrow back; functors out of it pick isomorphisms (DaoFP Exercise 8.2.2). The discrete (two objects, no arrow) indexes products/coproducts and (DaoFP §10.2).
  • (7S Exercise 3.90); the Limit of a diagram of shape is its first object (DaoFP Exercise 9.5.1).
  • CTfS’s (Exercise 4.1.2.28, Example 4.3.1.4): , , , . A functor is a morphism of , a natural transformation between two such is a commutative square, so is the arrow category of ; and a natural transformation is a functor .
  • As a Preorder it is the Booleans ; enriching over it (monoidally) gives preorders.

Docs: ACSets API · Theories & presentations

using Catlab
@present WalkingArrow(FreeSchema) begin
  (v1, v2)::Ob
  f1::Hom(v1, v2)
end
# a functor 2 → Set is a FinFunction; as an ACSet on this schema:
@acset_type Fn(WalkingArrow)
F = @acset Fn begin v1 = 3; v2 = 2; f1 = [1, 2, 2] end   # the function 3 → 2 as a Fn-instance
-- Mathlib: the walking arrow is `Fin 2` as a preorder category, or `WalkingPair` (discrete) for products
#check CategoryTheory.Limits.WalkingPair        -- discrete two objects
#check CategoryTheory.ComposableArrows          -- ComposableArrows C n : functors from Fin (n+1)
example : CategoryTheory.Category (Fin 2) := inferInstance
-- a functor out of the walking arrow is a single arrow: a value of type (a -> b) with its endpoints
data Arrow' = Arrow' { src' :: String, tgt' :: String }   -- purely syntactic