Exploring the Atlas Theorem: Software Architecture Resolution in Lean 4
A five-day formal verification record of the Atlas theorem in Lean 4, resolving architecture granularity through algebraic geometry.

Stock photo for illustration only, not from the actual event
- The Atlas theorem proves diagnostic consistency across different software architecture granularities.
- The project was conducted over 5 working days from August 4-8, 2026, featuring 4 self-refutations by an AI agent.
- Applies Algebraic Architecture Theory (AAT) to formally verify system properties in Lean 4.
- Resolution choices do not alter diagnostics as long as calibration condition C is satisfied.
A photorealistic portrait and a 16×16 pixel-art sprite can show you the same face. Comics theorist Scott McCloud called this amplification through simplification: removing lines doesn't discard information, it sharpens the essence.
Can we say the same about software architecture diagnostics? Look at your system at service granularity or at module granularity, and the same bugs show up in the same places — not as a feeling, but as a proven guarantee.
This article is the record of proving that guarantee — we call it the Atlas theorem — in Lean 4. The AI agent that set out to prove it refuted its own target statement four times. Those four refutations turned out to be the best part. The protagonist here is not any proof technique. It is the discipline that accumulated refutations as results instead of writing them off as failures.
Everything below happened between August 4 and 8, 2026 — five working days. The subject is AlgebraicArchitectureTheoryV2. Take the source code as the source of truth; abstract the implementation into parts called Atoms; turn the specification into equations called laws. Treat architecture as geometry, and analyze it with the weapons of algebraic geometry. That is AAT (Algebraic Architecture Theory), and this monorepo is its formal verification in Lean 4.

Stock photo for illustration only, not from the actual event
The theory had a weak point that everyone had been politely ignoring: granularity. Whenever you analyze an architecture, you implicitly choose a resolution. Services? Modules? Methods? If the diagnosis changes with that choice, then what is the diagnosis actually measuring — a property of the architecture, or a convenience of the observer?
There is a precedent for this problem: the Nyquist–Shannon sampling theorem. Sample too coarsely for the signal's bandwidth and frequencies that don't exist appear (aliasing) while signals that do exist vanish. The granularity problem is the sampling problem of architecture diagnostics.
In software engineering, choosing the right inspection resolution often triggers debates over whether high-level abstractions miss critical defects or fine-grained views get lost in implementation details. Applying formal algebraic frameworks like AAT provides a rigorous, mathematically sound way to resolve these concerns.
The Atlas Theorem (formally: the Diagnostic Resolution Invariance Theorem) states that given two adequate readings, one a coarsening of the other, satisfying the calibration condition C, the comparison map is an isomorphism. The choice of resolution does not change the diagnosis.
In Lean, this is pinned down as a bundle of five claims:
- The construction of the comparison map
- Its bijectivity
- The corollary that measuring finer creates no new diagnostics
- Three counterexamples for broken conditions
- A firing witness where all conditions hold and a nonzero diagnostic flows across the map
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment