Matthew Alford's ATCH Model Proves Every Major Database Silently Loses Data
A new proof shows any knowledge system needs four specific capabilities together, or it loses information forever, with a working PostgreSQL prototype.
ProTakeaways
- Proves four capabilities (n-ary relations, temporal validity, uncertainty, causal links) are mutually entailing for complete knowledge representation
- Introduces Attributed Temporal Causal Hypergraph (ATCH) framework satisfying all four pillars simultaneously
- Establishes strict expressiveness hierarchy: SQL is strictly weaker than LPG, weaker than TypeDB, weaker than ATCH
- Ships PostgreSQL extension in C plus Lean 4 machine-checked proofs
- Yields Frame Problem, conflict resolution, and common sense reasoning as direct corollaries, not add-ons
- General queries are NP-complete, but acyclic and bounded-depth practical queries run in polynomial time
Databases are supposed to store what we know about the world, yet every mainstream data model quietly drops information the moment you try to record something interesting. A new paper called The Equivalence Theorem: First-Class Relationships for Structurally Complete Database Systems argues this is not a set of independent shortcomings you can patch one by one. It is a single missing property, and there is a mathematically forced answer to what a complete system must look like.
The author, Matthew Alford, proves that structurally complete knowledge representation requires exactly four mutually entailing capabilities: n-ary relationships with attributes, temporal validity, uncertainty quantification, and causal relationships between relationships. Any system implementing one capability necessarily requires all four; any system missing one cannot achieve structural completeness. The constructive part of the paper builds a data model called the Attributed Temporal Causal Hypergraph (ATCH) that satisfies all four, and ships a PostgreSQL extension in C that runs it.
The knowledge every database silently mangles
The motivating example is deliberately mundane: after an overnight Windows update on a domain controller, half the accounting team could not print Monday morning, because the update reset a group policy that conflicted with a print driver pushed three weeks earlier to fix a different issue. Try to encode that sentence in any standard database and something breaks.
SQL cannot express that one relationship caused another because a causes table cannot have foreign keys to multiple tables, forcing polymorphic references that abandon type safety. Neo4j and every other labeled property graph is stuck with binary edges, so a 4-way prescription (doctor, drug, patient, dose) must be reified as a fake node that has no arity constraint and cannot enforce roles. RDF triples need blank-node workarounds for anything with more than two participants. TypeDB gets closest with native n-ary relations but treats time and confidence as ordinary attributes with no propagation semantics, so it cannot answer "what was true at time t with confidence above 0.8?" without application logic.
Four pillars that entail each other
The paper's central claim is that these four capabilities are not a wishlist. They collapse into one property: relationships being first-class objects that can be stored with a persistent identifier, retrieved by identifier alone, queried as the subject of predicates, composed into other relationships, and returned as first-class results.
The proof works by showing that each pillar individually forces the others through property attachment. Take temporal validity: if you want to ask when a relationship was true, the relationship needs persistent identity, otherwise the time interval has nowhere clean to attach. Once it has identity, it can carry attributes (P1), confidence (P3), and participate in causal links (P4). The same forcing works from any starting pillar. The Lean 4 formalization mechanically checks all five equivalence lemmas.
The ATCH data model in one page
An ATCH is a hypergraph where edges can contain other edges, everything carries attributes, and edges have temporal bounds, confidence scores, and a causal partial order. In the PostgreSQL prototype this maps to two tables:
CREATE TABLE hyperedge (
id UUID PRIMARY KEY,
nodes TEXT[] NOT NULL, -- P1: N-ary via arrays
attributes JSONB, -- P1: Flexible attributes
valid_time TSTZRANGE NOT NULL,-- P2: Temporal validity
confidence FLOAT -- P3: Uncertainty
CHECK (confidence >= 0 AND confidence <= 1)
);
CREATE TABLE causal_link ( -- P4: Relationships between
cause_id UUID REFERENCES hyperedge(id), -- relationships
effect_id UUID REFERENCES hyperedge(id),
mechanism TEXT
);
The Windows update scenario now becomes three hyperedges linked by causal arrows, and root-cause analysis is a single function call that traverses the causal chain automatically, surfacing the three-week-old driver change that no text search or ticket query would connect to Monday's outage.
What you get once the pillars are in place
The interesting consequences fall out as corollaries rather than separate machinery.
- The Frame Problem dissolves. Because every relationship has a valid time interval defaulting to infinity, unchanged facts persist automatically. No frame axioms, no successor state axioms. Only relationships in the causal closure of an event can be affected by it.
- Contradictions become data, not bugs. If two relationships assert A and not-A with non-zero confidence, both are stored. The apparent contradiction is resolved by making the hidden context explicit as an N-ary attribute of the respective relationships.
- Hidden variables can be discovered automatically. The system computes information gain across all JSONB attributes to find which one best partitions the contradictory clusters, in a single O(N times m) pass over N observations with m attributes.
- Common sense exceptions have exactly four shapes. The Qualification Completeness Theorem proves every exception to a default rule modifies participants (P1), temporal scope (P2), confidence (P3), or causal context via inhibitor links (P4). Nothing else is possible.
The expressiveness ladder
The theorem produces a strict hierarchy with witness queries that cannot be expressed at lower levels without structural distortion:
| System | N-ary | Temporal | Uncertainty | Causal | Complete |
|---|---|---|---|---|---|
| SQL | No | Workaround | No | No | No |
| LPG (Neo4j) | No | Workaround | No | No | No |
| RDF/OWL | Workaround | No | No | Workaround | No |
| TypeDB | Yes | No | No | Workaround | No |
| ATCH | Yes | Yes | Yes | Yes | Yes |
The information-theoretic analysis quantifies exactly what you pay for using a lower-tier system. Projecting a hypergraph with average arity n to binary edges loses at least |E| * C(n, 2) bits per edge, because the receiver cannot tell whether a clique of binary edges came from one n-ary relationship or many independent binary ones.
Complexity: NP-complete in general, polynomial in practice
General hypergraph pattern matching is NP-complete, unbounded causal chain queries are PSPACE-complete, and optimal consolidation is NP-hard. But the tractable fragment covers most real workloads: alpha-acyclic hyperedge patterns, fixed-depth causal chains, bounded temporal windows, and confidence thresholds all run in polynomial time using standard Yannakakis-style join-tree evaluation.
The paper adds a nice trick called confidence-driven depth termination. Because joint confidence degrades multiplicatively along causal chains, traversal can stop dynamically when accumulated confidence drops below a relevance threshold, bounding effective depth to ceil(log(theta) / log(kappa_min)) rather than requiring a user-specified limit.
Why this matters beyond databases
The most immediate implication is for retrieval-augmented generation. Current RAG pipelines retrieve documents by semantic similarity, then feed text chunks to language models for reasoning. This architecture inherits the limitations of the underlying storage: documents are unstructured text, and similarity search cannot recover relational structure. Recent work like HyperGraphRAG already shows hypergraph-structured retrieval outperforming binary graphs, and ATCH gives that direction a formal target.
Neuro-symbolic AI faces the same problem in reverse: if the symbolic layer beneath a neural model uses binary knowledge graphs, it drops information at every boundary regardless of how good the neural component is. Persistent AI memory across conversations, explainability as causal-chain queries rather than post-hoc attention analysis, and privacy-preserving federated knowledge (where structural patterns can be shared without instance data) all inherit the same requirements.
Honest limitations
The framework is representationally complete, not inferentially complete. Domain-specific reasoning like probabilistic inference or spatial computation still needs extra machinery on top. Complex joint probability distributions can be stored as attributes but do not propagate natively, so integration with Bayesian engines is complementary rather than automatic. And migrating an existing database is a nontrivial engineering exercise that the theory does not address.
The paper is best read as a floor rather than a ceiling: it says what any system that accumulates uncertain beliefs about a changing world must contain, whether that system is a database, an AI agent, or a sensor network. Below the four-pillar threshold, information loss compounds with every operation. Above it, the losses stop.