Skip to content

Object-first model specification (perches + morphisms, before analysis)

be-ddsl #t-core #category-theory #perches #stages #semantics #markov-kernels #kleisli #giry-monad #operator-theory

This note records a “structure-first” way to describe an economic model in BE-DDSL:

  • First specify a well-typed wiring diagram of perch state objects and morphisms (timing, information, variable flow).
  • Only later choose an analytic semantics (kernels/maps, operator theory on \(L^p\)/Hilbert spaces, Bellman/Euler schemes, contraction/stability assumptions).

The goal is to make “model well-formedness” a typing problem (interfaces match) rather than an analytic problem.

The basic separation (paper claim)

Define a syntactic “perch wiring” category \(\mathcal C_{\text{perch}}\):

  • Objects: perch state-bundles \(X_p\) (records/products of variables available at perch \(p\)).
  • Generating morphisms: declared arrows between perches (within a stage and across stages/periods), plus explicit adapters:
  • arrival \(\to\) decision, decision \(\to\) continuation,
  • connectors/twisters as explicit field renamings/interface identifications,
  • (optional) feasibility/constraint morphisms, reward morphisms, etc.
  • Composition: path composition in the free category (or free symmetric monoidal category if we include parallel wiring/products).

At this layer there is no topology, measure theory, Hilbert space, contraction property, or solver choice.

Then choose a meaning map \(Υ\) (a semantics):

\[ \mathcal C_{\text{perch}} \xrightarrow{\;\;Υ\;\;} \mathcal D \xrightarrow{\;\;\text{operator semantics}\;\;} \text{(Bellman/Euler/forward–backward operators)}. \]

Typical semantic targets \(\mathcal D\):

  • Deterministic: \(\mathbf{Set}\) (measurable functions if you want measurability).
  • Stochastic: a Markov category / a Kleisli category (Giry/distribution monad), where morphisms are kernels.

“Perch = state object” (how to say it safely)

A perch is an information-interface label \(p\in\{\prec,0,\succ\}\). In T core we represent it by a state object \(X_p\).

Doc-safe phrasing:

A perch is an information-set label; we write \(X_p\) for the state object (bundle of variables) available at that perch. When unambiguous, we identify the perch with \(X_p\) by abuse of notation.

This is consistent with the “perches as information interfaces” view.

See also: Perches as information interfaces.

Category-theory details that clarify the construction

Posets as categories; monotone operators as functors

If \((X,\le)\) is a poset, it is a thin category \(\mathbf X\). A monotone map \(T:X\to Y\) is exactly a functor \(T:\mathbf X\to \mathbf Y\).

This is useful because it distinguishes:

  • the functor \(T\) (an arrow of categories), from
  • the graph/relational encoding\(x\to y\) iff \(y=T(x)\)”.

Graph of an operator as span / comma construction

For \(T:X\to Y\):

  • Graph as span/relation: \(\mathrm{Graph}(T)\subseteq X\times Y\), yielding a span \(X \leftarrow \mathrm{Graph}(T) \rightarrow Y\) (or a relation/profunctor).
  • Comma/category-of-elements style: package constraints like \(y\le T(x)\) as objects \((x,y)\) of a thin category; the strict graph corresponds to objects \((x,T(x))\).

These are canonical ways to talk about “element-level arrows” while keeping the functorial reading of \(T\) separate.

Stochastic arrows: kernels, Kleisli composition, and layering operators

For random variables \(X\to Y\to Z\), the natural semantic morphisms are conditional kernels:

  • \(K_{Y\mid X}: X \rightsquigarrow Y\),
  • \(K_{Z\mid Y}: Y \rightsquigarrow Z\),

with Kleisli (Chapman–Kolmogorov) composition:

\[ (K_{Z\mid Y}\circ K_{Y\mid X})(\cdot\mid x) = \int_Y K_{Z\mid Y}(\cdot\mid y)\,K_{Y\mid X}(dy\mid x). \]

Only after this semantic layer do we “layer on operator theory”:

  • Backward mover / pullback on functions (conditional expectation): [ K^: \mathcal F(Y)\to \mathcal F(X),\quad (K^f)(x)=\mathbb E[f(Y)\mid X=x], ]
  • Forward mover / pushforward on measures: [ K_+: \mathrm{Dist}(X)\to \mathrm{Dist}(Y). ]

This is the precise sense in which BE-DDSL is “objects/morphisms first, operators later”.

Related: Free variables vs function evaluation inside a stage.

Why this is “less complex” (formal story options)

This note motivates the object-first layer; for the formal complexity story (and what not to overclaim), see:

In short: if the model is a composition of typed modules along explicit interfaces, description/verification complexity admits additive “sum of parts + glue” bounds (pushouts/institutions/decorated cospans), and compositional diagrams are generally far more succinct than fully expanded global operators/tables.