← Session 17 — Lean tier (i): elementary proofs (after crash)
thinking (20498 chars)
Build is healthy. 8 sorries remain (1 in Suzuki, 4 in Valley, and in Li: lambda_pos_finite_height, sInfty_lower_bound, marginTilde_convex — that's 3; total 8. ✓).
Now the sInfty_lower_bound proof. Let me think carefully about the mathematics and the Lean formalization.
Definitions:
- `lagariasA1 = (log(4π) + γ)/2`
- `SInfty n = (1 − a₁)·n − 1 + tsum_{m odd, 3 ≤ m} [(1−1/m)ⁿ − 1 + n/m]`
- `lagariasC1 = (γ − 1 − log(2π))/2`
- Goal: `(1/2)·n·log n + (C₁ − γ/2)·n − 4 ≤ SInfty n` for `20 ≤ n` (n : ℕ).
Math steps from D-037 §3:
1. Each term h⁺(m) = (1−1/m)ⁿ − 1 + n/m ≥ max(0, n/m − 1) (Bernoulli: (1−1/m)ⁿ ≥ 1 − n/m; also ≥ 0).
2. Sum over odd m ≥ 3 with m ≤ n: terms ≥ n/m − 1 > 0. Truncate: sum over k = 1..K, m = 2k+1, K = ⌊(n−1)/2⌋.
3. Σ h⁺ ≥ Σ_{k=1}^{K} (n/(2k+1) − 1) = n·(H_{2K+1} − ½H_K − 1) − K.
4. Harmonic bounds: H_M ≥ log M + γ + 1/(2M) − 1/(12M²), H_M ≤ log M + γ + 1/(2M).
5. Assembly gives S_∞(n) ≥ ½n log n + (C₁ − γ/2)n − 4 for n ≥ 20.
The D-037 statement says: `Σ h⁺ ≥ n[½ log n + (log 2 + γ)/2 − 1 − 2/n] − n/2` for n ≥ 4.
Hmm, this is a nontrivial formalization. Key hard parts in Lean/Mathlib:
A. **Summability** of the family over the subtype `{m : ℕ // Odd m ∧ 3 ≤ m}`. Term ≈ C(n,2)/m². To prove `tsum ≥ Finset.sum over first K terms` for a nonneg family, we can use `tsum_le_tsum`? No — we want `sum_le_tsum`: for nonneg summable family, `∑ x in s, f x ≤ ∑' x, f x` (that's `sum_le_tsum` in Mathlib, requiring nonneg on the complement and summability).
Alternatively, avoid proving summability of the exact family: use comparison. The term for m in subtype: (1−1/m)ⁿ − 1 + n/m. Bound: ≤ C/m² for some constant C depending on n? For fixed n: (1−1/m)ⁿ − 1 + n/m ≤ n/m (since (1−1/m)ⁿ ≤ 1)... that gives ≤ n/m which is not summable. Better: (1−1/m)ⁿ ≤ 1 − n/m + C(n,2)/m² (binomial/truncation)? For 0 ≤ x ≤ 1, (1−x)ⁿ ≤ 1 − nx + (n choose 2)x². Indeed (1−x)ⁿ = Σ (−1)^j C(n,j) x^j, and for x ≥ 0 the partial sums alternate... Actually (1−x)ⁿ ≤ 1 − nx + C(n,2)x² holds because the function (1−x)ⁿ − (1 − nx + C(n,2)x²) = −Σ_{j≥3}(−1)^j C(n,j)x^j... hmm, sign. Let g(x) = 1 − nx + C(n,2)x² − (1−x)ⁿ. g(0)=0, g'(x) = −n + 2C(n,2)x + n(1−x)^{n−1}, g'(0)=0, g''(x) = 2C(n,2) − n(n−1)(1−x)^{n−2} = n(n−1)(1 − (1−x)^{n−2}) ≥ 0 for x ∈ [0,1]. So g ≥ 0 on [0,1].
So term ≤ C(n,2)/m², and summability follows by comparison with 1/m² (which over the subtype is summable since full Σ 1/m² is summable: `Real.summable_one_div_nat_pow` or similar — in Mathlib: `summable_one_div_nat_pow : Summable (fun n => 1/(n:ℝ)^p) ↔ 1 < p`).
B. **The harmonic bound in Mathlib.** Is there an explicit bound `log M + γ ≤ H_M` etc.? Mathlib has `Real.eulerMascheroniConstant` with `Real.eulerMascheroniSeq` and theorems like `Real.eulerMascheroniSeq_lt_harmonic`? Let me recall: Mathlib defines `eulerMascheroniConstant` as limit of `harmonic n − log n`. There are results: `Real.log_add_one_le_harmonic`? Hmm. I recall:
- `Real.harmonic_eq_sum_Icc`
- `Real.eulerMascheroniSeq` defined as `harmonic n − log (n+1)`?
Actually in Mathlib: `Real.eulerMascheroniSeq n := harmonic (n+1) − Real.log (n+1)`? I'm not sure of exact form. There are lemmas about monotonicity giving `γ ≤ harmonic n − log n`... I need to check the Mathlib version pinned (v4.33.0-rc2, Mathlib rev 51e6992).
The explicit bounds `log M + γ + 1/(2M) − 1/(12M²) ≤ H_M ≤ log M + γ + 1/(2M)` are quite fine — 1/(12M²) precision. Mathlib likely does NOT have such sharp bounds. We'd have to prove them.
Hmm wait. Do we actually need such sharp bounds? The final bound has slack: E-023 V1 min slack 9.52 at n=20, growing 0.29n. The −4 constant absorbs errors. Let me redo the assembly with cruder bounds to see how much room we have.
Actually, let me carefully redo the math to find the crudest sufficient harmonic bounds.
Setup: n ≥ 20, K = ⌊(n−1)/2⌋.
Σ_{m odd ≥ 3} h⁺(m) ≥ Σ_{k=1}^{K} (n/(2k+1) − 1) [terms with m = 2k+1 ≤ n; for these n/m − 1 ≥ 0 so truncation keeps nonneg terms]
Wait: for m ≤ n, h⁺(m) ≥ n/m − 1 ≥ 0; for m > n we drop the terms (need h⁺ ≥ 0 there, true). K = ⌊(n−1)/2⌋ means 2K+1 ≤ n... for n even, n = 2q, K = ⌊(2q−1)/2⌋ = q−1, m_max = 2q−1 = n−1 ≤ n ✓. For n odd, n = 2q+1, K = q, m_max = 2q+1 = n ✓.
S := Σ_{k=1}^{K} (n/(2k+1) − 1) = n·A_K − K where A_K = Σ_{k=1}^{K} 1/(2k+1) = H_{2K+1} − ½H_K − 1.
S_∞(n) = (1−a₁)n − 1 + Σ h⁺ ≥ (1−a₁)n − 1 + n·A_K − K.
Target: ½n log n + (C₁ − γ/2)n − 4.
Need: (1−a₁)n − 1 + n·A_K − K ≥ ½n log n + (C₁−γ/2)n − 4.
Coefficient check: 1 − a₁ = 1 − (log 4π + γ)/2. C₁ − γ/2 = (γ − 1 − log 2π)/2 − γ/2 = (−1 − log 2π)/2 = −1/2 − (log 2π)/2. And 1 − a₁ = 1 − (log 4 + log π)/2 − γ/2 = 1 − log 2 − (log π)/2 − γ/2.
Difference: (1 − a₁) − (C₁ − γ/2) = 1 − log 2 − (log π)/2 − γ/2 + 1/2 + (log 2 + log π)/2 = 3/2 − log 2 − γ/2. Hmm let me just compute numerically: a₁ = (log(4π) + γ)/2 = (2.531024 + 0.577216)/2 = 1.554120. C₁ = (0.577216 − 1 − 1.837877)/2 = −1.130331. C₁ − γ/2 = −1.130331 − 0.288608 = −1.418939. 1 − a₁ = −0.554120. So we need:
−0.554120·n − 1 + n·A_K − K ≥ 0.5·n·log n − 1.418939·n − 4
⟺ n·A_K − K ≥ 0.5 n log n − 0.864819 n − 3.
Now A_K = H_{2K+1} − ½H_K − 1. Lower bound: H_M ≥ log M + γ (standard, provable via integral comparison — this is the crude bound). Then:
A_K ≥ log(2K+1) + γ − ½(log K + γ + 1/(2K)) − 1 [using upper bound H_K ≤ log K + γ + 1/(2K)]
Hmm, for the upper bound on H_K we need something. The crude upper bound H_M ≤ log M + 1 (integral comparison) is standard: H_M ≤ 1 + log M.
Let's try with crude bounds: H_{2K+1} ≥ log(2K+1) + γ? Actually the standard inequality: log(M+1) ≤ H_M ≤ 1 + log M? Or with γ: H_M ≥ log M + γ is true for all M ≥ 1? The sequence H_M − log M decreases to γ, so H_M − log M ≥ γ for all M ✓. And H_M − log(M+1) increases to γ, so H_M ≤ log(M+1) + γ... hmm that gives H_K ≤ log(K+1) + γ.
So: A_K ≥ (log(2K+1) + γ) − ½(log(K+1) + γ) − 1 = log(2K+1) − ½ log(K+1) + γ/2 − 1.
For n even (n = 2q, K = q−1): 2K+1 = 2q−1 = n−1, K+1 = q = n/2.
log(n−1) − ½ log(n/2) + γ/2 − 1 ≥ log(n−1) − ½ log n + (log 2)/2 + γ/2 − 1... wait −½ log(n/2) = −½ log n + ½ log 2.
Hmm, log(n−1) ≥ log n − 1/(n−1) (since log n − log(n−1) = log(1 + 1/(n−1)) ≤ 1/(n−1)).
A_K ≥ log n − 1/(n−1) − ½ log n + ½ log 2 + γ/2 − 1 = ½ log n + ½ log 2 + γ/2 − 1 − 1/(n−1).
Then n·A_K − K ≥ ½ n log n + n(½ log 2 + γ/2 − 1) − n/(n−1) − K.
K ≤ (n−1)/2 ≤ n/2. So −K ≥ −n/2.
n·A_K − K ≥ ½ n log n + n(½ log 2 + γ/2 − 3/2) − n/(n−1).
Need ≥ ½ n log n − 0.864819 n − 3:
coefficient: ½ log 2 + γ/2 − 3/2 = 0.346574 + 0.288608 − 1.5 = −0.864818.
WOW — it matches −0.864819 almost exactly! Let me double check: the target coefficient was (C₁ − γ/2) − (1 − a₁) = −1.418939 + 0.554120 = −0.864819. And crude-bounds coefficient: ½ log 2 + γ/2 − 3/2 = −0.8648182. These are equal EXACTLY? Let's verify symbolically: ½ log 2 + γ/2 − 3/2 vs (C₁ − γ/2) − (1 − a₁):
(C₁ − γ/2) − (1 − a₁) = C₁ − γ/2 − 1 + a₁ = (γ − 1 − log 2π)/2 − γ/2 − 1 + (log 4π + γ)/2
= [γ − 1 − log 2π − γ − 2 + log 4π + γ]/2 = [γ − 3 + log(4π/2π)]/2 = [γ − 3 + log 2]/2 = γ/2 − 3/2 + ½ log 2. ✓ EXACT match.
So with the crude bounds H_M ≥ log M + γ and H_M ≤ log(M+1) + γ... wait, I used H_K ≤ log(K+1) + γ. And then −½ log(K+1) with K+1 = n/2 exactly (n even). For n odd: K = (n−1)/2, K+1 = (n+1)/2, 2K+1 = n. Then A_K ≥ log n − ½ log((n+1)/2) + γ/2 − 1 = ½ log n − ½ log(1+1/n) + ½ log 2 + γ/2 − 1 ≥ ½ log n − 1/(2n) + ½ log 2 + γ/2 − 1.
And K = (n−1)/2 so −K = −(n−1)/2 ≥ −n/2.
n A_K − K ≥ ½ n log n + n(½ log 2 + γ/2 − 3/2) − 1/2 (from n·(−1/(2n))).
So in both cases: S_∞(n) ≥ ½ n log n + (C₁ − γ/2) n − 1 − (error terms) where error terms ≤ max(n/(n−1), 1/2) + ... let me redo carefully.
S_∞ ≥ (1−a₁)n − 1 + n·A_K − K.
Case n even:
- n·A_K ≥ ½n log n + (C₁−γ/2 − (1−a₁))n − n/(n−1) [from A_K ≥ ½ log n + ½log2 + γ/2 − 1 − 1/(n−1)]
Wait I need to redo: A_K ≥ ½ log n + ½ log 2 + γ/2 − 1 − 1/(n−1). Multiply by n: nA_K ≥ ½ n log n + n(½ log 2 + γ/2 − 1) − n/(n−1).
−K ≥ −n/2... hmm actually for n even K = q−1 = n/2 − 1, so −K = −n/2 + 1 ≥ −n/2.
S_∞ ≥ (1−a₁)n − 1 + ½ n log n + n(½log2 + γ/2 − 1) − n/(n−1) − n/2
= ½ n log n + (C₁−γ/2)n − 1 − n/(n−1) [since (1−a₁) + (½log2 + γ/2 − 1) − 1/2 = (1−a₁) + (C₁−γ/2) − (1−a₁) = C₁−γ/2 ✓]
So S_∞ ≥ target + 4 − 1 − n/(n−1) = target + 3 − n/(n−1) ≥ target + 3 − 20/19 > target + 1.9. Slack ~2 at n=20.
Case n odd:
S_∞ ≥ (1−a₁)n − 1 + ½ n log n + n(½ log 2 + γ/2 − 1) − 1/2 − (n−1)/2
= ½ n log n + (C₁ − γ/2)n − 1 − 1/2 + 1/2 = target + 4 − 1 = target + 3.
Wait: −(n−1)/2 = −n/2 + 1/2. So: (1−a₁)n + n(½log2 + γ/2 −1) − n/2 = (C₁−γ/2)n; constants: −1 − 1/2 + 1/2 = −1. So S_∞ ≥ target + 3. ✓
So with the crude bounds H_M ≥ log M + γ (i.e. H_M − log M ≥ γ, decreasing sequence) and H_M ≤ log(M+1) + γ (i.e. H_M − log(M+1) ≤ γ, increasing sequence), the bound holds with slack ≥ ~2 for all n ≥ 20 (and actually all n ≥ 2 in the odd case; even case needs n/(n−1) ≤ 3 i.e. n ≥ 2... n=2: n/(n−1) = 2, slack 1. Fine.)
Hmm wait, but I should double check the even case's log(n−1) bound and also whether I should just use sharper standard bounds. Actually, the key question: are these two harmonic bounds in Mathlib?
Mathlib (recent versions) has:
- `Real.eulerMascheroniConstant` : defined via `eulerMascheroniSeq`.
- I recall `Real.harmonic_le_log_add_one`? Not sure.
Let me search Mathlib source in the vendored repo. The zeta-23-lean repo has .lake/packages/mathlib. Let me grep for harmonic and eulerMascheroni lemmas.
Actually also needed:
- `Real.log_le_sub_one_of_pos`? For log n − log(n−1) ≤ 1/(n−1): log(1+x) ≤ x.
- Bernoulli: (1−1/m)ⁿ ≥ 1 − n/m: Mathlib has `one_sub_pow_le`? There's `Real.one_sub_pow_le`? There's `one_sub_pow_le_...`? Bernoulli's inequality in Mathlib: `Real.one_add_mul_le_pow`? Hmm: `one_add_le_pow`? There is `Real.add_one_le_exp`... Bernoulli: `(1 + r)^n ≥ 1 + n*r` for r ≥ −1... In Mathlib: `one_add_mul_le_pow` (for ℕ?) and for reals `Real.one_add_mul_le_pow : -1 ≤ r → 1 + n*r ≤ (1+r)^n`? Something like that. With r = −1/m: (1 − 1/m)ⁿ ≥ 1 − n/m ✓.
- Also h⁺ ≥ 0 for m > n: (1−1/m)ⁿ − 1 + n/m ≥ 0? For m > n: n/m < 1, so need (1−1/m)ⁿ ≥ 1 − n/m — same Bernoulli ✓. So actually h⁺ ≥ 0 for ALL m ≥ 2 by Bernoulli, and ≥ n/m − 1 always. For the truncation argument: tsum over nonneg family ≥ finite partial sum. We need the family nonneg everywhere and summable.
Plan for summability: term(m) = (1−1/m)ⁿ − 1 + n/m, with 0 ≤ term(m) ≤ C(n,2)/m²? Let me check the upper bound: (1−x)ⁿ ≤ 1 − nx + C(n,2)x² for x ∈ [0,1] — wait, is this right? Earlier: g(x) = 1 − nx + C(n,2)x² − (1−x)ⁿ, g''(x) = n(n−1)(1 − (1−x)^{n−2}) ≥ 0 for n ≥ 2, x∈[0,1]. g(0) = g'(0) = 0, so g ≥ 0 ✓. So term(m) = (1−1/m)ⁿ − 1 + n/m ≤ C(n,2)/m² ✓. But proving this in Lean requires a derivative argument or an algebraic one.
Alternative algebraic approach: (1−x)ⁿ = ((1−x))ⁿ. Hmm. Alternatively use the finite geometric/binomial identity:
1 − (1−x)ⁿ = x·Σ_{j=0}^{n−1} (1−x)^j.
Then term = n/m − (1/m)·Σ_{j=0}^{n−1}(1−1/m)^j = (1/m)·(n − Σ_{j=0}^{n−1}(1−1/m)^j) = (1/m)·Σ_{j=0}^{n−1}(1 − (1−1/m)^j).
Each 1 − (1−1/m)^j ≤ j/m (since (1−y)^j ≥ 1−jy). So term ≤ (1/m)·Σ_{j=0}^{n−1} j/m = (1/m²)·n(n−1)/2 = C(n,2)/m².
This is fully algebraic! Great: term(m) = (1/m)·Σ_{j=0}^{n−1} (1 − (1−1/m)^j), nonneg obviously (each 1 − (1−1/m)^j ≥ 0 since 0 ≤ 1−1/m < 1, so (1−1/m)^j ≤ 1), and ≤ (1/m)·Σ j/m = C(n,2)/m² via Bernoulli lower bound.
In Lean: `geom_series`? The identity 1 − yⁿ = (1−y)·Σ_{j<n} y^j is `mul_geom_sum` or `Commute.geom_sum₂_mul`... In Mathlib: `geom_sum_mul : (∑ i in range n, x^i) * (x - 1) = x^n - 1`. Yes.
So: summability by comparison with summable C/m² (Summable.of_nonneg_of_le with `Real.summable_one_div_nat_pow`... the subtype version: use `Summable.subtype` or `summable_subtype_iff`... Actually easier: show summability of the function on all ℕ by extending with 0 outside the subtype condition, then `Summable.subtype`. Or directly: `(summable_nat_add_iff 2)` etc. Let me not over-plan; details at write time.
Then `sum_le_tsum : (∀ i ∉ s, 0 ≤ f i) → Summable f → ∑ i in s, f i ≤ ∑' i, f i`. ✓ exists in Mathlib (Topology.Algebra.InfiniteSum... `sum_le_tsum`).
Then the finite sum: Σ_{k=1}^{K} (n/(2k+1) − 1) with the map k ↦ 2k+1 covering the subtype elements m ∈ [3, 2K+1] odd. The subtype finset: `{m : ℕ // Odd m ∧ 3 ≤ m}` filtered by ≤ n. Mapping to range K with m = 2k+1: use Finset.sum_bij or sum_image. Doable but fiddly.
Alternative simpler route: sum over k ∈ Finset.Icc 1 K directly with f(k) = term(2k+1), comparing termwise: term(2k+1) ≥ n/(2k+1) − 1. Then relate Σ_{k=1}^K term(2k+1) ≤ tsum over subtype: the set {2k+1 : 1 ≤ k ≤ K} is a finset of subtype elements; use sum_le_tsum with s = image of that map.
Then harmonic: A_K = Σ_{k=1}^K 1/(2k+1). Identity: Σ_{k=1}^K 1/(2k+1) = H_{2K+1} − ½H_K − 1. Proof: H_{2K+1} = Σ_{j=1}^{2K+1} 1/j = Σ_{even j≤2K} 1/j + Σ_{odd j≤2K+1} 1/j = ½H_K + (1 + Σ_{k=1}^K 1/(2k+1)). This is a finset manipulation: split range by parity — Mathlib might have `Finset.sum_range_even_odd`? Hmm. Could prove by induction on K, which is easy! A_{K+1} − A_K = 1/(2K+3); and RHS difference: H_{2K+3} − ½H_{K+1} − 1 − (H_{2K+1} − ½H_K − 1) = 1/(2K+2) + 1/(2K+3) − ½·(1/(K+1)) = 1/(2K+3) ✓. Induction is clean.
Now harmonic bounds in Mathlib. Need:
(a) H_M ≥ log M + γ for M ≥ 1.
(b) H_M ≤ log(M+1) + γ for M ≥ 1.
Hmm (b): is H_M − log(M+1) ≤ γ true? Sequence b_M = H_M − log(M+1): b_{M+1} − b_M = 1/(M+1) − log(1 + 1/(M+1)) ≥ 0 ✓ increasing, → γ. So b_M ≤ γ ✓.
Does Mathlib have these? I recall `Real.eulerMascheroniSeq` and convergence lemmas, maybe monotonicity. Let me grep the Mathlib source in the vendored packages directory.
Also needed: positivity/logs of concrete numbers for the final assembly — but actually the final assembly is purely algebraic given the coefficient identity! Let me re-examine: the assembly showed the coefficient of n matches EXACTLY (C₁ − γ/2), so no numerical estimates of γ, π needed except... hmm wait, really? Let me recheck: the γ and log 2 pieces combine. In the even case I got S_∞ ≥ target + 3 − n/(n−1) with no numerical constants evaluated — the identity [γ − 3 + log 2]/2 = (C₁−γ/2) − (1−a₁) is pure algebra from the definitions. So no decimal estimates needed at all! The proof is clean algebra + the two harmonic bounds + Bernoulli + summability.
But wait — one subtlety: I used log(n−1) ≥ log n − 1/(n−1) in the even case. log n − log(n−1) = log(n/(n−1)) = log(1 + 1/(n−1)) ≤ 1/(n−1) via log(1+x) ≤ x ✓ (Mathlib: `Real.log_le_sub_one_of_pos` or `Real.log_one_add_le`... there's `Real.log_le_sub_one_of_pos : 0 < x → log x ≤ x − 1`; so log(1+x) ≤ x from that).
Also in the odd case: −½log((n+1)/2) = −½ log(n+1) + ½ log 2, and I need −½ log(n+1) ≥ −½ log n − 1/(2n)? log(n+1) − log n = log(1+1/n) ≤ 1/n ✓.
Hmm wait, in the odd case I wrote A_K ≥ log n − ½ log((n+1)/2) + γ/2 − 1. Let me redo: A_K ≥ log(2K+1) + γ − ½(log(K+1) + γ) − 1. n odd: 2K+1 = n, K+1 = (n+1)/2. A_K ≥ log n − ½ log((n+1)/2) + γ/2 − 1.
−½ log((n+1)/2) = −½ log(n+1) + ½ log 2 ≥ −½ log n − 1/(2n) + ½ log 2.
A_K ≥ ½ log n + ½ log 2 + γ/2 − 1 − 1/(2n).
nA_K ≥ ½ n log n + n(½ log 2 + γ/2 − 1) − 1/2.
K = (n−1)/2. −K = −(n−1)/2.
S_∞ ≥ (1−a₁)n − 1 + ½ n log n + n(½log2 + γ/2 − 1) − 1/2 − (n−1)/2
= ½n log n + (C₁−γ/2)n + [−1 − 1/2 + 1/2] = target + 4 − 1 = target + 3. ✓
Even case redo: 2K+1 = n−1, K+1 = n/2.
A_K ≥ log(n−1) + γ − ½(log(n/2) + γ) − 1 = log(n−1) − ½ log n + ½ log 2 + γ/2 − 1.
log(n−1) ≥ log n − 1/(n−1).
A_K ≥ ½ log n + ½ log 2 + γ/2 − 1 − 1/(n−1).
nA_K ≥ ½ n log n + n(½log2 + γ/2 − 1) − n/(n−1).
K = n/2 − 1. −K = −n/2 + 1.
S_∞ ≥ (1−a₁)n − 1 + ½n log n + n(½log2 + γ/2 − 1) − n/(n−1) − n/2 + 1
= ½ n log n + (C₁−γ/2)n − n/(n−1).
Need ≥ target: −n/(n−1) ≥ −4 ⟺ n/(n−1) ≤ 4 ⟺ n ≥ 4/3 ✓ (n ≥ 20).
So even case: S_∞ ≥ target + 4 − n/(n−1) ≥ target + 4 − 20/19 > target. ✓
Odd case: target + 3 > target ✓.
Actually — hmm, wait. In the even case, there's a subtlety with H_K when K could be 0. n ≥ 20 so K ≥ 9, fine.
Also parity cases in Lean: n : ℕ, case on Even/Odd n. n = 2q: K = q − 1. n = 2q+1: K = q. Rather than K = ⌊(n−1)/2⌋, phrase directly: choose K with 2K+1 ≤ n and K ≥ (n−1)/2... Let me think about how to handle the casework cleanly in Lean. n ≥ 20. Write n = 2q or n = 2q+1 via `Nat.even_or_odd` / `Nat.mod_two_eq_zero_or_one`, or use `Nat.div2_val`... Simplest: `obtain ⟨q, rfl | rfl⟩ := Nat.even_or_odd n` gives n = 2q or n = 2q+1. Then set K := q−1 or K := q.
Then Σ_{k=1}^{K} term(2k+1) needs K ≥ 1 for the harmonic bound H_K etc. — fine (q ≥ 10).
Finset mapping: the subtype elements hit: {m // Odd m ∧ 3 ≤ m} with m = 2k+1, k ∈ Icc 1 K. Use `Finset.sum_le_sum` over image... Concretely:
have : (∑ k in Finset.Icc 1 K, hterm (2*k+1)) ≤ ∑' m : subtype, hterm m
via `sum_le_tsum` with s = (Finset.Icc 1 K).image (fun k => ⟨2*k+1, proof⟩). The image is a finset of subtype. Then `Finset.sum_image` (needs injectivity ✓) rewrites to ∑ k in Icc 1 K, hterm ↑(⟨2k+1, _⟩ : subtype) = ∑ term(2k+1).
Then termwise: term(2k+1) ≥ n/(2k+1) − 1 (Bernoulli: (1−1/m)ⁿ ≥ 1 − n/m).
And Σ_{k∈Icc 1 K} (n/(2k+1) − 1) = n·A_K − K where A_K = Σ 1/(2k+1) — rewrite as sum of difference, `Finset.sum_sub_distrib`, `← Finset.mul_sum`.
A_K = H_{2K+1} − ½H_K − 1 by induction (prove as standalone lemma over ℝ).
Harmonic bounds: H_M = `harmonic M` in Mathlib (`Real.harmonic : ℕ → ℝ`, `Real.harmonic n = ∑ i in range n, (i+1)⁻¹`). Note Mathlib's harmonic n = Σ_{i<n} 1/(i+1) = H_n ✓.
Bounds needed (for M ≥ 1):
(a) log M + γ ≤ H_M.
(b) H_M ≤ log(M+1) + γ.
Does Mathlib have these? I believe there is `Real.eulerMascheroniSeq` = harmonic (n+1) − log (n+1)?? and lemmas about it being ≤ γ or ≥ γ. Let me grep Mathlib. If not present, prove from integral comparison:
- log M = ∫₁^M dt/t ≤ Σ_{j=1}^{M−1} 1/j = H_M − 1/M... hmm: ∫₁^M dt/t ≤ Σ_{j=1}^{M-1} 1/j (left Riemann... since 1/t decreasing, ∫_j^{j+1} dt/t ≤ 1/j). So log M ≤ H_{M−1} = H_M − 1/M. That gives H_M ≥ log M + 1/M ≥ log M, not log M + γ.
The γ-shifted versions require knowing γ ≤ H_M − log M, i.e. properties of the Euler–Mascheroni limit. In Mathlib there are lemmas:
- `Real.eulerMascheroniSeq` : maybe defined as `harmonic n − log n`?
- `Real.eulerMascheroniSeq_le_eulerMascheroniConstant`?
I genuinely don't remember. Need to grep. If Mathlib lacks them, proving (a): H_M − log M is decreasing to γ, hence ≥ γ. Decreasing: (H_{M+1} − log(M+1)) − (H_M − log M) = 1/(M+1) − log(1+1/M) ≤ 0 since log(1+x) ≥ x/(1+x) i.e. log(1+1/M) ≥ 1/(M+1) ✓ (that's `Real.one_div_le_log...`? There's `Real.log_le_sub_one_of_pos` and `Real.one_sub_le_log...` hmm; standard: x/(1+x) ≤ log(1+x) ≤ x; Mathlib has `Real.log_one_add_le : log (1+x) ≤ x` for x > −1? and `Real.le_log_one_add...`?). Then a decreasing sequence converging to γ is ≥ γ. Convergence: `Real.tendsto_eulerMascheroniSeq` or similar exists (the constant is DEFINED as the limit, so tendsto holds by construction). Then ≥ γ via `le_of_tendsto` / `ge_of_tendsto` with eventually-monotone. Feasible: a few dozen lines.
Alternatively avoid γ entirely?? The γ appears in target coefficient (C₁ − γ/2) and in (1 − a₁); the γ's cancel in the algebra only if the harmonic bounds carry +γ in both directions... wait, in my assembly above: A_K lower bound = log(2K+1) + γ − ½(log(K+1) + γ) − 1 — the γ coefficient is 1 − 1/2 = 1/2, and the final identity uses γ/2. If instead I used cruder bounds without γ: H_M ≥ log M (lower) and H_M ≤ 1 + log M (upper): A_K ≥ log(2K+1) − ½(1 + log K) − 1 = log(2K+1) − ½ log K − 3/2. Then γ doesn't appear; coefficient comparison: need (1−a₁)n − 1 + n(½ log n + ½ log 2 − 3/2 ...) − n/2 ≥ target, where now the difference in the n-coefficient: (1−a₁) + ½ log 2 − 3/2 − 1/2... vs (C₁ − γ/2): (C₁−γ/2) − (1−a₁) = γ/2 − 3/2 + ½ log 2. Our lower-bound coefficient is ½ log 2 − 2 (from −3/2 − 1/2). Need ½ log 2 − 2 ≥ γ/2 − 3/2 + ½ log 2 ⟺ −1/2 ≥ γ/2 ⟺ γ ≤ −1. FALSE. So the γ-free crude bounds fail by exactly the γ term — that's why D-037 says the bound "is weak by (γ/2)n" (the true constant c₀ = −1/4 but our bound loses γ/2·n). So we MUST use γ-accurate harmonic bounds. OK.
So requirements from Mathlib or prove ourselves:
(H1) ∀ M ≥ 1, Real.log M + Real.eulerMascheroniConstant ≤ harmonic M.
(H2) ∀ M ≥ 1, harmonic M ≤ Real.log (M+1) + Real.eulerMascheroniConstant.
Let me check Mathlib. I recall there IS `Real.eulerMascheroniSeq` and recently (2024-2025) lemmas like `Real.harmonic_sub_log_...`. Let me grep the vendored Mathlib.
Let me now start: create todos, then grep Mathlib for harmonic/eulerMascheroni lemmas.
Build is healthy — 8 sorries remain, as expected. Now I'll set up the work plan and check what Mathlib gives us for the harmonic-number bounds (the key ingredient for `sInfty_lower_bound`).
tool: TodoWrite
input
{
"todos": [
{
"content": "Survey Mathlib for harmonic/eulerMascheroni bounds",
"status": "in_progress",
"activeForm": "Surveying Mathlib for harmonic bounds"
},
{
"content": "Prove harmonic bounds H1/H2 (log M + \u03b3 \u2264 H_M \u2264 log(M+1) + \u03b3) if missing",
"status": "pending",
"activeForm": "Proving harmonic bounds"
},
{
"content": "Prove summability + term bounds for SInfty series",
"status": "pending",
"activeForm": "Proving summability and term bounds"
},
{
"content": "Prove odd-harmonic identity A_K = H_{2K+1} \u2212 \u00bdH_K \u2212 1",
"status": "pending",
"activeForm": "Proving odd harmonic identity"
},
{
"content": "Assemble sInfty_lower_bound (parity cases, algebra)",
"status": "pending",
"activeForm": "Assembling sInfty_lower_bound"
},
{
"content": "Build + PrintAxioms audit",
"status": "pending",
"activeForm": "Building and auditing axioms"
},
{
"content": "Prove marginTilde_convex",
"status": "pending",
"activeForm": "Proving marginTilde_convex"
},
{
"content": "Session-end protocol (journal, db, STATE, NGUYEN.md, commit)",
"status": "pending",
"activeForm": "Running session-end protocol"
}
]
}
raw content_json (database row)
[{"type":"thinking","thinking":"Build is healthy. 8 sorries remain (1 in Suzuki, 4 in Valley, and in Li: lambda_pos_finite_height, sInfty_lower_bound, marginTilde_convex — that's 3; total 8. ✓).\n\nNow the sInfty_lower_bound proof. Let me think carefully about the mathematics and the Lean formalization.\n\nDefinitions:\n- `lagariasA1 = (log(4π) + γ)/2`\n- `SInfty n = (1 − a₁)·n − 1 + tsum_{m odd, 3 ≤ m} [(1−1/m)ⁿ − 1 + n/m]`\n- `lagariasC1 = (γ − 1 − log(2π))/2`\n- Goal: `(1/2)·n·log n + (C₁ − γ/2)·n − 4 ≤ SInfty n` for `20 ≤ n` (n : ℕ).\n\nMath steps from D-037 §3:\n1. Each term h⁺(m) = (1−1/m)ⁿ − 1 + n/m ≥ max(0, n/m − 1) (Bernoulli: (1−1/m)ⁿ ≥ 1 − n/m; also ≥ 0).\n2. Sum over odd m ≥ 3 with m ≤ n: terms ≥ n/m − 1 > 0. Truncate: sum over k = 1..K, m = 2k+1, K = ⌊(n−1)/2⌋.\n3. Σ h⁺ ≥ Σ_{k=1}^{K} (n/(2k+1) − 1) = n·(H_{2K+1} − ½H_K − 1) − K.\n4. Harmonic bounds: H_M ≥ log M + γ + 1/(2M) − 1/(12M²), H_M ≤ log M + γ + 1/(2M).\n5. Assembly gives S_∞(n) ≥ ½n log n + (C₁ − γ/2)n − 4 for n ≥ 20.\n\nThe D-037 statement says: `Σ h⁺ ≥ n[½ log n + (log 2 + γ)/2 − 1 − 2/n] − n/2` for n ≥ 4.\n\nHmm, this is a nontrivial formalization. Key hard parts in Lean/Mathlib:\n\nA. **Summability** of the family over the subtype `{m : ℕ // Odd m ∧ 3 ≤ m}`. Term ≈ C(n,2)/m². To prove `tsum ≥ Finset.sum over first K terms` for a nonneg family, we can use `tsum_le_tsum`? No — we want `sum_le_tsum`: for nonneg summable family, `∑ x in s, f x ≤ ∑' x, f x` (that's `sum_le_tsum` in Mathlib, requiring nonneg on the complement and summability).\n\nAlternatively, avoid proving summability of the exact family: use comparison. The term for m in subtype: (1−1/m)ⁿ − 1 + n/m. Bound: ≤ C/m² for some constant C depending on n? For fixed n: (1−1/m)ⁿ − 1 + n/m ≤ n/m (since (1−1/m)ⁿ ≤ 1)... that gives ≤ n/m which is not summable. Better: (1−1/m)ⁿ ≤ 1 − n/m + C(n,2)/m² (binomial/truncation)? For 0 ≤ x ≤ 1, (1−x)ⁿ ≤ 1 − nx + (n choose 2)x². Indeed (1−x)ⁿ = Σ (−1)^j C(n,j) x^j, and for x ≥ 0 the partial sums alternate... Actually (1−x)ⁿ ≤ 1 − nx + C(n,2)x² holds because the function (1−x)ⁿ − (1 − nx + C(n,2)x²) = −Σ_{j≥3}(−1)^j C(n,j)x^j... hmm, sign. Let g(x) = 1 − nx + C(n,2)x² − (1−x)ⁿ. g(0)=0, g'(x) = −n + 2C(n,2)x + n(1−x)^{n−1}, g'(0)=0, g''(x) = 2C(n,2) − n(n−1)(1−x)^{n−2} = n(n−1)(1 − (1−x)^{n−2}) ≥ 0 for x ∈ [0,1]. So g ≥ 0 on [0,1]. \n\nSo term ≤ C(n,2)/m², and summability follows by comparison with 1/m² (which over the subtype is summable since full Σ 1/m² is summable: `Real.summable_one_div_nat_pow` or similar — in Mathlib: `summable_one_div_nat_pow : Summable (fun n => 1/(n:ℝ)^p) ↔ 1 < p`).\n\nB. **The harmonic bound in Mathlib.** Is there an explicit bound `log M + γ ≤ H_M` etc.? Mathlib has `Real.eulerMascheroniConstant` with `Real.eulerMascheroniSeq` and theorems like `Real.eulerMascheroniSeq_lt_harmonic`? Let me recall: Mathlib defines `eulerMascheroniConstant` as limit of `harmonic n − log n`. There are results: `Real.log_add_one_le_harmonic`? Hmm. I recall:\n- `Real.harmonic_eq_sum_Icc`\n- `Real.eulerMascheroniSeq` defined as `harmonic n − log (n+1)`? \n\nActually in Mathlib: `Real.eulerMascheroniSeq n := harmonic (n+1) − Real.log (n+1)`? I'm not sure of exact form. There are lemmas about monotonicity giving `γ ≤ harmonic n − log n`... I need to check the Mathlib version pinned (v4.33.0-rc2, Mathlib rev 51e6992).\n\nThe explicit bounds `log M + γ + 1/(2M) − 1/(12M²) ≤ H_M ≤ log M + γ + 1/(2M)` are quite fine — 1/(12M²) precision. Mathlib likely does NOT have such sharp bounds. We'd have to prove them.\n\nHmm wait. Do we actually need such sharp bounds? The final bound has slack: E-023 V1 min slack 9.52 at n=20, growing 0.29n. The −4 constant absorbs errors. Let me redo the assembly with cruder bounds to see how much room we have.\n\nActually, let me carefully redo the math to find the crudest sufficient harmonic bounds.\n\nSetup: n ≥ 20, K = ⌊(n−1)/2⌋. \n\nΣ_{m odd ≥ 3} h⁺(m) ≥ Σ_{k=1}^{K} (n/(2k+1) − 1) [terms with m = 2k+1 ≤ n; for these n/m − 1 ≥ 0 so truncation keeps nonneg terms]\n\nWait: for m ≤ n, h⁺(m) ≥ n/m − 1 ≥ 0; for m > n we drop the terms (need h⁺ ≥ 0 there, true). K = ⌊(n−1)/2⌋ means 2K+1 ≤ n... for n even, n = 2q, K = ⌊(2q−1)/2⌋ = q−1, m_max = 2q−1 = n−1 ≤ n ✓. For n odd, n = 2q+1, K = q, m_max = 2q+1 = n ✓.\n\nS := Σ_{k=1}^{K} (n/(2k+1) − 1) = n·A_K − K where A_K = Σ_{k=1}^{K} 1/(2k+1) = H_{2K+1} − ½H_K − 1.\n\nS_∞(n) = (1−a₁)n − 1 + Σ h⁺ ≥ (1−a₁)n − 1 + n·A_K − K.\n\nTarget: ½n log n + (C₁ − γ/2)n − 4.\n\nNeed: (1−a₁)n − 1 + n·A_K − K ≥ ½n log n + (C₁−γ/2)n − 4.\n\nCoefficient check: 1 − a₁ = 1 − (log 4π + γ)/2. C₁ − γ/2 = (γ − 1 − log 2π)/2 − γ/2 = (−1 − log 2π)/2 = −1/2 − (log 2π)/2. And 1 − a₁ = 1 − (log 4 + log π)/2 − γ/2 = 1 − log 2 − (log π)/2 − γ/2.\n\nDifference: (1 − a₁) − (C₁ − γ/2) = 1 − log 2 − (log π)/2 − γ/2 + 1/2 + (log 2 + log π)/2 = 3/2 − log 2 − γ/2. Hmm let me just compute numerically: a₁ = (log(4π) + γ)/2 = (2.531024 + 0.577216)/2 = 1.554120. C₁ = (0.577216 − 1 − 1.837877)/2 = −1.130331. C₁ − γ/2 = −1.130331 − 0.288608 = −1.418939. 1 − a₁ = −0.554120. So we need:\n\n−0.554120·n − 1 + n·A_K − K ≥ 0.5·n·log n − 1.418939·n − 4\n⟺ n·A_K − K ≥ 0.5 n log n − 0.864819 n − 3.\n\nNow A_K = H_{2K+1} − ½H_K − 1. Lower bound: H_M ≥ log M + γ (standard, provable via integral comparison — this is the crude bound). Then:\n\nA_K ≥ log(2K+1) + γ − ½(log K + γ + 1/(2K)) − 1 [using upper bound H_K ≤ log K + γ + 1/(2K)]\n\nHmm, for the upper bound on H_K we need something. The crude upper bound H_M ≤ log M + 1 (integral comparison) is standard: H_M ≤ 1 + log M.\n\nLet's try with crude bounds: H_{2K+1} ≥ log(2K+1) + γ? Actually the standard inequality: log(M+1) ≤ H_M ≤ 1 + log M? Or with γ: H_M ≥ log M + γ is true for all M ≥ 1? The sequence H_M − log M decreases to γ, so H_M − log M ≥ γ for all M ✓. And H_M − log(M+1) increases to γ, so H_M ≤ log(M+1) + γ... hmm that gives H_K ≤ log(K+1) + γ.\n\nSo: A_K ≥ (log(2K+1) + γ) − ½(log(K+1) + γ) − 1 = log(2K+1) − ½ log(K+1) + γ/2 − 1.\n\nFor n even (n = 2q, K = q−1): 2K+1 = 2q−1 = n−1, K+1 = q = n/2.\nlog(n−1) − ½ log(n/2) + γ/2 − 1 ≥ log(n−1) − ½ log n + (log 2)/2 + γ/2 − 1... wait −½ log(n/2) = −½ log n + ½ log 2.\n\nHmm, log(n−1) ≥ log n − 1/(n−1) (since log n − log(n−1) = log(1 + 1/(n−1)) ≤ 1/(n−1)).\n\nA_K ≥ log n − 1/(n−1) − ½ log n + ½ log 2 + γ/2 − 1 = ½ log n + ½ log 2 + γ/2 − 1 − 1/(n−1).\n\nThen n·A_K − K ≥ ½ n log n + n(½ log 2 + γ/2 − 1) − n/(n−1) − K.\n\nK ≤ (n−1)/2 ≤ n/2. So −K ≥ −n/2.\n\nn·A_K − K ≥ ½ n log n + n(½ log 2 + γ/2 − 3/2) − n/(n−1).\n\nNeed ≥ ½ n log n − 0.864819 n − 3:\ncoefficient: ½ log 2 + γ/2 − 3/2 = 0.346574 + 0.288608 − 1.5 = −0.864818. \n\nWOW — it matches −0.864819 almost exactly! Let me double check: the target coefficient was (C₁ − γ/2) − (1 − a₁) = −1.418939 + 0.554120 = −0.864819. And crude-bounds coefficient: ½ log 2 + γ/2 − 3/2 = −0.8648182. These are equal EXACTLY? Let's verify symbolically: ½ log 2 + γ/2 − 3/2 vs (C₁ − γ/2) − (1 − a₁):\n\n(C₁ − γ/2) − (1 − a₁) = C₁ − γ/2 − 1 + a₁ = (γ − 1 − log 2π)/2 − γ/2 − 1 + (log 4π + γ)/2\n= [γ − 1 − log 2π − γ − 2 + log 4π + γ]/2 = [γ − 3 + log(4π/2π)]/2 = [γ − 3 + log 2]/2 = γ/2 − 3/2 + ½ log 2. ✓ EXACT match.\n\nSo with the crude bounds H_M ≥ log M + γ and H_M ≤ log(M+1) + γ... wait, I used H_K ≤ log(K+1) + γ. And then −½ log(K+1) with K+1 = n/2 exactly (n even). For n odd: K = (n−1)/2, K+1 = (n+1)/2, 2K+1 = n. Then A_K ≥ log n − ½ log((n+1)/2) + γ/2 − 1 = ½ log n − ½ log(1+1/n) + ½ log 2 + γ/2 − 1 ≥ ½ log n − 1/(2n) + ½ log 2 + γ/2 − 1.\n\nAnd K = (n−1)/2 so −K = −(n−1)/2 ≥ −n/2.\n\nn A_K − K ≥ ½ n log n + n(½ log 2 + γ/2 − 3/2) − 1/2 (from n·(−1/(2n))). \n\nSo in both cases: S_∞(n) ≥ ½ n log n + (C₁ − γ/2) n − 1 − (error terms) where error terms ≤ max(n/(n−1), 1/2) + ... let me redo carefully.\n\nS_∞ ≥ (1−a₁)n − 1 + n·A_K − K.\n\nCase n even:\n- n·A_K ≥ ½n log n + (C₁−γ/2 − (1−a₁))n − n/(n−1) [from A_K ≥ ½ log n + ½log2 + γ/2 − 1 − 1/(n−1)]\n\nWait I need to redo: A_K ≥ ½ log n + ½ log 2 + γ/2 − 1 − 1/(n−1). Multiply by n: nA_K ≥ ½ n log n + n(½ log 2 + γ/2 − 1) − n/(n−1).\n\n−K ≥ −n/2... hmm actually for n even K = q−1 = n/2 − 1, so −K = −n/2 + 1 ≥ −n/2.\n\nS_∞ ≥ (1−a₁)n − 1 + ½ n log n + n(½log2 + γ/2 − 1) − n/(n−1) − n/2\n = ½ n log n + (C₁−γ/2)n − 1 − n/(n−1) [since (1−a₁) + (½log2 + γ/2 − 1) − 1/2 = (1−a₁) + (C₁−γ/2) − (1−a₁) = C₁−γ/2 ✓]\n\nSo S_∞ ≥ target + 4 − 1 − n/(n−1) = target + 3 − n/(n−1) ≥ target + 3 − 20/19 > target + 1.9. Slack ~2 at n=20.\n\nCase n odd:\nS_∞ ≥ (1−a₁)n − 1 + ½ n log n + n(½ log 2 + γ/2 − 1) − 1/2 − (n−1)/2\n = ½ n log n + (C₁ − γ/2)n − 1 − 1/2 + 1/2 = target + 4 − 1 = target + 3.\n\nWait: −(n−1)/2 = −n/2 + 1/2. So: (1−a₁)n + n(½log2 + γ/2 −1) − n/2 = (C₁−γ/2)n; constants: −1 − 1/2 + 1/2 = −1. So S_∞ ≥ target + 3. ✓\n\nSo with the crude bounds H_M ≥ log M + γ (i.e. H_M − log M ≥ γ, decreasing sequence) and H_M ≤ log(M+1) + γ (i.e. H_M − log(M+1) ≤ γ, increasing sequence), the bound holds with slack ≥ ~2 for all n ≥ 20 (and actually all n ≥ 2 in the odd case; even case needs n/(n−1) ≤ 3 i.e. n ≥ 2... n=2: n/(n−1) = 2, slack 1. Fine.)\n\nHmm wait, but I should double check the even case's log(n−1) bound and also whether I should just use sharper standard bounds. Actually, the key question: are these two harmonic bounds in Mathlib?\n\nMathlib (recent versions) has:\n- `Real.eulerMascheroniConstant` : defined via `eulerMascheroniSeq`.\n- I recall `Real.harmonic_le_log_add_one`? Not sure.\n\nLet me search Mathlib source in the vendored repo. The zeta-23-lean repo has .lake/packages/mathlib. Let me grep for harmonic and eulerMascheroni lemmas.\n\nActually also needed:\n- `Real.log_le_sub_one_of_pos`? For log n − log(n−1) ≤ 1/(n−1): log(1+x) ≤ x.\n- Bernoulli: (1−1/m)ⁿ ≥ 1 − n/m: Mathlib has `one_sub_pow_le`? There's `Real.one_sub_pow_le`? There's `one_sub_pow_le_...`? Bernoulli's inequality in Mathlib: `Real.one_add_mul_le_pow`? Hmm: `one_add_le_pow`? There is `Real.add_one_le_exp`... Bernoulli: `(1 + r)^n ≥ 1 + n*r` for r ≥ −1... In Mathlib: `one_add_mul_le_pow` (for ℕ?) and for reals `Real.one_add_mul_le_pow : -1 ≤ r → 1 + n*r ≤ (1+r)^n`? Something like that. With r = −1/m: (1 − 1/m)ⁿ ≥ 1 − n/m ✓.\n- Also h⁺ ≥ 0 for m > n: (1−1/m)ⁿ − 1 + n/m ≥ 0? For m > n: n/m < 1, so need (1−1/m)ⁿ ≥ 1 − n/m — same Bernoulli ✓. So actually h⁺ ≥ 0 for ALL m ≥ 2 by Bernoulli, and ≥ n/m − 1 always. For the truncation argument: tsum over nonneg family ≥ finite partial sum. We need the family nonneg everywhere and summable.\n\nPlan for summability: term(m) = (1−1/m)ⁿ − 1 + n/m, with 0 ≤ term(m) ≤ C(n,2)/m²? Let me check the upper bound: (1−x)ⁿ ≤ 1 − nx + C(n,2)x² for x ∈ [0,1] — wait, is this right? Earlier: g(x) = 1 − nx + C(n,2)x² − (1−x)ⁿ, g''(x) = n(n−1)(1 − (1−x)^{n−2}) ≥ 0 for n ≥ 2, x∈[0,1]. g(0) = g'(0) = 0, so g ≥ 0 ✓. So term(m) = (1−1/m)ⁿ − 1 + n/m ≤ C(n,2)/m² ✓. But proving this in Lean requires a derivative argument or an algebraic one.\n\nAlternative algebraic approach: (1−x)ⁿ = ((1−x))ⁿ. Hmm. Alternatively use the finite geometric/binomial identity:\n\n1 − (1−x)ⁿ = x·Σ_{j=0}^{n−1} (1−x)^j.\n\nThen term = n/m − (1/m)·Σ_{j=0}^{n−1}(1−1/m)^j = (1/m)·(n − Σ_{j=0}^{n−1}(1−1/m)^j) = (1/m)·Σ_{j=0}^{n−1}(1 − (1−1/m)^j).\n\nEach 1 − (1−1/m)^j ≤ j/m (since (1−y)^j ≥ 1−jy). So term ≤ (1/m)·Σ_{j=0}^{n−1} j/m = (1/m²)·n(n−1)/2 = C(n,2)/m². \n\nThis is fully algebraic! Great: term(m) = (1/m)·Σ_{j=0}^{n−1} (1 − (1−1/m)^j), nonneg obviously (each 1 − (1−1/m)^j ≥ 0 since 0 ≤ 1−1/m < 1, so (1−1/m)^j ≤ 1), and ≤ (1/m)·Σ j/m = C(n,2)/m² via Bernoulli lower bound.\n\nIn Lean: `geom_series`? The identity 1 − yⁿ = (1−y)·Σ_{j<n} y^j is `mul_geom_sum` or `Commute.geom_sum₂_mul`... In Mathlib: `geom_sum_mul : (∑ i in range n, x^i) * (x - 1) = x^n - 1`. Yes.\n\nSo: summability by comparison with summable C/m² (Summable.of_nonneg_of_le with `Real.summable_one_div_nat_pow`... the subtype version: use `Summable.subtype` or `summable_subtype_iff`... Actually easier: show summability of the function on all ℕ by extending with 0 outside the subtype condition, then `Summable.subtype`. Or directly: `(summable_nat_add_iff 2)` etc. Let me not over-plan; details at write time.\n\nThen `sum_le_tsum : (∀ i ∉ s, 0 ≤ f i) → Summable f → ∑ i in s, f i ≤ ∑' i, f i`. ✓ exists in Mathlib (Topology.Algebra.InfiniteSum... `sum_le_tsum`).\n\nThen the finite sum: Σ_{k=1}^{K} (n/(2k+1) − 1) with the map k ↦ 2k+1 covering the subtype elements m ∈ [3, 2K+1] odd. The subtype finset: `{m : ℕ // Odd m ∧ 3 ≤ m}` filtered by ≤ n. Mapping to range K with m = 2k+1: use Finset.sum_bij or sum_image. Doable but fiddly.\n\nAlternative simpler route: sum over k ∈ Finset.Icc 1 K directly with f(k) = term(2k+1), comparing termwise: term(2k+1) ≥ n/(2k+1) − 1. Then relate Σ_{k=1}^K term(2k+1) ≤ tsum over subtype: the set {2k+1 : 1 ≤ k ≤ K} is a finset of subtype elements; use sum_le_tsum with s = image of that map.\n\nThen harmonic: A_K = Σ_{k=1}^K 1/(2k+1). Identity: Σ_{k=1}^K 1/(2k+1) = H_{2K+1} − ½H_K − 1. Proof: H_{2K+1} = Σ_{j=1}^{2K+1} 1/j = Σ_{even j≤2K} 1/j + Σ_{odd j≤2K+1} 1/j = ½H_K + (1 + Σ_{k=1}^K 1/(2k+1)). This is a finset manipulation: split range by parity — Mathlib might have `Finset.sum_range_even_odd`? Hmm. Could prove by induction on K, which is easy! A_{K+1} − A_K = 1/(2K+3); and RHS difference: H_{2K+3} − ½H_{K+1} − 1 − (H_{2K+1} − ½H_K − 1) = 1/(2K+2) + 1/(2K+3) − ½·(1/(K+1)) = 1/(2K+3) ✓. Induction is clean.\n\nNow harmonic bounds in Mathlib. Need:\n(a) H_M ≥ log M + γ for M ≥ 1.\n(b) H_M ≤ log(M+1) + γ for M ≥ 1.\n\nHmm (b): is H_M − log(M+1) ≤ γ true? Sequence b_M = H_M − log(M+1): b_{M+1} − b_M = 1/(M+1) − log(1 + 1/(M+1)) ≥ 0 ✓ increasing, → γ. So b_M ≤ γ ✓.\n\nDoes Mathlib have these? I recall `Real.eulerMascheroniSeq` and convergence lemmas, maybe monotonicity. Let me grep the Mathlib source in the vendored packages directory.\n\nAlso needed: positivity/logs of concrete numbers for the final assembly — but actually the final assembly is purely algebraic given the coefficient identity! Let me re-examine: the assembly showed the coefficient of n matches EXACTLY (C₁ − γ/2), so no numerical estimates of γ, π needed except... hmm wait, really? Let me recheck: the γ and log 2 pieces combine. In the even case I got S_∞ ≥ target + 3 − n/(n−1) with no numerical constants evaluated — the identity [γ − 3 + log 2]/2 = (C₁−γ/2) − (1−a₁) is pure algebra from the definitions. So no decimal estimates needed at all! The proof is clean algebra + the two harmonic bounds + Bernoulli + summability.\n\nBut wait — one subtlety: I used log(n−1) ≥ log n − 1/(n−1) in the even case. log n − log(n−1) = log(n/(n−1)) = log(1 + 1/(n−1)) ≤ 1/(n−1) via log(1+x) ≤ x ✓ (Mathlib: `Real.log_le_sub_one_of_pos` or `Real.log_one_add_le`... there's `Real.log_le_sub_one_of_pos : 0 < x → log x ≤ x − 1`; so log(1+x) ≤ x from that).\n\nAlso in the odd case: −½log((n+1)/2) = −½ log(n+1) + ½ log 2, and I need −½ log(n+1) ≥ −½ log n − 1/(2n)? log(n+1) − log n = log(1+1/n) ≤ 1/n ✓.\n\nHmm wait, in the odd case I wrote A_K ≥ log n − ½ log((n+1)/2) + γ/2 − 1. Let me redo: A_K ≥ log(2K+1) + γ − ½(log(K+1) + γ) − 1. n odd: 2K+1 = n, K+1 = (n+1)/2. A_K ≥ log n − ½ log((n+1)/2) + γ/2 − 1.\n\n−½ log((n+1)/2) = −½ log(n+1) + ½ log 2 ≥ −½ log n − 1/(2n) + ½ log 2.\n\nA_K ≥ ½ log n + ½ log 2 + γ/2 − 1 − 1/(2n).\n\nnA_K ≥ ½ n log n + n(½ log 2 + γ/2 − 1) − 1/2.\nK = (n−1)/2. −K = −(n−1)/2.\nS_∞ ≥ (1−a₁)n − 1 + ½ n log n + n(½log2 + γ/2 − 1) − 1/2 − (n−1)/2\n= ½n log n + (C₁−γ/2)n + [−1 − 1/2 + 1/2] = target + 4 − 1 = target + 3. ✓\n\nEven case redo: 2K+1 = n−1, K+1 = n/2.\nA_K ≥ log(n−1) + γ − ½(log(n/2) + γ) − 1 = log(n−1) − ½ log n + ½ log 2 + γ/2 − 1.\nlog(n−1) ≥ log n − 1/(n−1).\nA_K ≥ ½ log n + ½ log 2 + γ/2 − 1 − 1/(n−1).\nnA_K ≥ ½ n log n + n(½log2 + γ/2 − 1) − n/(n−1).\nK = n/2 − 1. −K = −n/2 + 1.\nS_∞ ≥ (1−a₁)n − 1 + ½n log n + n(½log2 + γ/2 − 1) − n/(n−1) − n/2 + 1\n= ½ n log n + (C₁−γ/2)n − n/(n−1).\nNeed ≥ target: −n/(n−1) ≥ −4 ⟺ n/(n−1) ≤ 4 ⟺ n ≥ 4/3 ✓ (n ≥ 20).\n\nSo even case: S_∞ ≥ target + 4 − n/(n−1) ≥ target + 4 − 20/19 > target. ✓\nOdd case: target + 3 > target ✓.\n\nActually — hmm, wait. In the even case, there's a subtlety with H_K when K could be 0. n ≥ 20 so K ≥ 9, fine.\n\nAlso parity cases in Lean: n : ℕ, case on Even/Odd n. n = 2q: K = q − 1. n = 2q+1: K = q. Rather than K = ⌊(n−1)/2⌋, phrase directly: choose K with 2K+1 ≤ n and K ≥ (n−1)/2... Let me think about how to handle the casework cleanly in Lean. n ≥ 20. Write n = 2q or n = 2q+1 via `Nat.even_or_odd` / `Nat.mod_two_eq_zero_or_one`, or use `Nat.div2_val`... Simplest: `obtain ⟨q, rfl | rfl⟩ := Nat.even_or_odd n` gives n = 2q or n = 2q+1. Then set K := q−1 or K := q.\n\nThen Σ_{k=1}^{K} term(2k+1) needs K ≥ 1 for the harmonic bound H_K etc. — fine (q ≥ 10).\n\nFinset mapping: the subtype elements hit: {m // Odd m ∧ 3 ≤ m} with m = 2k+1, k ∈ Icc 1 K. Use `Finset.sum_le_sum` over image... Concretely:\n\nhave : (∑ k in Finset.Icc 1 K, hterm (2*k+1)) ≤ ∑' m : subtype, hterm m\n\nvia `sum_le_tsum` with s = (Finset.Icc 1 K).image (fun k => ⟨2*k+1, proof⟩). The image is a finset of subtype. Then `Finset.sum_image` (needs injectivity ✓) rewrites to ∑ k in Icc 1 K, hterm ↑(⟨2k+1, _⟩ : subtype) = ∑ term(2k+1). \n\nThen termwise: term(2k+1) ≥ n/(2k+1) − 1 (Bernoulli: (1−1/m)ⁿ ≥ 1 − n/m).\n\nAnd Σ_{k∈Icc 1 K} (n/(2k+1) − 1) = n·A_K − K where A_K = Σ 1/(2k+1) — rewrite as sum of difference, `Finset.sum_sub_distrib`, `← Finset.mul_sum`.\n\nA_K = H_{2K+1} − ½H_K − 1 by induction (prove as standalone lemma over ℝ).\n\nHarmonic bounds: H_M = `harmonic M` in Mathlib (`Real.harmonic : ℕ → ℝ`, `Real.harmonic n = ∑ i in range n, (i+1)⁻¹`). Note Mathlib's harmonic n = Σ_{i<n} 1/(i+1) = H_n ✓.\n\nBounds needed (for M ≥ 1):\n(a) log M + γ ≤ H_M.\n(b) H_M ≤ log(M+1) + γ.\n\nDoes Mathlib have these? I believe there is `Real.eulerMascheroniSeq` = harmonic (n+1) − log (n+1)?? and lemmas about it being ≤ γ or ≥ γ. Let me grep Mathlib. If not present, prove from integral comparison:\n- log M = ∫₁^M dt/t ≤ Σ_{j=1}^{M−1} 1/j = H_M − 1/M... hmm: ∫₁^M dt/t ≤ Σ_{j=1}^{M-1} 1/j (left Riemann... since 1/t decreasing, ∫_j^{j+1} dt/t ≤ 1/j). So log M ≤ H_{M−1} = H_M − 1/M. That gives H_M ≥ log M + 1/M ≥ log M, not log M + γ.\n\nThe γ-shifted versions require knowing γ ≤ H_M − log M, i.e. properties of the Euler–Mascheroni limit. In Mathlib there are lemmas:\n- `Real.eulerMascheroniSeq` : maybe defined as `harmonic n − log n`?\n- `Real.eulerMascheroniSeq_le_eulerMascheroniConstant`? \n\nI genuinely don't remember. Need to grep. If Mathlib lacks them, proving (a): H_M − log M is decreasing to γ, hence ≥ γ. Decreasing: (H_{M+1} − log(M+1)) − (H_M − log M) = 1/(M+1) − log(1+1/M) ≤ 0 since log(1+x) ≥ x/(1+x) i.e. log(1+1/M) ≥ 1/(M+1) ✓ (that's `Real.one_div_le_log...`? There's `Real.log_le_sub_one_of_pos` and `Real.one_sub_le_log...` hmm; standard: x/(1+x) ≤ log(1+x) ≤ x; Mathlib has `Real.log_one_add_le : log (1+x) ≤ x` for x > −1? and `Real.le_log_one_add...`?). Then a decreasing sequence converging to γ is ≥ γ. Convergence: `Real.tendsto_eulerMascheroniSeq` or similar exists (the constant is DEFINED as the limit, so tendsto holds by construction). Then ≥ γ via `le_of_tendsto` / `ge_of_tendsto` with eventually-monotone. Feasible: a few dozen lines.\n\nAlternatively avoid γ entirely?? The γ appears in target coefficient (C₁ − γ/2) and in (1 − a₁); the γ's cancel in the algebra only if the harmonic bounds carry +γ in both directions... wait, in my assembly above: A_K lower bound = log(2K+1) + γ − ½(log(K+1) + γ) − 1 — the γ coefficient is 1 − 1/2 = 1/2, and the final identity uses γ/2. If instead I used cruder bounds without γ: H_M ≥ log M (lower) and H_M ≤ 1 + log M (upper): A_K ≥ log(2K+1) − ½(1 + log K) − 1 = log(2K+1) − ½ log K − 3/2. Then γ doesn't appear; coefficient comparison: need (1−a₁)n − 1 + n(½ log n + ½ log 2 − 3/2 ...) − n/2 ≥ target, where now the difference in the n-coefficient: (1−a₁) + ½ log 2 − 3/2 − 1/2... vs (C₁ − γ/2): (C₁−γ/2) − (1−a₁) = γ/2 − 3/2 + ½ log 2. Our lower-bound coefficient is ½ log 2 − 2 (from −3/2 − 1/2). Need ½ log 2 − 2 ≥ γ/2 − 3/2 + ½ log 2 ⟺ −1/2 ≥ γ/2 ⟺ γ ≤ −1. FALSE. So the γ-free crude bounds fail by exactly the γ term — that's why D-037 says the bound \"is weak by (γ/2)n\" (the true constant c₀ = −1/4 but our bound loses γ/2·n). So we MUST use γ-accurate harmonic bounds. OK.\n\nSo requirements from Mathlib or prove ourselves:\n(H1) ∀ M ≥ 1, Real.log M + Real.eulerMascheroniConstant ≤ harmonic M.\n(H2) ∀ M ≥ 1, harmonic M ≤ Real.log (M+1) + Real.eulerMascheroniConstant.\n\nLet me check Mathlib. I recall there IS `Real.eulerMascheroniSeq` and recently (2024-2025) lemmas like `Real.harmonic_sub_log_...`. Let me grep the vendored Mathlib.\n\nLet me now start: create todos, then grep Mathlib for harmonic/eulerMascheroni lemmas.","signature":""},{"type":"text","text":"Build is healthy — 8 sorries remain, as expected. Now I'll set up the work plan and check what Mathlib gives us for the harmonic-number bounds (the key ingredient for `sInfty_lower_bound`)."},{"type":"tool_use","id":"TodoWrite_9","name":"TodoWrite","input":{"todos":[{"content":"Survey Mathlib for harmonic/eulerMascheroni bounds","status":"in_progress","activeForm":"Surveying Mathlib for harmonic bounds"},{"content":"Prove harmonic bounds H1/H2 (log M + γ ≤ H_M ≤ log(M+1) + γ) if missing","status":"pending","activeForm":"Proving harmonic bounds"},{"content":"Prove summability + term bounds for SInfty series","status":"pending","activeForm":"Proving summability and term bounds"},{"content":"Prove odd-harmonic identity A_K = H_{2K+1} − ½H_K − 1","status":"pending","activeForm":"Proving odd harmonic identity"},{"content":"Assemble sInfty_lower_bound (parity cases, algebra)","status":"pending","activeForm":"Assembling sInfty_lower_bound"},{"content":"Build + PrintAxioms audit","status":"pending","activeForm":"Building and auditing axioms"},{"content":"Prove marginTilde_convex","status":"pending","activeForm":"Proving marginTilde_convex"},{"content":"Session-end protocol (journal, db, STATE, NGUYEN.md, commit)","status":"pending","activeForm":"Running session-end protocol"}]},"extra_content":null}]