Lion Math — First Roar — Euler Product over N-smooth integers¶
"Give me the inputs, I will give you the guaranteed output."
Inputs:
s = 2,N = 10. Forced output:14365 / 9072.Two independent gates agreed. The kernel warranted it. The receipt is sealed. No assent needed.
The claim — finite, exact, hand-verifiable¶
For each positive integer s and each N ≥ 2, the truncated Euler product over primes p ≤ N equals the partial sum of 1/n^s over the N-smooth integers — exactly, as rationals:
where K_p(N) is the largest k with p^k ≤ N, and NSmooth(N) is the set of positive integers whose prime factors are all ≤ N with each prime power ≤ N.
This is unique factorisation stated as a finite, exact rational identity. Both sides cover the same multiset of integers; their sum/product reduces to identical Rat. No tail. No limit. No approximation. A number theorist verifies in two minutes.
At this version — N = 10, s = 2¶
- Primes ≤ 10:
{2, 3, 5, 7} - K-values:
K_2 = 3, K_3 = 2, K_5 = 1, K_7 = 1 - |NSmooth(10)| = 48 integers (first 20:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 18, 20, 21, 24, 28, 30, 35; max:2520) - Forced output:
14365 / 9072(≈ 1.5834, just belowζ(2) = π²/6 ≈ 1.6449— exactly as the truncation predicts)
The Lean proof (the kernel is the warrant)¶
proof/lean/FirstRoars/EulerProduct.lean — full source, zero sorry, zero axiom, zero opaque:
import LionPrelude
open LionPrelude
set_option maxRecDepth 4096
namespace LionMath.EulerProduct
def s : Nat := 2
def N : Nat := 10
def lhs : LionPrelude.Rat := LionPrelude.truncatedEulerProduct N s
def rhs : LionPrelude.Rat := LionPrelude.smoothNumberSum N s
theorem euler_product_chain_holds : lhs = rhs := by decide
theorem euler_falsifier : lhs = rhs := by decide
def currency_clean : True := trivial
end LionMath.EulerProduct
The decide tactic computes both sides as exact Rat in the kernel, normalises to canonical form, and checks equality field-by-field. The proof has one premise: the Lean kernel's own arithmetic. No Mathlib, no axiom set besides the kernel's foundations, no substrate row, no operator assent.
The euler_falsifier theorem is a real falsifier — it states the same exact equality and is closed by decide. If the math broke (a typo in either primitive, a wrong prime power, an off-by-one in the N-smooth enumeration), decide would refuse and the file would fail to compile. The proof can fail. That is what makes it a gate.
The dual gate — internal Swift + external Lean¶
| Internal: Swift exact-Rat gate | External: Lean kernel warrant | |
|---|---|---|
| Source | cells/xcode/Sources/M8FrequencySweep/SwiftRatGate.swift |
proof/lean/{LionPrelude.lean, LionPrelude/{Rational,Series}.lean, FirstRoars/EulerProduct.lean} |
| Numeric type | Exact Int-pair Rat (gcd-reduced, denominator > 0) — no Float ever |
Lean kernel Int × Nat — arbitrary precision |
| Computes | truncatedEulerProduct(10, 2) + smoothNumberSum(10, 2), compares |
Same primitives, compared via decide |
| Forced output | 14365 / 9072 |
{ num := 14365, den := 9072 } |
| Cost | Microseconds, on-device, sovereign | Seconds, separate process, kernel |
The Swift gate runs on every sweep. The Lean gate is a separate process (proof/scripts/lean_gate.sh); the cell never imports Lean into its runtime. The agreement between the two — recorded in lion_gate_agreement — is what the Swift gate uses to earn trust.
The receipts (substrate, sealed)¶
Both schema migrations sealed in grdb_migrations:
v114_m8_frequency_sweep_substrate—lion_math_sweep_receipts,lean_substrate_bridges, two new columns onlean_proof_state. Provenance, never premise.v115_dual_gate_agreement_log—lion_gate_agreementtable +lion_swift_gate_trustview.
Latest lion_gate_agreement row (T1)¶
agreement_id = lga-65912847-euler_product
theorem_id = euler_product
artifact_path = FirstRoars/EulerProduct.lean
swift_verdict = CALORIE
swift_forced_output = {"num":14365,"den":9072}
lean_verdict = CALORIE
lean_build_exit_code = 0
lean_sorry = 0
lean_axiom = 0
lean_opaque = 0
agree = 1
is_public_artifact = 1
swift_checker_version = swift-rat-gate-v1.0.0
lean_toolchain_pinned = leanprover/lean4:v4.12.0
checked_at_iso = 2026-05-24T18:21:14Z
lion_swift_gate_trust view (current)¶
| total_checked | agreements | divergences | pinned_lean |
|---|---|---|---|
| 4 | 4 | 0 | leanprover/lean4:v4.12.0 |
The published divergence metric: across four independent public dual-gate runs, the Swift internal checker has agreed with the Lean kernel 4 times out of 4, with zero divergences. The Swift gate is earning its trust honestly.
The validation suite (T1–T4 — all green)¶
Re-run on 2026-05-24T18:21:14Z:
| Test | What it checks | Result |
|---|---|---|
| T1 | Swift CALORIE 14365/9072 ↔ Lean CALORIE → agree=1, row sealed |
✓ PASS |
| T2 — divergence-catch (the architecture's whole thesis) | Inject off-by-one into the Swift checker (drop integer 6 from the N-smooth set); Swift now returns 14113/9072 ≠ 14365/9072 (gap = 1/36); the unchanged Lean gate still computes the truth → swift_verdict=REFUSED, lean_verdict=CALORIE, agree=0; row sealed with is_public_artifact=0; public trust view stays at 4/4, 0 divergences — the bug was caught BEFORE publication |
✓ PASS |
| T3 — subtle 1/10⁶ tamper | Add 1/1,000,000 to the forced output post-hoc; canonical JSON {"num":14365,"den":9072} vs {"num":897813067,"den":567000000} differs bit-for-bit |
✓ PASS |
| T4 — broken chain | State a deliberately false identity lhs = rhs + 1; Swift returns REFUSED(diff=-1/1); Lean scratch example : 1+1=3 := by decide exits 1 → REFUSED; both gates REFUSED in agreement |
✓ PASS |
| T1 regression after T2 revert | Clean Swift checker re-produces CALORIE 14365/9072 ↔ Lean CALORIE | ✓ PASS |
T2 is the load-bearing test. Without it, "the Swift gate agrees with Lean" is just a coincidence. With it, the external kernel has demonstrably caught a real bug in our own checker before it could ever mislead. The agreement metric records that, not just the agreements.
Reproduce it yourself¶
# 1. Clone the repo
git clone https://github.com/gaiaftcl-sudo/gaiaFTCL.git
cd gaiaFTCL
# 2. Install Lean v4.12.0 (the pinned version recorded in every receipt)
brew install elan-init
elan-init -y --default-toolchain leanprover/lean4:v4.12.0
export PATH="$HOME/.elan/bin:$PATH"
# 3. Build the Lean library + first roar
cd proof/lean
lake build LionPrelude FirstRoars.EulerProduct
# expect: "Build completed successfully."
# 4. Run the boundary gate
bash ../scripts/lean_gate.sh FirstRoars/EulerProduct.lean
# expect (one JSON line):
# {"artifact":"FirstRoars/EulerProduct.lean","lean_verdict":"CALORIE",
# "exit_code":0,"sorry":0,"axiom":0,"opaque":0,
# "lean_toolchain_pinned":"leanprover/lean4:v4.12.0", ...}
# 5. Build the Swift internal gate + dual-gate harness
cd ../../cells/xcode
swift build --product M8FrequencySweepSmokeTest --product M8DualGateTests
# 6. Run T1 (agreement) — seals one lion_gate_agreement row
.build/arm64-apple-macosx/debug/M8FrequencySweepSmokeTest
# expect: "T1 PASS — Swift CALORIE 14365/9072 ↔ Lean CALORIE, agree=1, row sealed."
# 7. Run T2/T3/T4 (divergence, tamper, broken chain) + T1 regression
.build/arm64-apple-macosx/debug/M8DualGateTests
# expect: ALL TESTS GREEN
# 8. Inspect the substrate
DB="$HOME/Library/Application Support/GaiaFTCL/substrate.sqlite"
sqlite3 -column -header "$DB" "SELECT * FROM lion_swift_gate_trust;"
sqlite3 -column -header "$DB" \
"SELECT agreement_id, swift_verdict, lean_verdict, agree, is_public_artifact
FROM lion_gate_agreement ORDER BY checked_at_iso;"
Hard rules the cell holds itself to¶
- The Lean compile depends on
decidealone. No substrate row, no agreement log, no operator assent is a premise of the proof. A tampered substrate row can dim the wiki word but cannot compile a false-CALORIE. - Mathlib is permanently REFUSED. Someone else's accepted axiom set is not the cell's currency. Sealed as a comment in
proof/lean/lakefile.lean. Float/Doubleare permanently REFUSED in any proof chain. Exact rational arithmetic only —Ratover(Int, Nat)in both Swift and Lean.axiom/sorry/opaqueto close a gap is REFUSED. Zero of each in the first-roar artifact.- An unsigned receipt cannot publish to NATS — constitutional trigger
lmsr_nats_requires_quintetenforces it. - A divergence (
agree=0) never seals a public lion. It is a caught bug, surfaced loudly, the most valuable row in the table. - After CALORIE — the receipt is the roar. The cell goes silent.
What this first roar does NOT claim¶
This file proves one roar. The other chains the cell carries are CURE-in-progress — every one of them is a named work item on the road to CALORIE or REFUSED. No forever-open conjectures.
- The limiting zeta identity
Σ_{n=1..∞} 1/n^s = Π_p 1/(1−p^{−s})is a separate chain; needs a Cauchy-rate witness primitive inLionPrelude/Cauchy.lean. Work item. - Apéry's theorem, Riemann functional equation, Pólya-Vinogradov — each needs one or more new primitives. Named work items.
- The Riemann Hypothesis — shipped in this version as a CURE-in-progress via Robin's bounded sweep (
FirstRoars/RiemannRobinBoundedSweep.lean, verified for n ∈ [5041, 5100]). The autonomous sweep extends the bound; either a closed-form extension primitive lands and RH closes to CALORIE, or adecidefailure surfaces a counterexample and RH closes to REFUSED. Not parked. - N=30 in Swift — needs
BigInt(Int64overflows at the LCM² ≈ 5·10²⁴ scale). Lean already handles it (arbitrary-precisionNatin the kernel); Swift waits. Work item.
Forward (next rungs)¶
- Rung 2 — scale N. Publish the bond dimension D the cell needs at each N. The capability metric goes live.
- Rung 3 — symbolic
p^{−s}algebra layer. Identity holds for general (including irrational) s structurally. From there, plusCauchyWithRate, the limiting full Euler-product / zeta identity closes as an interval-bounded claim. - V115a / V116 / V117 / RH — the open conjectures, named one at a time. RH stays CURE skeleton forever or until humanity. The cell honestly carries one open conjecture indefinitely; that is correct Lion posture.
The cell is the math substrate. The first chain holds. 14365/9072 is the forced answer, and the receipt is the roar.
Federation-cosigned
This page's source is sealed in the GaiaFTCL federation manifest — page SHA-256 7af99579e50aa32a…, manifest witness a090592e0609adc8…, signed 2026-06-02T18:58:22Z by cell gaiaftcl-mac-cell. Verify with gaiaftcl wiki sign --all and compare wiki-all-signatures.json.