Cohesive Systems logoCOHESIVE SYSTEMS

Systems Sheaf Semantics

Systems Sheaf Semantics uses sheaf-theoretic local-to-global structure to model how observations, state, versions, histories, process state, and knowledge vary over contexts such as observers, boundaries, and causally valid cuts of execution.

The goal is to give precise language for a recurring systems question:

  • What can be observed locally?
  • How does a richer context restrict to a smaller context?
  • When do partial views agree on their overlaps?
  • When do compatible views assemble into a coherent larger explanation?
  • When is there no global explanation, or more than one possible explanation?

In this sense, sheaf semantics is a modeling discipline for consistency, projection, reconstitution, observer-relative interpretation, and synchronization under asynchrony.

Cuts as Contexts

For a distributed execution, let the event structure be a partially ordered set:

E=(events,)E = (\operatorname{events}, \leq)

where

e1e2e_1 \leq e_2

means that event e1e_1 happened before event e2e_2.

A consistent cut is a downward-closed subset:

CEC \subseteq E

such that:

eCeeeCe \in C \wedge e' \leq e \Rightarrow e' \in C

The set of consistent cuts forms a lattice:

C(E)\mathcal{C}(E)

ordered by inclusion. Meets are intersections and joins are unions:

C1C2=C1C2C_1 \wedge C_2 = C_1 \cap C_2 C1C2=C1C2C_1 \vee C_2 = C_1 \cup C_2

This lattice can serve as a base of contexts. A cut is thus a causally coherent snapshot of an execution.

Presheaves over Cuts

A systems presheaf over cuts assigns semantic data to each consistent cut:

F:C(E)opSet\mathcal{F} : \mathcal{C}(E)^{op} \to \mathbf{Set}

For each cut CEC\subseteq E, the set F(C)\mathcal{F}(C) contains the sections applicable at that cut. For a Set-valued sheaf, a section (examples below) over a context is an element of the set assigned to that context:

sF(C)s \in \mathcal{F}(C)

In bundle or fibration language, a section can be pictured as a compatible choice of data lying over that part of the base. In a systems sheaf, a section is a coherent semantic assignment of data over the chosen cut.

A familiar mathematical example is the sheaf of continuous real-valued functions on a topological space XX:

C0(U)={f:URf is continuous}\mathcal{C}^0(U) = \{ f : U \to \mathbb{R} \mid f \text{ is continuous} \}

for each open set UXU \subseteq X. A section over UU is a continuous function defined on UU. If VUV \subseteq U, restriction sends the function to its ordinary restriction:

ρU,V(f)=fV\rho_{U,V}(f) = f|_V

Compatible continuous functions on overlapping open sets glue to a continuous function on their union when they agree on the overlaps.

For systems, a section is not necessarily a numerical function. It is a coherent assignment of state, observation, evidence, knowledge, or control information over a context. Let UEU \subseteq E be a particular consistent cut, understood as an object of C(E)\mathcal{C}(E). Depending on the semantic layer, a section might be:

  • An entity state observation. A section sFstate(U)s \in \mathcal{F}_{state}(U) assigns to each relevant entity the state reconstructed based on the events in UU.
  • A set of current version identifiers. A section sFversion(U)s \in \mathcal{F}_{version}(U) assigns to each relevant subject the version, offset, causal head, or history position visible at UU.
  • A workflow or process state. A section sFprocess(U)s \in \mathcal{F}_{process}(U) assigns each relevant process instance its phase, pending signals, emitted effects, and completion status at UU.
  • A projection state. A section sFprojection(U)s \in \mathcal{F}_{projection}(U) gives the derived read model or materialized view obtained by applying the projection rules to the events or observations in UU.
  • A set of observed evidence. A section sFevidence(U)s \in \mathcal{F}_{evidence}(U) contains the evidence records admitted by the events, observers, or sources present in UU.
  • A logical-clock assignment. A section sFclock(U)s \in \mathcal{F}_{clock}(U) assigns clock values to events or observers in UU while respecting the happened-before order restricted to UU.
  • The commands or transitions enabled at that cut. A section sFenabled(U)s \in \mathcal{F}_{enabled}(U) identifies which commands or transitions are enabled by the state and observations determined at UU.
  • The knowledge available to an observer at that cut. A section sFknowledgeO(U)s \in \mathcal{F}^{O}_{knowledge}(U) records what observer OO can know from its projection of UU.

The opposite category accounts for restriction. If

C1C2C_1 \subseteq C_2

then the presheaf supplies a restriction map:

ρC2,C1:F(C2)F(C1)\rho_{C_2,C_1} : \mathcal{F}(C_2) \to \mathcal{F}(C_1)

Restriction forgets, hides, projects, or reconstitutes a larger context as a smaller one. It is a semantic operation, not a physical rollback. It requires enough history, lineage, evidence, or version metadata for the earlier view to be meaningful.

Compatibility and Descent

A useful coverage on the cut lattice says that a family of cuts covers UU when their join is UU:

U=iCiU = \bigcup_i C_i

For two cuts, the base diagram is:

C1C2C1C2C1C2\begin{array}{ccc} C_1 \cap C_2 & \longrightarrow & C_1 \\ \downarrow & & \downarrow \\ C_2 & \longrightarrow & C_1 \cup C_2 \end{array}

Applying the presheaf reverses the arrows:

