# Verification recipe — route 157 exact capped moments and base-cutoff arithmetic Everything below is exact rational arithmetic; there is no randomness and no floating comparison. Run from a checkout that contains this return's files at `research/0025/` and the harvested engine at `lib/maynard/even_engine.py`. Prerequisites: `python3` with `sympy`; the uploaded modules `capped-moment.py` and `capped-forms.py` placed in `research/0025/src/`, the three `test-*.py` files in `research/0025/tests/`, and `CapBaseCutoff.lean` in `research/0025/lean/`. Serve each file from `/files/`. ## 1. Base-cutoff arithmetic (sympy) ``` python3 research/0025/tests/test_cap_base_cutoff.py ``` Expected: `ALL PASS`, exit code 0. Checks `u = 1329/5000`, `ℓ = 627/2500`, `u − δ − ℓ = 3/1000 > 0`, `2ε_s − δ = 3/1000`, the source's `u_src − d_src − ℓ_src = −32/10000 < 0`, and the cap constants `δ/A = 40/861`, `c₁ = 500/861`, `c_m = 1600/2583`, `2ε_s/A = 50/861`, `1/A = 10000/2583`. Runtime < 5 s; output is byte-stable. ## 2. Capped-moment instrument (`lib/maynard/capped_moment.py`) ``` python3 research/0025/tests/test_capped_moment.py ``` Expected: `ALL PASS`, exit code 0. Controls: * inert cap (`δ = U`, `B ≡ 0`) equals Lemma 4.19 exactly for 20 `(ν, e)` pairs; * at `n = 3`, `U = 1`, `δ = 3/10`, `B = (0, ½, ½, ⅗, ⅗)`: exact vs Monte-Carlo with relative deviation < 2 % for six `(ν, e)` (observed ≤ 0.4 %); * monotonicity in `B` (`B = 0`: `0.002430`, `B = ½`: `0.014301`). The Monte-Carlo step uses `numpy` with `seed = 7`; the exact values are the comparison target, so the log is stable. ## 3. Capped quadratic forms (`lib/maynard/capped_forms.py`) ``` python3 research/0025/tests/test_capped_forms.py ``` Expected: `ALL PASS`, exit code 0. Controls: * `capped=False` reproduces the engine's exact `M₁` for `k = 4, 5, 6`; * `capped=True` matches Monte-Carlo at `k = 4` (observed relative 0.5 %); * `m₁² = m₂ + 2m_{1,1}`, `m₂m₁ = m₃ + m_{2,1}`, `m₂² = m₄ + 2m_{2,2}`. ## 4. Lean (Mathlib) ``` bash scripts/lean-check.sh research/0025/lean/CapBaseCutoff.lean ``` Expected: `OK research/0025/lean/CapBaseCutoff.lean`, exit code 0 (observed 17–42 s). Key theorems: `candidate_gap`, `candidate_gap_pos`, `candidate_interval_nonempty` (`∃ s, ℓ < s < u − δ`), `source_gap_neg`, `source_gap_lt`, and the cap-constant identities `dc_eq`, `c1_eq`, `cm_eq`, `two_eps_over_A`, `threshold_eq`. ## 5. Not in this recipe The exact value of `46 J_cap/I₀` for the `d = 21` witness is **not** produced by these commands; §5 of `report.md` states the remaining finite computation. No floating-point cap price is offered (see `report.md` §4).