# Singer's Theorem — Lean 4 Formalization Forked from `d0d1/singer-theorem-lean`. This is a submodule of the Research Stack. ## Build ```bash cd /home/allaun/Research\ Stack/0-Core-Formalism/lean/singer-theorem-lean lake exe cache get # ALWAYS first — Mathlib from source needs ~32 GB RAM lake build ``` Toolchain: `leanprover/lean4:v4.29.0` (pinned in lean-toolchain). Dependency: Mathlib v4.29.0 (locked in lake-manifest.json). ## Zero-sorry invariant This project has zero sorries by design. Before committing: ```bash lake build # must pass with 0 errors lake env lean --run Erdos30.lean 2>&1 | grep -i sorry # no output ``` ## Port status The main Singer theorem (`singer_sidon_set`) has been ported into the Research Stack's `Semantics.SidonSets` module. This repo is the canonical upstream. Changes here must be mirrored to `Semantics.SidonSets` if they affect the shared Sidon infrastructure (`IsSidon`, `IsSidonMod`, `IsIntervalSidon`). ## Rules - Never edit `lean-toolchain` or bump Mathlib revs. - Linter warnings are acceptable; errors and sorries are not. - The prime-power extension (`SingerPrimePower*`) is a separate generalization; the core Singer proof only needs the prime case.