lin-0019

0.4 Functors: compositional translations

Definition 0.7 Functor

A functor \(F:\mathcal C\to \mathcal D\) assigns an object \(F(X)\) of \(\mathcal D\) to every object \(X\) of \(\mathcal C\), and a morphism \(F(f):F(X)\to F(Y)\) to every morphism \(f:X\to Y\), such that

\[ F(1_X)=1_{F(X)}, \qquad F(g\circ f)=F(g)\circ F(f). \]

The second equation is the important one: a functor preserves composition. It is therefore the natural mathematical form of a translation that respects how a system is assembled.

Three uses recur in this book.

Realization.

A functor \(D:J\to \mathcal C\) realizes a formal computational shape \(J\) as actual spaces and maps. In a neural realization, objects may be representation spaces and arrows may be differentiable modules. In RADAR, the shape can be a relational schema and the realization can assign local geometric charts.

Change of representation.

A functor can translate a structured system into a different category without forgetting composition. A database instance is commonly treated as a functor from a schema category to \(\mathsf{Set}\) [ Spivak , 2012 ] . The schema says which relational paths exist; the functor supplies their tables, keys, and realized functions.

Differentiation.

The tangent construction is a functor

\[ T:\mathsf{Smooth}\longrightarrow \mathsf{Smooth} \]

that sends a manifold \(X\) to its tangent bundle \(TX\) and a smooth map \(f\) to its derivative-level map \(Tf\). Functoriality is the chain rule:

\[ T(g\circ f)=Tg\circ Tf. \]

This is why a declared compositional route can be lifted as a route rather than differentiated as an untyped scalar expression.

Design principle

Whenever the book writes \(D:J\to \mathcal C\), read it in two passes. First read \(J\) as the declaration of available routes. Then read \(D\) as the candidate implementation of those routes. The distinction between shape and realization is essential to LINCS.