Key Facts
- ✓ The SSOT principle was formalized in Lean 4 (~2.1k LOC, zero sorry).
- ✓ Structural SSOT requires definition-time hooks and runtime introspection.
- ✓ Macros/codegen (before definition) and reflection (after definition) are insufficient.
- ✓ Derivation must occur at definition time to verify DOF = 1.
Quick Summary
A researcher has formalized the Single Source of Truth (SSOT) principle using the Lean 4 proof assistant. The project spans approximately 2,100 lines of code and contains zero "sorry" placeholders, indicating a complete proof.
The formalization proves that Structural SSOT is achievable only when a language provides definition-time hooks and runtime introspection. The work demonstrates that macros and reflection are insufficient for achieving the required Degree of Freedom (DOF) of 1.
Formal Verification of SSOT
The Lean 4 formalization addresses the theoretical underpinnings of the Single Source of Truth principle. By translating the concept into a mathematical proof, the work moves beyond theoretical discussion to verifiable fact. The codebase, totaling ~2.1k LOC, serves as the definitive specification for these requirements.
The project achieved a significant milestone by maintaining zero sorry statements. In the context of proof assistants, a "sorry" is a placeholder used to bypass unproven statements. The absence of these placeholders indicates that every assertion within the formalization has been rigorously proven within the system.
Core Proven Results
The formalization established two primary conclusions regarding the mechanics of structural truth. These results are presented as derived requirements rather than chosen preferences, based on the immutable nature of structural facts.
The core findings are:
- Definition-time hooks are required because structural facts are fixed at the moment of definition.
- Runtime introspection is necessary to verify that the Degree of Freedom (DOF) equals 1.
- Macros and code generation (occurring before definition) are insufficient.
- Reflection (occurring after definition) is also insufficient.
These results suggest that for a system to maintain true structural SSOT, the language itself must support specific capabilities that allow for derivation and verification at the precise moment definitions are created.
Technical Implications
The distinction between derivation and verification is central to the proof. Because structural facts are fixed at definition, derivation must occur at that specific time. Furthermore, the system requires the ability to inspect these definitions dynamically to ensure the DOF remains 1.
This finding places specific constraints on language design. Tools that operate strictly before or after the definition phase—such as pre-processors or post-hoc reflection APIs—cannot satisfy the strict requirements of Structural SSOT. The proof implies that definition-time hooks act as the necessary bridge to ensure that derived truths remain synchronized with their source definitions.
Community Verification
The author has made the Lean scripts available and is actively seeking feedback from the technical community. The invitation extends to review, critique, and independent checking of the proofs to ensure the validity of the results.
Interested parties can view the discussion and access the code via the provided link. The open invitation underscores the collaborative nature of formal verification research, where independent validation is a standard step in establishing the reliability of new proofs.



