RUSTIC_CHURCH.md — live-witness gates for restored Lean modules
Reputation is a name; a witness is a carrier that proves something. A green
lake buildover a closed tautology (1 + 1 = 2 := by decide) is Sardis mode: a living name over a dead body. This document states the gates a restored module must clear so that "green" is an honest live witness.
This file encodes the restoration gates referenced by
RUSTIC_CHURCH_RESTORATION_LEDGER.md.
It governs the Gnosis Lean library under lean/. (The pre-burn
module bodies are recovered from this repository's ForkRaceFoldTheorems
history; see the ledger's Provenance note.)
The gates
A module passes iff all of the following hold:
import Initonly. No Mathlib, no generated/external API surface. The finite core must stand on Lean's kernel primitives alone.- No banned tactics on open goals. No
omega,nlinarith, orring; nosimpordecideon a goal that still carries a free variable. A closed numeric fact (e.g.1 ≤ 2) may still usedecide, but it may not be the whole module. - Real content. At least one honest
structure/defcarrier and a theorem family that states and proves something non-vacuous about it — a finiteNat/Intlaw, a monovariant, a conservation/dissipation bound, or a refutation witness. Not a closed tautology, anx = xidentity, or a hypothesis echoed back (P → P := h). - No axiom smuggling.
#print axiomsshows nosorryAxand noQuot.soundsmuggling.propext(used implicitly by∧/rewriting) is permitted as a core Init logical axiom; prefer proofs that depend on no axioms where natural. - No stub prose. The
Structural witness: …/Structural-existence stub/pre-ledgerboilerplate is removed once the module has genuine structure.
Verifying a module
cd lean
lake build <Module> # gate 1–3 (compiles Init-only, green)
# axioms gate (4):
LEAN_PATH=.lake/build/lib/lean lean - <<'EOF'
import <Module>
#print axioms <some_master_theorem>
EOFA module leaves the inventory when it has ≥1 meaningful structure and a proven
theorem family, builds Init-only without banned tactics on open goals, passes the
axioms gate, and no Structural witness / pre-ledger prose remains in it.
Burn-down notes
- Scope the gate honestly.
a0 audit chapel --dir=<path>must scan the requested path, not the default chapel, or the audit can report a clean module while another restored surface is still dirty. - Top-level sketches are not Lean witnesses merely because the marker scan is clean. If a restored file is not owned by Lake, treat it as topology-only until it is either imported by the Lean build or explicitly quarantined outside the formal surface.
- Prefer small Init lemmas over tactical erasure. When
omegawas only proving monotonicity or an integer subtraction chain, the durable repair was an explicitNat/Intlemma with named inequalities. - Restored TypeScript stubs can invalidate formal work by breaking the package
build. Keep
tsconfigsubpath resolution aligned with workspace package exports so wrapper modules typecheck against the real source they re-export. - Disk-full linker failures (
errno=28) are environmental, but they still block green. Clear generatedtarget/artifacts first; do not delete source or working-tree changes to make space.