← Lambdacus

Lambdacus: The Framework

The foundations of categorified security.

Abstract

An enterprise data platform takes raw data, gives it meaning, lets people act on that meaning, and captures those actions back into the data. We decompose the skeleton of this machine into six categorical components connected by functors. The skeleton determines what the system can do; the data poured into it determines what it actually does. Security is a Grothendieck topology; lineage, a free category on the pipeline DAG; actions, algebras for an edit monad. Three adjunctions tie the whole thing together.

1. The Schema: OntSch

Definition 1.1: Ontology Schema Category

A small category OntSch where:

Ob(OntSch) = entity types {O₁, O₂, …, On} such as Person, Company, Product, Transaction.

Mor(OntSch) = relationship types L : OiOj, each annotated with cardinality card(L) ∈ {1:1, 1:n, n:1, m:n}.

Each object carries a property schema via a functor S : OntSchSch, where Sch is the category of finite products of primitive types.

No data here, just the declaration of what kinds of things can exist and how they relate. A finite directed multigraph with type annotations.

Remark : What It Generates

Read more: The Schema

2. The Presheaf: Φ

Definition 2.1: Ontology Instance

A presheaf on the schema category:

Φ : OntSchopSet

On objects: for each entity type O, the set Φ(O) is the collection of all actual instances of that type.

On morphisms: for each link type L : OiOj, the map Φ(L) : Φ(Oj) → Φ(Oi) sends each target instance to the set of source instances linked to it. Functoriality makes multi-hop traversals compose correctly.

Your data, morphed into the skeleton: rows become set elements, foreign keys become linking functions, and one presheaf is one snapshot of the world as seen through the schema.

Proposition 2.2: Semantic Functor

Sem : Data → [OntSchop, Set] pours raw data into the skeleton: rows become objects, columns become properties, foreign keys become link functions. Functoriality keeps things consistent when upstream data changes.

Corollary: Free Query Algebra

Because Φ lives in a presheaf category, every query, filter, join, and aggregation is already well-defined. The query algebra is derived from the structure, not designed by hand.

Read more: The Presheaf

3. The Presheaf Category: Ont

Definition 3.1: The Functor Category

Ont = [OntSchop, Set]. Objects are all presheaves on OntSch (all possible data states). Morphisms are natural transformations (consistent transitions between states).

Theorem 3.2: Topos Structure

Ont is an elementary topos, giving:

  1. All finite limits and colimits. Intersections, unions, fiber products of object sets exist. Pullback along a link yields all instances linked to a given set.
  2. Subobject classifier Ω. Every predicate factors as a characteristic morphism χP : Φ(O) → Ω. Every filter is expressible and composable.
  3. Exponentials. Function spaces between object sets are first-class. Server-side functions on objects live in these exponentials.
Remark : What It Generates

Read more: The Presheaf Category

4. The Edit Monad: 𝕋

Definition 4.1 : The Edit Monad

A monad 𝕋 = (T, η, μ) on Ont. The endofunctor T maps each presheaf Φ to the coproduct of all presheaves reachable by a finite sequence of primitive edits:

T(Φ) = ∐eEdit* e(Φ)

where Edit = {CreateObject, UpdateProperty, DeleteObject, AddLink, RemoveLink}. Unit η is the empty edit; multiplication μ flattens nested edit plans.

Theorem 4.2 : Kleisli Category of Decisions

The Kleisli category Ont𝕋 has ontology instances as objects and composable action sequences as morphisms. An action type is a Kleisli morphism A : PT(Φ) where P is the parameter space. Every operational workflow is a composed morphism in Ont𝕋.

Proposition 4.3 : Writeback Adjunction

SemWB : OntData. The semantic functor and writeback functor form an adjunction closing the feedback loop: data → ontology → decisions → writeback → data. The unit and counit witness that no information is lost in the round trip.

Read more: The Edit Monad

5. The Grothendieck Topology: J

Definition 5.1 : Access Control as Covering Sieves

A Grothendieck topology J on OntSch: for each object type O, the covering sieves J(O) are sets of "authorized access paths." A sheaf on (OntSch, J) is an ontology instance that respects access control. The secured state space is the sheaf topos:

Ontsec = Sh(OntSch, J)

Theorem 5.2 : Sheafification as Policy Enforcement

The sheafification adjunction ai : [OntSchop, Set] ⇄ Sh(OntSch, J) guarantees that security enforcement is:

  1. Compositional: security propagates through links by sieve closure.
  2. Idempotent: ai ≅ Id; re-securing a secured state is a no-op.
  3. Minimal: a strips exactly the unauthorized data, nothing more.

All concrete mechanisms (projects, organizations, roles, markings, row/column filters) are encoded as topological data and compose automatically. Every query passes through a.

Read more: The Grothendieck Topology

6. The Lineage Category: Lin

Definition 6.1 : Lineage as a Free Category

The free category on the dependency DAG:

Lin = Path(G)

where G = (V, E) has all platform resources as vertices and dependency relations as edges. Objects are resources; morphisms are dependency paths; composition is path concatenation.

Proposition 6.2 : Structural Acyclicity

HomLin(r, r) = {idr} for all r. Circular dependencies are structurally impossible. Impact analysis (downstream) and root cause (upstream) are computable in O(|V| + |E|). A topological sort of G gives valid build ordering.

Read more: The Lineage Category

7. Data Flow Between All Six

Ext C (connectors) Data Sem (indexing) Φ ∈ Ont
raw data morphed into the skeleton
Φ ∈ Ont Pres Applications (UI, SDK, analytics)
ontology state rendered for users
User decisions Kleisli morphisms in Ont𝕋 Φ′ ∈ Ont WB (writeback) Data / Ext
actions modify state, materializations absorb edits, writeback to source systems
Φ ∈ [OntSchop, Set] a (sheafification) a(Φ) ∈ Sh(OntSch, J)
every query passes through sheafification; users see only authorized data
Sys Lineage (forgetful) Lin = Path(G)
dependency graph tracking provenance of every resource

8. Principal Results

Theorem 8.1: Feedback Adjunction

SemWB : DataOnt. Index then write back: you recover the original data plus absorbed edits. Write back then re-index: you recover the ontology state. The adjunction is the coherence guarantee for the entire closed loop.

Theorem 8.2: Security Adjunction

ai : [OntSchop, Set] ⇄ Sh(OntSch, J). Sheafification enforces access control: compositional, idempotent, minimal. Every query passes through a.

Theorem 8.3: Lineage Adjunction

FreeU : GraphCat. Lin = Free(G). Any consistent labeling of resource dependencies factors uniquely through Lin. Acyclicity, impact analysis, and root cause analysis are structural consequences.


Summary

# Component Structure Role
Schema Small category OntSch Shape of the domain: what kinds of things and relationships exist
Presheaf Φ : OntSchopSet Current state, data morphed into the skeleton
Presheaf category [OntSchop, Set] (topos) State space, guarantees queries, filters, functions are well-defined
Edit monad 𝕋 = (T, η, μ) on Ont Composable transactional decisions; Kleisli category = workflows
Topology J on OntSch Security, propagated compositionally
Lineage Path(G), free on DAG Provenance, structural acyclicity
Joint Adjunction Governs
Feedback loop SemWB Data ↔ meaning. Coherence of the closed loop.
Security ai Full state ↔ visible state. Compositional enforcement.
Lineage FreeU Dependency graph ↔ free category. Structural acyclicity.

Define the schema; pour in the data. The skeleton generates the rest: queries, APIs, security propagation, action composition, provenance tracking. The category theory is the generator; the concrete system is a representation.