Mathematical Foundations
Appendix K
Appendix K: Mathematical Foundations
This appendix does not prove new theorems. It identifies exactly which theorems from model theory, sheaf theory, and type theory underpin the Third Mode's guarantees—and states what each guarantee does not promise.
The discipline is new. The mathematics is not.
The Borrowed Machinery
Every formal result invoked in The Proofs is a known theorem, often with proofs dating to the mid-twentieth century:
| Guarantee | Underlying Theorem | Canonical Source |
|---|---|---|
| Safe vocabulary extension | Conservative extension | Shoenfield, Mathematical Logic (1967), §4.6 |
| Local-to-global coherence | Sheaf gluing condition | Mac Lane & Moerdijk, Sheaves in Geometry and Logic (1992), Ch. II |
| Substitution under equivalence | Transport along paths | HoTT Book (2013), §2.3 |
| Verification cost scaling | Cover refinement | Standard; see Bott & Tu (1982) for analogous arguments |
The mathematical infrastructure exists. The engineering object does not.
What the Third Mode contributes is not a theorem but an architecture: a specification of exactly which verification steps must occur, exactly what artifacts must be emitted, and exactly how failures must be reported. Existing systems produce silence or exceptions where this architecture produces witnesses, receipts, and obstruction records.
What This Appendix Provides
For each load-bearing result, we state:
- The theorem — What the mathematics guarantees
- The operational consequence — What this means for system behavior
- The failure mode — What would constitute a violation
- The anchor — Where the main text invokes this machinery
For readers who want full proofs, the canonical sources are cited. For readers who want to understand how the proofs translate to system design, the operational consequences are the payload.
K.1 Conservative Extension Safety
Informal claim: Adding a new predicate to the vocabulary does not change the truth of existing statements.
Let be a theory (signature , constraints , logic ). Let be an extension adding predicate with constraints .
The extension is conservative over iff for every -sentence :
That is: the new predicate does not create new theorems in the old language.
Proof sketch (model-theoretic):
-
Let be a model of the original theory.
-
Extension: We must show extends to . Since is new (not in ), we can interpret as any subset of the appropriate product of domains that satisfies the new constraints . If such an interpretation exists, extends.
-
Conservativity: Suppose for a -sentence . By completeness (for the relevant logic), holds in all models of . In particular, it holds in all extensions of models of . Since is a -sentence, its truth depends only on the -reduct. Therefore holds in all models of . By completeness, .
-
The converse is immediate: if , then every model of is an extension of some model of , so holds.
Failure mode: The extension fails to be conservative if the new constraints entail -sentences not provable from alone. Example: adding with constraint where is an existing predicate creates a conservative extension. Adding with constraint and forces , which is non-conservative if was not previously provable.
Operational consequence: When the Third Mode accepts a new predicate (A17/A29), it must verify that the extension is conservative. If verification fails, the predicate is rejected with a counterexample: a model of that cannot extend to a model of while preserving existing truths.
Anchor: A17b (Conservative Extension). This theorem and its proof are developed in full in Chapter 16.
K.1.1 Verification Strategies
Conservative extension is a semantic property. In general, checking it is undecidable. In practice, we deploy a hierarchy of verification strategies, each with known tradeoffs.
Modes
| Mode | Completeness | Soundness | Artifacts | When to Use |
|---|---|---|---|---|
| Syntactic check | Incomplete | Sound | Parse tree | Fast gate: reject obviously non-conservative extensions (e.g., constraint mentions -predicates with universal quantifiers) |
| SAT/SMT | Complete for decidable fragments | Sound | Unsat core or countermodel | Default for propositional or linear arithmetic constraints |
| Model-theoretic sampling | Incomplete | Unsound (heuristic) | Candidate countermodels | Exploratory: find likely failures before expensive proofs |
| Proof assistant | Complete | Sound | Formal proof object | High-assurance: when the predicate will be load-bearing |
Artifacts
A verification attempt produces one of:
ConservativityProof: A formal proof object (possibly machine-checked) establishing the extension is conservative.Countermodel: A model and a -sentence such that but . This is a concrete witness of non-conservativity.UnsatCore: The minimal subset of that, together with , entails the problematic -sentence. Used for diagnosis and predicate revision.Timeout: The verification budget was exhausted. The system treats this as "unknown" and may escalate to a higher mode or reject the predicate pending manual review.
Complexity and Limits
For fragments commonly used in data integration:
| Fragment | Conservativity Check | Complexity |
|---|---|---|
| Propositional | Decidable | NP-complete (reduces to SAT) |
| Equality constraints | Decidable | Polynomial with union-find |
| Linear arithmetic (QF_LRA) | Decidable | Polynomial (linear programming) |
| Full first-order | Undecidable | Semi-decidable (may not terminate) |
| Higher-order / dependent types | Undecidable | Requires proof assistant |
The Coherence Budget Forces Approximation
Real systems operate under time and resource constraints. The coherence budget (A21) specifies how much verification effort is permitted per operation. When the budget is tight:
- Approximate gates replace exact checks. A syntactic check may clear a predicate that a full SAT check would reject.
- Deferred verification queues expensive checks for batch processing. The predicate is admitted provisionally (lifecycle state:
provisional) pending full verification. - Risk-tiered modes apply stronger verification to predicates with wider scope or higher stakes (e.g., predicates used in financial reconciliation get proof-assistant level; catalog metadata gets SAT/SMT).
The system does not pretend these tradeoffs don't exist. Every verification attempt records the mode used, the budget consumed, and the confidence level of the result. An approximate clearance is not a guarantee—it is a bet, explicitly priced.
K.2 Gluing Correctness
Informal claim: If local claims agree on overlaps, the sheaf condition guarantees a unique global claim.
Let be a sheaf on the context site . Let be a cover of .
If sections satisfy the matching condition:
then there exists a unique such that for all .
Proof sketch (equalizer diagram):
-
The sheaf condition states that is the equalizer of:
where restricts the -th component to , and restricts the -th component.
-
A family is in the equalizer iff , i.e., for all .
-
Existence: The matching condition says is in the equalizer. Therefore there exists that maps to under restriction.
-
Uniqueness: The equalizer is a limit; the map is injective (this is the locality condition). Therefore is unique.
Failure mode: If the matching condition fails (some ), the family is not in the equalizer, and no global section exists. The failure is localized to the specific overlap(s) where disagreement occurs.
Operational consequence: The glue operation (Appendix I) checks the matching condition. If satisfied, it returns the unique global claim. If not, it returns an ObstructionWitness identifying the disagreeing contexts and the specific claims that conflict.
Anchor: A13 (Sheaf Condition). This theorem and its proof are developed in full in Chapter 11.
K.3 Scoped Transport Safety
Informal claim: Transporting a property along a witnessed equivalence preserves truth within the declared scope.
Let be a witnessed equivalence with scope . Let be a transportable property. Let be a context in the equivalence's scope.
If holds in context , and transport is well-defined for along , then holds in context .
Conversely, if (context outside scope), transport is undefined and the operation fails with a ScopeViolation.
Proof sketch:
-
Within scope: By definition of witnessed equivalence, provides a certificate that and are interchangeable for all transportable properties in contexts within . The transport map is part of the equivalence structure. If holds (has a proof/witness), then carries that witness to a witness of .
-
Preservation of truth: The transport is functorial: it preserves the structure of the proof. If was witnessed by , then is witnessed by .
-
Outside scope: The equivalence certificate is only valid in . If , the system has no warrant that and are interchangeable in . The
transportoperation checks as a precondition. Failure produces aScopeViolationartifact.
Failure mode: Attempting to use an equivalence outside its scope is a type error. The equivalence does not justify substitution in a real estate context, even if both terms denote entities.
Operational consequence: The transport operation (Appendix I) enforces scope checking. Every successful transport produces a TransportReceipt that binds the original claim, the transported claim, and the certificate. The receipt is auditable: any consumer can verify that the transport was within scope.
Anchor: A10 (Witnessed Sameness), A16 (Transport Discipline), A30 (Scoped Equivalence). This theorem and its proof are developed in full in Chapter 14.
K.4 Coherence Budget Monotonicity
Informal claim: Checking coherence over a larger cover costs at least as much as checking over a smaller cover.
Let be a cover of , and let be a refinement of (every factors through some ).
Let be the cost of verifying the matching condition over cover . Then:
Equality holds only if introduces no new overlaps.
Proof sketch:
-
The cost of checking the matching condition is dominated by the number of pairwise overlap checks.
-
For cover with components, the number of overlaps is in the worst case.
-
A refinement with components has overlaps.
-
Each overlap check has cost (at minimum, comparing values). Therefore .
-
Equality case: If refines by splitting components that have no overlaps with each other, no new overlap checks are introduced. But typically, refinement increases overlap complexity.
Operational consequence: There is no free lunch in coherence. Finer-grained verification (more contexts, more overlaps) costs more. The coherence budget (A21) must account for this: systems that demand higher coherence guarantees must pay with higher verification costs.
Anchor: A21 (Coherence Cost Model). This theorem and its proof are developed in full in Chapter 19.
K.5 What These Results Guarantee
Together, these four results provide the formal backbone of the Third Mode's promises:
| Result | Guarantee |
|---|---|
| Conservative Extension Safety | New predicates don't corrupt existing knowledge |
| Gluing Correctness | Local agreement implies unique global truth |
| Scoped Transport Safety | Equivalences are safely bounded |
| Coherence Budget Monotonicity | Verification cost is predictable |
What they do NOT guarantee:
-
Completeness: The Third Mode does not guarantee that every true statement can be proved. It guarantees that accepted statements are coherent with existing commitments.
-
Decidability: Checking the matching condition may be undecidable for some presheaves. The Third Mode specifies what must be checked, not that checking is always tractable.
-
Convergence: Multiple agents proposing predicates may not converge to a shared vocabulary. The Third Mode provides discipline, not consensus.
K.6 Formal Dependencies
The results depend on the following formal machinery:
| Result | Dependencies |
|---|---|
| Conservative Extension | Model theory, completeness for the ambient logic |
| Gluing Correctness | Sheaf theory, equalizer definition |
| Scoped Transport Safety | Equivalence structure, transport maps |
| Coherence Budget Monotonicity | Cover refinement, overlap counting |
For full proofs, consult:
- Shoenfield (1967) for conservativity in classical logic
- Mac Lane & Moerdijk (1992) for sheaf theory
- HoTT Book (2013) for transport along equivalences
- Grothendieck (SGA4) for site theory
The Third Mode's contribution is not inventing these results but applying them operationally: specifying the artifacts, failure modes, and audit trails that make the guarantees enforceable in software.
K.7 Formal Mini-Spine: The Obstruction Localization Theorem
This section gives one result with full rigor: complete definitions, a precise theorem statement, and a proof. The goal is to demonstrate that the claim "gluing failures are localized and structured" is not metaphor but mathematics.
K.7.1 Definitions
A context category is a category where:
- Objects are contexts —each representing a view with a signature (vocabulary), constraints, and absence policy.
- Morphisms are refinements: is a more specific context than (e.g., "FDA regulatory view" refines "US legal view").
- Composition is associative; identities exist.
A Grothendieck topology on assigns to each object a collection of covering sieves. A sieve on is a subfunctor of ; it is covering if it is in .
For our purposes, we use the simpler notion of a covering family: a collection such that the sieve it generates is in .
The pair is a site.
A presheaf on is a contravariant functor .
- For each context , is the set of local sections (claims that hold in ).
- For each morphism , is the restriction map (how a claim in appears when viewed from the more specific context ).
Let be a covering family of . A matching family for a presheaf is a collection of sections such that for all :
where is the pullback (the "overlap" context where both and apply).
A presheaf is a sheaf if for every covering family and every matching family , there exists a unique section such that for all .
The unique is called the gluing of the family .
If is not a matching family (some ), we say there is an obstruction to gluing. Define:
This is the set of disagreeing pairs.
K.7.2 Theorem Statement
Let be a presheaf on a site . Let be a covering family and a collection of local sections.
Either:
-
is a matching family, in which case there exists at most one with for all , or
-
is not a matching family, in which case , and this set exactly identifies the pairs where the obstruction occurs.
Moreover, if is a sheaf, case (1) guarantees existence and uniqueness of the gluing.
K.7.3 Proof
We prove each part.
Part 1: Matching implies at-most-one gluing.
Suppose is a matching family and both satisfy and for all .
Consider the equalizer diagram:
where , and are the restriction maps to overlaps.
By assumption, .
The map is injective for separated presheaves (and hence for sheaves). This separation property is precisely what distinguishes separated presheaves from arbitrary presheaves; for a sheaf, it holds by definition. Since we are proving uniqueness for sheaves, separation applies, and therefore .
Part 2: Non-matching implies nonempty obstruction set.
Suppose is not a matching family. Then by definition, there exist such that . Hence , so .
Part 3: Obstruction set exactly identifies disagreements.
By construction, if and only if . The set contains no spurious pairs and omits no actual disagreements.
Part 4: Sheaf implies existence.
If is a sheaf and is a matching family, the sheaf condition guarantees existence of with . Combined with Part 1, the gluing is unique.
K.7.4 Operational Consequence
The Obstruction Localization Theorem justifies the ObstructionWitness artifact:
ObstructionWitness {
cover: [U_i],
local_sections: {U_i: s_i},
disagreeing_pairs: Obs({s_i}),
specific_conflicts: [(i, j, s_i|_{overlap}, s_j|_{overlap})]
}
When a gluing attempt fails, the system does not return a generic "conflict" error. It returns a structured object that names:
- Which contexts were involved
- What claims each context made
- Which pairs disagreed
- What the disagreeing values were
This is not a design choice but what the mathematics requires: the obstruction is localized to specific overlaps, and the disagreement is a computable predicate.
This theorem is why the Third Mode can promise auditable failure. The failure is not "something went wrong." It is "contexts and disagree on the overlap , with these specific values."
The Obstruction Localization theorem and its full proof are also developed in Chapter 11.