Repository navigation
Layer 1 formal verification: Lean 4 + Mathlib pilot, fail-closed formalization gate, cross-repo handoff - #3
d6g8k5htny-coder wants to merge 5 commits into
Conversation
…ation gate Lean 4 (v4.34.1) + Mathlib project under formal/lean formalizing the arithmetic ledger, cone-moment integral/algebra and the reference-to- enclosure implication of Math- coefficients/side24_v1/PROOF.md. formal_gate.py checks declared formalization status (none/specified/ proved/kernel-checked) against pinned bytes and #print axioms evidence. Scientific effect NONE; lemma_closed stays false. Co-authored-by: Dylan Roy <d6g8k5htny@privaterelay.appleid.com>
…ion replay Assumed-axiom registry moves to the status file top level; kernel evidence depending on a registered axiom yields KERNEL_CHECKED_CONDITIONAL and never satisfies the formal lane. run_validation.py replays normal/optimized modes and optionally regenerates BUILD_EVIDENCE.json for byte comparison. Co-authored-by: Dylan Roy <d6g8k5htny@privaterelay.appleid.com>
…eview lane, Layer 1 README
blueprint_check.py binds every \lean{} environment to a status component and
allows \leanok only on kernel-checked components. Workflow runs the Python
controls and a lean-action job that rebuilds with the Mathlib cache and
refuses any BUILD_EVIDENCE.json byte difference.
Co-authored-by: Dylan Roy <d6g8k5htny@privaterelay.appleid.com>
Per-repo AGENTS.md patches (trial, main, Math-, governance-) generated against their current tips, Math- hard-gate extension spec, port instructions, and the owner pre-approval record. Sandbox AGENTS/README point at formal/ and handoff/. Measured 403 write scope recorded. Co-authored-by: Dylan Roy <d6g8k5htny@privaterelay.appleid.com>
…/2) = sqrt(3/8)) Replaces the specified gaussian_inputs_statement with two theorems proved against Mathlib gaussianReal: the fourth moment via iteratedDeriv of mgf_id_gaussianReal, the exponential moment via integral_gaussian. Pins, evidence, status, blueprint and docs regenerated together. Co-authored-by: Dylan Roy <d6g8k5htny@privaterelay.appleid.com>
|
Formal-lane convergence request — OpenAI/ChatGPT under Dylan's delegated integration authority. Math-#92 is merged (source |
|
Closing at the owner's request to resolve open PRs. Generated by Claude Code |
Summary
Adds Layer 1 — formal verification on top of the existing Layer 0 research verification stack (provenance/SHA-256, explicit scope, review-status ladder, fail-closed Math- hard gate, verification museum). Layer 0 is unchanged; Layer 1 is strictly additive and fail-closed.
Scientific effect: NONE.
lemma_closedstays false.mathematical_acceptancestays false. Nothing here is a theorem discharge or claim closure.What is added (
formal/)formal/lean/, toolchainleanprover/lean4:v4.34.1, Mathlibv4.34.1) — pilot on the SIDE24 coefficient bound (Math-coefficients/side24_v1/PROOF.md, pinned by commit/blob/sha256).Ledger.lean: constant-image lemma,e^xpartial-sum bounds,10^125 < exp 288,512·e^{-864} < 1/2, covariance/density comparison bounds, exponent budgets.ConeMoment.lean: cone antiderivative + FTC identity,D2 = 29/6 − √6with rational enclosure, and the §1 Gaussian inputs now kernel-checked:E[s^4] = 25/3andE[exp(−s²/2)] = √(3/8)forN(0, 5/3)(via MathlibgaussianReal, MGF iterated derivatives, and the Gaussian integral).Reference.lean: reference coefficient definition, rational enclosure endpoints, periodization bound, andenclosure_of_reference(kernel-checked, conditional on the parent-defined coefficientc : ℕ → ℝ, which is parametrized rather than axiomatized).FORMALIZATION_STATUS.json— 22 components: 16 kernel-checked, 6 specified, allformalization_review: author-side. Ladders:none < specified < proved < kernel-checked; reviewnone | author-side | nonauthor-aligned. Rule: declared ≤ verifiable, otherwise the gate fails.assumed_axiomsregistry is empty.formal_gate.py— fail-closed gate: verbatimlean_statementbinding, sorry/axiom scan,#print axiomsstandard-axiom check, byte pins (SOURCE_FILES.json), deterministic build evidence (BUILD_EVIDENCE.json), review-record verification, same-provider review earns no independence credit. Emits hard-gate tokens (FORMAL_SPECIFIED,KERNEL_CHECKED_AUTHOR_SIDE,KERNEL_CHECKED_CONDITIONAL,KERNEL_CHECKED_NONAUTHOR_ALIGNED).formal/blueprint/,blueprint_check.py) — leanblueprintcontent.texwith\lean{}/\leanok/\uses{}for every component; checker enforces the informal↔formal binding.GLOSSARY.md— project terms ("elder density", "lifetime coefficient", "Universal Law mathematics", …) → standard objects → Lean names; RN/24-jet/JETMOD remain UNMAPPED and say so.FORMALIZATION_REVIEW_LANE.md— distinct formalization reviewer checklist and record format (formal/reviews/).test_formal_gate.py+test_blueprint_check.py— 27 tests, 33 semantic mutants, normal and-Omodes;run_validation.pywritesREPORT.json(with optional--with-leanevidence check)..github/workflows/formal-gate.yml):gate-controls(pins, validation, counts) andlean-kernel(lake buildvia pinnedlean-actionwith Mathlib cache, evidence--check, gate, blueprint check, clean tree).Coordination (
handoff/)Cloud Agent writes to
trial,main,Math-,governance-are refused (measured 403), so this branch carries a handoff package instead: owner pre-approval record, per-repo offered tasks,PORT.md(portable pieces fortrial),MATH_HARD_GATE_EXTENSION.md(nodeformalizationfield, tokens, sync tool, tests to add), andagents/*.AGENTS.md.patchfor each sibling repo.AGENTS.mdandREADME.mdin this repo point toformal/andhandoff/.Verification
python3 formal/run_validation.py --output /tmp/fv --with-lean→passed: true, 27 distinct tests, 33 distinct semantic mutants.lake buildclean, nosorry, all kernel-checked declarations depend only onpropext,Classical.choice,Quot.sound.specified, nowkernel-checked).