F(C1C2)ρC1C2,C1F(C1)F(C2)ρC2,C1C2F(C1C2)\begin{array}{ccc} \mathcal{F}(C_1 \cup C_2) & \xrightarrow{\rho_{C_1 \cup C_2,C_1}} & \mathcal{F}(C_1) \\ \downarrow & & \downarrow \\ \mathcal{F}(C_2) & \xrightarrow{\rho_{C_2,C_1 \cap C_2}} & \mathcal{F}(C_1 \cap C_2) \end{array}

The vertical arrows are ρC1C2,C2\rho_{C_1 \cup C_2,C_2} and ρC1,C1C2\rho_{C_1,C_1 \cap C_2}.

Sections

s1F(C1)s_1 \in \mathcal{F}(C_1)

and

s2F(C2)s_2 \in \mathcal{F}(C_2)

are compatible when they agree on the overlap:

ρC1,C1C2(s1)=ρC2,C1C2(s2)\rho_{C_1,C_1 \cap C_2}(s_1) = \rho_{C_2,C_1 \cap C_2}(s_2)

A sheaf is a presheaf where compatible local sections glue uniquely. That is, there exists a unique section

sF(C1C2)s \in \mathcal{F}(C_1 \cup C_2)

such that:

ρC1C2,C1(s)=s1\rho_{C_1 \cup C_2,C_1}(s) = s_1

and

ρC1C2,C2(s)=s2\rho_{C_1 \cup C_2,C_2}(s) = s_2

The compatible local sections together with their agreement data are descent data. Descent is the passage from that cover-level data to a section over the covered context. In systems terms: independently evolved local histories can be assembled into a larger coherent history when their overlapping parts agree.

Descent is therefore close to gluing, but the emphasis is slightly different. Gluing names the assembly of compatible local sections. Descent names the principle that compatible local data over a cover is enough to determine, reconstruct, or recognize the corresponding global section.

Synchrony as Descent

Asynchrony preserves multiplicity: participants can advance through incomparable cuts. A system therefore accumulates local sections that need not share a total order.

Synchronization can be understood as a descent operation: a boundary, protocol, transaction, barrier, consensus decision, or workflow step requires local sections to become compatible and records or selects the glued section.

This makes a useful distinction:

  • No gluing means the local observations are incompatible.
  • More than one gluing means the local observations are ambiguous or indeterminate.
  • Unique gluing means the local observations determine one coherent larger section.

Atomic commits, workflow barriers, replicated-object decisions, projection checkpoints, and coordinated state transitions can all be read as different ways of enforcing or recording compatibility across local sections.

Observer-Indexed Semantics

Cuts alone are not enough for Cohesive, because meaning is observer-relative. Each observer has its own semantic fiber: events it can observe, commands it can interpret, state it can see, policies it can apply, and versions it can distinguish.

A fibered presentation writes:

π:SemObs\pi : \mathsf{Sem} \to \mathsf{Obs}

where Obs\mathsf{Obs} is a category of observers and Sem\mathsf{Sem} is a total category of observer-relative semantic objects. An object of Sem\mathsf{Sem} has the form:

(O,x)(O,x)

where OO is an observer and xx is meaningful over that observer.

A semantic translation between observers has the shape:

(O,x)(O,y)OuO\begin{array}{ccc} (O,x) & \longrightarrow & (O',y) \\ \downarrow & & \downarrow \\ O & \xrightarrow{u} & O' \end{array}

The vertical arrows are applications of π\pi. This says that the semantic relation lies over an observer relation. One observer's endogenous event becoming another observer's exogenous event is not equality of event objects. It is a structured translation between fibers.

The base can combine observers and cuts:

Ctx={(O,C)OObs, CCO(E)}\mathsf{Ctx} = \{(O,C) \mid O \in \mathsf{Obs},\ C \in \mathcal{C}_O(E)\}

A systems sheaf can then be modeled as:

F:CtxopSet\mathcal{F} : \mathsf{Ctx}^{op} \to \mathbf{Set}

where F(O,C)\mathcal{F}(O,C) contains sections describing what observer OO can observe, know, command, reconstruct, or distinguish at cut CC.

Cohesive Interpretation

Systems Sheaf Semantics gives the Cohesive model a compact way to relate several existing concepts:

Cohesive conceptSheaf-theoretic interpretation
Event partial orderBase execution order
Consistent cutContext in the base
Observation, state, or history at a cutSection
Projection to an earlier or smaller contextRestriction
Shared causality or common viewOverlap
Agreement of observers or projectionsCompatibility
Snapshot reconstructionRestriction plus descent
SynchronizationCompatibility enforced at a boundary
Coordinated state transitionSelected glued section
InconsistencyNo compatible global section
AmbiguityMore than one compatible global section

The practical value is diagnostic. When a system claims one coherent state, query result, projection, workflow status, or explanation, the model should ask:

  • What base of contexts is being used?
  • What is a section over each context?
  • What information is preserved by restriction?
  • What counts as overlap?
  • What compatibility condition is required?
  • Does a glued section exist, and is it unique?
  • Which observer or boundary is allowed to assert the global section?

Not every useful systems structure is literally a sheaf. Some structures are only presheaves. Some have partial gluing. Some glue only up to equivalence. Some require extra operational mechanisms before compatibility can be checked. The failure to satisfy the sheaf condition is itself meaningful: it identifies where lineage, authority, evidence, ordering, or coordination is missing.

Related concepts: sheaves and gluing, categorical principles, fibrations and indexed structure, universal constructions, functoriality, naturality, consistency models, version histories, synchrony and asynchrony, observer, observation, state, version, event, command, projections, reconstitution, coordination, consensus, boundaries.