← Session 17 — Lean tier (i): elementary proofs (after crash)
thinking (9057 chars)
Mathlib has exactly what I need:
- `eulerMascheroniSeq_lt_eulerMascheroniConstant (n)`: `harmonic n − log(n+1) < γ` — gives (H2): H_M < log(M+1) + γ ✓ (strict, even better)
- `eulerMascheroniConstant_lt_eulerMascheroniSeq' (n)`: `γ < harmonic n − log n` for n ≥ 1 — gives (H1): log n + γ < H_n ✓ (strict)
Both are strict inequalities — perfect.
Note: `harmonic n` in Mathlib is a `ℚ` (Rational)! `harmonic_succ`, `Rat.cast_add` — yes, `Real.harmonic : ℕ → ℚ`? Actually in Mathlib, `harmonic : ℕ → ℚ` and it's cast. In eulerMascheroniSeq: `harmonic n - log (n+1)` where harmonic n is coerced ℚ → ℝ. So in my lemmas I need to handle `((harmonic n : ℚ) : ℝ)` or use `Real.harmonic`? Let me check Harmonic/Defs: likely `harmonic : ℕ → ℚ := ∑ i in range n, (i+1)⁻¹`. And there's `Real.harmonic` too? The file uses bare `harmonic n` inside ℝ expression, so coercion. For my work, I'll just define my own real harmonic sum or use `((harmonic n : ℚ) : ℝ)` — the coercion might be annoying for sum manipulations. Alternatively define H_M := ∑ j in range M, (j+1 : ℝ)⁻¹ and relate to `harmonic` by push_cast. `Real.harmonic_eq_sum_Icc`? there might be casting lemmas like `Rat.cast_sum`... `harmonic` has simp lemmas harmonic_zero, harmonic_succ. push_cast should handle `(harmonic n : ℝ) = ∑ i in range n, ((i+1 : ℚ)⁻¹ : ℝ)`... Doable.
Now the overall structure. This is a fairly big proof. Let me plan the Lean lemmas:
```lean
-- H1: for M ≥ 1: log M + γ ≤ harmonic M (strict in Mathlib, ≤ fine)
lemma harmonic_lower (M : ℕ) (hM : 1 ≤ M) : Real.log M + Real.eulerMascheroniConstant ≤ (harmonic M : ℝ)
-- from eulerMascheroniConstant_lt_eulerMascheroniSeq' M, with M ≠ 0; eulerMascheroniSeq' M = harmonic M − log M when M ≠ 0.
-- H2: harmonic M ≤ log (M+1) + γ
lemma harmonic_upper (M : ℕ) : (harmonic M : ℝ) ≤ Real.log (M+1) + Real.eulerMascheroniConstant
-- from eulerMascheroniSeq_lt_eulerMascheroniConstant M: eulerMascheroniSeq M = harmonic M − log(M+1) < γ.
```
For H2, note eulerMascheroniSeq M = harmonic M − log (M+1) where (M+1 : ℝ) — for M : ℕ, log (↑M + 1). Fine.
Term bounds:
```lean
-- term g(m) = (1 − 1/m)^n − 1 + n/m for m ≥ 2 (real m or nat m cast)
-- (i) 0 ≤ g(m) for m ≥ 1 (m ≥ 1: 1/m ≤ 1, Bernoulli)
-- (ii) g(m) ≤ C(n,2)/m² for m ≥ 1, via the geometric-sum factorization
```
Actually let's set g(n : ℕ)(m : ℝ) := (1 − 1/m)^n − 1 + n/m.
(i) Bernoulli: 1 − n/m ≤ (1 − 1/m)^n. Mathlib: `Real.one_sub_mul_le_pow`? Let me search: Bernoulli's inequality in Mathlib — I believe there's `Real.one_add_mul_le_pow : -1 ≤ r → 1 + n * r ≤ (1 + r)^n`? Hmm, there's `one_add_mul_le_pow` in Mathlib.Algebra.Order...? There's `Real.add_one_le_exp`... For integer powers: `one_add_mul_le_pow` exists in Mathlib.Algebra.GroupPower.Order? I recall `one_add_mul_le_pow : 1 + n * r ≤ (1 + r) ^ n` for `r : R` with `-1 ≤ r`? Not sure of exact name — search needed. There's also `pow_le_pow` routes. Alternatively prove Bernoulli by induction quickly. I'll search Mathlib for "one_add_mul_le_pow".
(ii) g(m) = (1/m)·Σ_{j<n} (1 − (1−1/m)^j): from 1 − y^n = (1−y)Σ_{j<n} y^j with y = 1−1/m, 1−y = 1/m.
n/m − (1 − y^n) = n/m − (1/m)Σ_{j<n} y^j = (1/m) Σ_{j<n} (1 − y^j) ✓.
Each term: 0 ≤ 1 − y^j ≤ j/m (Bernoulli again: y^j = (1−1/m)^j ≥ 1 − j/m).
Sum: Σ_{j<n} j = n(n−1)/2. So g(m) ≤ (1/m)·(1/m)·n(n−1)/2 = C(n,2)/m² ✓.
In Lean, geom sum: `geom_sum_eq` : for y ≠ 1, Σ_{j<n} y^j = (y^n − 1)/(y − 1). There's `geom_sum_mul : (∑ i in range n, x ^ i) * (x − 1) = x ^ n − 1` in a field. So (1 − y^n) = (1 − y)·Σ y^j: from geom_sum_mul: Σ * (y−1) = y^n − 1, so (1−y)·Σ = 1 − y^n ✓ by neg.
Summability: show `Summable fun m : subtype => g(n)(m)` where subtype = {m : ℕ // Odd m ∧ 3 ≤ m}. Approach: define h : ℕ → ℝ, h m = if (Odd m ∧ 3 ≤ m) then g n m else 0. Show Summable h via comparison: 0 ≤ h m ≤ C/m² for all m (m=0,1: h = 0; m ≥ 2 in the if-branch... wait m odd ≥ 3 means m ≥ 3). For m ≥ 1 with branch true: g ≤ C(n,2)/m². Comparison function: C(n,2)/m² — summable on ℕ? Σ 1/m² over ℕ: `Real.summable_one_div_nat_pow : Summable (fun n : ℕ => 1 / (n : ℝ)^p) ↔ 1 < p`? I think it's `summable_one_div_nat_pow` in Mathlib.Analysis.PSeries: `summable_one_div_nat_pow {p : ℕ} : Summable (fun n => 1 / (n : ℝ) ^ p) ↔ 1 < p`. Yes. With p=2, multiply by constant C(n,2): `Summable.mul_left`.
Then `Summable.subtype h _` gives summability on the subtype, and tsum over subtype equals tsum of h: `tsum_subtype`? There's `tsum_subtype : ∑' x : s, f x = ∑' x, indicator...`. Simpler: work with `Summable.subtype` and use `sum_le_tsum` on the subtype directly:
`sum_le_tsum (s : Finset ι) (hf : ∀ i ∉ s, 0 ≤ f i) (hf2 : Summable f) : ∑ i in s, f i ≤ ∑' i, f i` — I believe signature: `sum_le_tsum {f : ι → ℝ} (s : Finset ι) (hf : ∀ i, i ∉ s → 0 ≤ f i) (hf2 : Summable f)`. ✓.
With s = (Finset.Icc 1 K).image (fun k => ⟨2*k+1, _, _⟩). Nonneg on subtype everywhere: g n m ≥ 0 for all subtype elements m (m ≥ 3 ≥ 1 ✓ Bernoulli). ✓.
Odd harmonic identity: A_K = ∑_{k ∈ Icc 1 K} 1/(2k+1 : ℝ) = H_{2K+1} − ½H_K − 1 where H_M = harmonic as ℝ. Prove by induction on K. Base K=0: empty sum = 0; RHS: H_1 − 0 − 1 = 1 − 1 = 0 ✓. Step: A_{K+1} = A_K + 1/(2(K+1)+1) = A_K + 1/(2K+3). RHS: H_{2K+3} − ½H_{K+1} − 1 = H_{2K+1} + 1/(2K+2) + 1/(2K+3) − ½H_K − ½·1/(K+1) − 1 = A_K + 1/(2K+3) ✓ since 1/(2K+2) = ½·1/(K+1).
harmonic_succ: `harmonic (n+1) = harmonic n + 1/(n+1)` presumably (in ℚ). With casts, use push_cast.
Assembly: The final inequality. Let me now write the full chain in Lean-friendly form.
Set L = lagariasA1, C1 = lagariasC1, γ = eulerMascheroniConstant.
Goal: ½ n log n + (C1 − γ/2) n − 4 ≤ (1−L)n − 1 + T where T = tsum ≥ Σ_{k∈Icc 1 K} g(2k+1) ≥ Σ (n/(2k+1) − 1) = n·A_K − K.
Key identity: (C1 − γ/2) = (1 − L) + (γ/2 − 3/2 + ½ log 2)?? Let me verify: (1−L) + γ/2 − 3/2 + ½ log 2 = 1 − (log 4π + γ)/2 + γ/2 − 3/2 + ½ log 2 = −1/2 − (log 4π)/2 + ½ log 2 = −1/2 − ½(log 4π − log 2) = −1/2 − ½ log(2π) ✓. And C1 − γ/2 = (γ − 1 − log 2π)/2 − γ/2 = −1/2 − (log 2π)/2 ✓.
So (C1 − γ/2)·n = (1−L)·n + (γ/2 − 3/2 + ½ log 2)·n. Goal becomes:
½ n log n + (1−L)n + (γ/2 − 3/2 + ½ log 2)n − 4 ≤ (1−L)n − 1 + n A_K − K
⟺ ½ n log n + (γ/2 − 3/2 + ½ log 2)n − 4 ≤ −1 + n A_K − K
⟺ n·A_K ≥ ½ n log n + (γ/2 − 3/2 + ½ log 2)n + K − 3.
Now bound n A_K from below:
A_K ≥ log(2K+1) + γ − ½(log(K+1) + γ) − 1 = log(2K+1) − ½ log(K+1) + γ/2 − 1. [H1 on 2K+1, H2 on K]
So suffices: n(log(2K+1) − ½ log(K+1) + γ/2 − 1) ≥ ½ n log n + (γ/2 − 3/2 + ½ log 2)n + K − 3
⟺ n(log(2K+1) − ½ log(K+1)) ≥ ½ n log n + (−1/2 + ½ log 2)n + K − 3
⟺ n(log(2K+1) − ½ log(K+1) − ½ log n − ½ log 2) ≥ −n/2 + K − 3.
Case n = 2q (even), K = q−1 (q ≥ 10): 2K+1 = 2q−1 = n−1, K+1 = q = n/2.
LHS = n(log(n−1) − ½ log(n/2) − ½ log n − ½ log 2) = n(log(n−1) − ½[log n − log 2] − ½ log n − ½ log 2) = n(log(n−1) − log n).
So need: n(log(n−1) − log n) ≥ −n/2 + (n/2 − 1) − 3 = −4.
log n − log(n−1) = log(n/(n−1)) ≤ 1/(n−1) (log(1+x) ≤ x with x = 1/(n−1)).
n(log(n−1) − log n) ≥ −n/(n−1) ≥ −20/19 > −4 ✓. Actually even: need ≥ −4, and −n/(n−1) ≥ −2 for n ≥ 2. ✓
Case n = 2q+1 (odd), K = q (q ≥ 10): 2K+1 = n, K+1 = q+1 = (n+1)/2.
LHS = n(log n − ½ log((n+1)/2) − ½ log n − ½ log 2) = n(½ log n − ½ log(n+1) + ½ log 2 − ½ log 2) = ½ n (log n − log(n+1)).
Need: ½ n (log n − log(n+1)) ≥ −n/2 + (n−1)/2 − 3 = −7/2.
log(n+1) − log n = log(1 + 1/n) ≤ 1/n ⟹ ½ n(log n − log(n+1)) ≥ −1/2 ≥ −7/2 ✓.
Beautiful — fully algebraic, no numeric constants anywhere. Both cases have slack.
Lean details for the assembly:
- n : ℕ with 20 ≤ n. Case split: `Nat.even_or_odd n : Even n ∨ Odd n` — `Even n → ∃ r, n = r + r`; `Odd n → ∃ k, n = 2k+1`. For even, write n = q + q, then n = 2q via two_mul. q ≥ 10 since 20 ≤ 2q. Then K := q − 1, with q ≥ 10 so K ≥ 9, 2K+1 = 2q−1 = n−1: as naturals, 2(q−1)+1 = 2q−1 requires q ≥ 1 ✓.
Casts: careful with ℕ→ℝ casts: (n : ℝ) where n = 2q etc. Work with real variable q':= (q:ℝ), n' = 2q'. Maybe cleaner: do everything over ℝ with n' = (n:ℝ) and real K, but the sums are over ℕ indices so K must be ℕ. It's fine.
Log identities needed:
- log(n/2) = log n − log 2: `Real.log_div (ne) (ne)`.
- log((n+1)/2) = log(n+1) − log 2.
- log(1+x) ≤ x for x > −1... `Real.add_one_le_exp`? The standard: `Real.log_le_sub_one_of_pos : 0 < x → log x ≤ x − 1`. So log(n/(n−1)) = log(1 + 1/(n−1)) ≤ 1/(n−1): apply log_le_sub_one_of_pos to x = n/(n−1) > 0: log ≤ n/(n−1) − 1 = 1/(n−1) ✓.
- log(1 + 1/n) ≤ 1/n similarly.
Now the Bernoulli inequality in Mathlib: let me search for it. Candidates: `Real.one_add_mul_le_pow`, `one_add_mul_le_pow`, `Real.one_sub_le_pow`... Let me grep. Also `geom_sum_mul`.
Also `sum_le_tsum` exact name/signature — check Mathlib. Also `Summable.subtype`, `tsum_subtype`... Also `Real.summable_one_div_nat_pow` name.
Let me grep for these to pin names before writing code. Then write the proof in LiSkeleton.lean replacing the sorry. Since the proof is long, I'll write helper lemmas in the same file (or a new file LiSkeletonHelpers... better: keep in LiSkeleton.lean private lemmas before the theorem).
Let me grep Mathlib for the needed lemma names.
Mathlib has exactly the two bounds I need, in `Mathlib/NumberTheory/Harmonic/EulerMascheroni.lean`:
- `eulerMascheroniConstant_lt_eulerMascheroniSeq'` → **H1**: `log n + γ < harmonic n` (n ≥ 1)
- `eulerMascheroniSeq_lt_eulerMascheroniConstant` → **H2**: `harmonic n − log(n+1) < γ`
Now let me pin down the other lemma names I'll need (Bernoulli, geom sum, `sum_le_tsum`, p-series summability).
tool: Grep
input
{
"pattern": "theorem one_add_mul_le_pow|lemma one_add_mul_le_pow",
"path": "D:\\Python\\Quantum\\zeta-23-lean\\.lake\\packages\\mathlib\\Mathlib",
"output_mode": "content",
"-n": true,
"head_limit": 10
}
tool: Grep
input
{
"pattern": "theorem sum_le_tsum |lemma sum_le_tsum ",
"path": "D:\\Python\\Quantum\\zeta-23-lean\\.lake\\packages\\mathlib\\Mathlib",
"output_mode": "content",
"-n": true,
"-A": 3,
"head_limit": 15
}
tool: Grep ok
input
{
"pattern": "summable_one_div_nat_pow",
"path": "D:\\Python\\Quantum\\zeta-23-lean\\.lake\\packages\\mathlib\\Mathlib",
"output_mode": "content",
"-n": true,
"head_limit": 12
}
result 2026-08-20 04:04:29Z → 2026-08-29 02:35:31Z
mode='files_with_matches' num_files=0 filenames=[] content=None num_lines=None num_matches=None applied_limit=None applied_offset=None
raw content_json (database row)
[{"type":"thinking","thinking":"Mathlib has exactly what I need:\n\n- `eulerMascheroniSeq_lt_eulerMascheroniConstant (n)`: `harmonic n − log(n+1) < γ` — gives (H2): H_M < log(M+1) + γ ✓ (strict, even better)\n- `eulerMascheroniConstant_lt_eulerMascheroniSeq' (n)`: `γ < harmonic n − log n` for n ≥ 1 — gives (H1): log n + γ < H_n ✓ (strict)\n\nBoth are strict inequalities — perfect.\n\nNote: `harmonic n` in Mathlib is a `ℚ` (Rational)! `harmonic_succ`, `Rat.cast_add` — yes, `Real.harmonic : ℕ → ℚ`? Actually in Mathlib, `harmonic : ℕ → ℚ` and it's cast. In eulerMascheroniSeq: `harmonic n - log (n+1)` where harmonic n is coerced ℚ → ℝ. So in my lemmas I need to handle `((harmonic n : ℚ) : ℝ)` or use `Real.harmonic`? Let me check Harmonic/Defs: likely `harmonic : ℕ → ℚ := ∑ i in range n, (i+1)⁻¹`. And there's `Real.harmonic` too? The file uses bare `harmonic n` inside ℝ expression, so coercion. For my work, I'll just define my own real harmonic sum or use `((harmonic n : ℚ) : ℝ)` — the coercion might be annoying for sum manipulations. Alternatively define H_M := ∑ j in range M, (j+1 : ℝ)⁻¹ and relate to `harmonic` by push_cast. `Real.harmonic_eq_sum_Icc`? there might be casting lemmas like `Rat.cast_sum`... `harmonic` has simp lemmas harmonic_zero, harmonic_succ. push_cast should handle `(harmonic n : ℝ) = ∑ i in range n, ((i+1 : ℚ)⁻¹ : ℝ)`... Doable.\n\nNow the overall structure. This is a fairly big proof. Let me plan the Lean lemmas:\n\n```lean\n-- H1: for M ≥ 1: log M + γ ≤ harmonic M (strict in Mathlib, ≤ fine)\nlemma harmonic_lower (M : ℕ) (hM : 1 ≤ M) : Real.log M + Real.eulerMascheroniConstant ≤ (harmonic M : ℝ)\n-- from eulerMascheroniConstant_lt_eulerMascheroniSeq' M, with M ≠ 0; eulerMascheroniSeq' M = harmonic M − log M when M ≠ 0.\n\n-- H2: harmonic M ≤ log (M+1) + γ\nlemma harmonic_upper (M : ℕ) : (harmonic M : ℝ) ≤ Real.log (M+1) + Real.eulerMascheroniConstant\n-- from eulerMascheroniSeq_lt_eulerMascheroniConstant M: eulerMascheroniSeq M = harmonic M − log(M+1) < γ.\n```\n\nFor H2, note eulerMascheroniSeq M = harmonic M − log (M+1) where (M+1 : ℝ) — for M : ℕ, log (↑M + 1). Fine.\n\nTerm bounds:\n\n```lean\n-- term g(m) = (1 − 1/m)^n − 1 + n/m for m ≥ 2 (real m or nat m cast)\n-- (i) 0 ≤ g(m) for m ≥ 1 (m ≥ 1: 1/m ≤ 1, Bernoulli)\n-- (ii) g(m) ≤ C(n,2)/m² for m ≥ 1, via the geometric-sum factorization\n```\n\nActually let's set g(n : ℕ)(m : ℝ) := (1 − 1/m)^n − 1 + n/m.\n\n(i) Bernoulli: 1 − n/m ≤ (1 − 1/m)^n. Mathlib: `Real.one_sub_mul_le_pow`? Let me search: Bernoulli's inequality in Mathlib — I believe there's `Real.one_add_mul_le_pow : -1 ≤ r → 1 + n * r ≤ (1 + r)^n`? Hmm, there's `one_add_mul_le_pow` in Mathlib.Algebra.Order...? There's `Real.add_one_le_exp`... For integer powers: `one_add_mul_le_pow` exists in Mathlib.Algebra.GroupPower.Order? I recall `one_add_mul_le_pow : 1 + n * r ≤ (1 + r) ^ n` for `r : R` with `-1 ≤ r`? Not sure of exact name — search needed. There's also `pow_le_pow` routes. Alternatively prove Bernoulli by induction quickly. I'll search Mathlib for \"one_add_mul_le_pow\".\n\n(ii) g(m) = (1/m)·Σ_{j<n} (1 − (1−1/m)^j): from 1 − y^n = (1−y)Σ_{j<n} y^j with y = 1−1/m, 1−y = 1/m.\n n/m − (1 − y^n) = n/m − (1/m)Σ_{j<n} y^j = (1/m) Σ_{j<n} (1 − y^j) ✓.\n Each term: 0 ≤ 1 − y^j ≤ j/m (Bernoulli again: y^j = (1−1/m)^j ≥ 1 − j/m).\n Sum: Σ_{j<n} j = n(n−1)/2. So g(m) ≤ (1/m)·(1/m)·n(n−1)/2 = C(n,2)/m² ✓.\n\nIn Lean, geom sum: `geom_sum_eq` : for y ≠ 1, Σ_{j<n} y^j = (y^n − 1)/(y − 1). There's `geom_sum_mul : (∑ i in range n, x ^ i) * (x − 1) = x ^ n − 1` in a field. So (1 − y^n) = (1 − y)·Σ y^j: from geom_sum_mul: Σ * (y−1) = y^n − 1, so (1−y)·Σ = 1 − y^n ✓ by neg.\n\nSummability: show `Summable fun m : subtype => g(n)(m)` where subtype = {m : ℕ // Odd m ∧ 3 ≤ m}. Approach: define h : ℕ → ℝ, h m = if (Odd m ∧ 3 ≤ m) then g n m else 0. Show Summable h via comparison: 0 ≤ h m ≤ C/m² for all m (m=0,1: h = 0; m ≥ 2 in the if-branch... wait m odd ≥ 3 means m ≥ 3). For m ≥ 1 with branch true: g ≤ C(n,2)/m². Comparison function: C(n,2)/m² — summable on ℕ? Σ 1/m² over ℕ: `Real.summable_one_div_nat_pow : Summable (fun n : ℕ => 1 / (n : ℝ)^p) ↔ 1 < p`? I think it's `summable_one_div_nat_pow` in Mathlib.Analysis.PSeries: `summable_one_div_nat_pow {p : ℕ} : Summable (fun n => 1 / (n : ℝ) ^ p) ↔ 1 < p`. Yes. With p=2, multiply by constant C(n,2): `Summable.mul_left`.\n\nThen `Summable.subtype h _` gives summability on the subtype, and tsum over subtype equals tsum of h: `tsum_subtype`? There's `tsum_subtype : ∑' x : s, f x = ∑' x, indicator...`. Simpler: work with `Summable.subtype` and use `sum_le_tsum` on the subtype directly:\n\n`sum_le_tsum (s : Finset ι) (hf : ∀ i ∉ s, 0 ≤ f i) (hf2 : Summable f) : ∑ i in s, f i ≤ ∑' i, f i` — I believe signature: `sum_le_tsum {f : ι → ℝ} (s : Finset ι) (hf : ∀ i, i ∉ s → 0 ≤ f i) (hf2 : Summable f)`. ✓.\n\nWith s = (Finset.Icc 1 K).image (fun k => ⟨2*k+1, _, _⟩). Nonneg on subtype everywhere: g n m ≥ 0 for all subtype elements m (m ≥ 3 ≥ 1 ✓ Bernoulli). ✓.\n\nOdd harmonic identity: A_K = ∑_{k ∈ Icc 1 K} 1/(2k+1 : ℝ) = H_{2K+1} − ½H_K − 1 where H_M = harmonic as ℝ. Prove by induction on K. Base K=0: empty sum = 0; RHS: H_1 − 0 − 1 = 1 − 1 = 0 ✓. Step: A_{K+1} = A_K + 1/(2(K+1)+1) = A_K + 1/(2K+3). RHS: H_{2K+3} − ½H_{K+1} − 1 = H_{2K+1} + 1/(2K+2) + 1/(2K+3) − ½H_K − ½·1/(K+1) − 1 = A_K + 1/(2K+3) ✓ since 1/(2K+2) = ½·1/(K+1).\n\nharmonic_succ: `harmonic (n+1) = harmonic n + 1/(n+1)` presumably (in ℚ). With casts, use push_cast.\n\nAssembly: The final inequality. Let me now write the full chain in Lean-friendly form.\n\nSet L = lagariasA1, C1 = lagariasC1, γ = eulerMascheroniConstant.\n\nGoal: ½ n log n + (C1 − γ/2) n − 4 ≤ (1−L)n − 1 + T where T = tsum ≥ Σ_{k∈Icc 1 K} g(2k+1) ≥ Σ (n/(2k+1) − 1) = n·A_K − K.\n\nKey identity: (C1 − γ/2) = (1 − L) + (γ/2 − 3/2 + ½ log 2)?? Let me verify: (1−L) + γ/2 − 3/2 + ½ log 2 = 1 − (log 4π + γ)/2 + γ/2 − 3/2 + ½ log 2 = −1/2 − (log 4π)/2 + ½ log 2 = −1/2 − ½(log 4π − log 2) = −1/2 − ½ log(2π) ✓. And C1 − γ/2 = (γ − 1 − log 2π)/2 − γ/2 = −1/2 − (log 2π)/2 ✓. \n\nSo (C1 − γ/2)·n = (1−L)·n + (γ/2 − 3/2 + ½ log 2)·n. Goal becomes:\n\n½ n log n + (1−L)n + (γ/2 − 3/2 + ½ log 2)n − 4 ≤ (1−L)n − 1 + n A_K − K\n⟺ ½ n log n + (γ/2 − 3/2 + ½ log 2)n − 4 ≤ −1 + n A_K − K\n⟺ n·A_K ≥ ½ n log n + (γ/2 − 3/2 + ½ log 2)n + K − 3.\n\nNow bound n A_K from below:\nA_K ≥ log(2K+1) + γ − ½(log(K+1) + γ) − 1 = log(2K+1) − ½ log(K+1) + γ/2 − 1. [H1 on 2K+1, H2 on K]\n\nSo suffices: n(log(2K+1) − ½ log(K+1) + γ/2 − 1) ≥ ½ n log n + (γ/2 − 3/2 + ½ log 2)n + K − 3\n⟺ n(log(2K+1) − ½ log(K+1)) ≥ ½ n log n + (−1/2 + ½ log 2)n + K − 3\n⟺ n(log(2K+1) − ½ log(K+1) − ½ log n − ½ log 2) ≥ −n/2 + K − 3.\n\nCase n = 2q (even), K = q−1 (q ≥ 10): 2K+1 = 2q−1 = n−1, K+1 = q = n/2.\nLHS = n(log(n−1) − ½ log(n/2) − ½ log n − ½ log 2) = n(log(n−1) − ½[log n − log 2] − ½ log n − ½ log 2) = n(log(n−1) − log n).\nSo need: n(log(n−1) − log n) ≥ −n/2 + (n/2 − 1) − 3 = −4. \nlog n − log(n−1) = log(n/(n−1)) ≤ 1/(n−1) (log(1+x) ≤ x with x = 1/(n−1)).\nn(log(n−1) − log n) ≥ −n/(n−1) ≥ −20/19 > −4 ✓. Actually even: need ≥ −4, and −n/(n−1) ≥ −2 for n ≥ 2. ✓\n\nCase n = 2q+1 (odd), K = q (q ≥ 10): 2K+1 = n, K+1 = q+1 = (n+1)/2.\nLHS = n(log n − ½ log((n+1)/2) − ½ log n − ½ log 2) = n(½ log n − ½ log(n+1) + ½ log 2 − ½ log 2) = ½ n (log n − log(n+1)).\nNeed: ½ n (log n − log(n+1)) ≥ −n/2 + (n−1)/2 − 3 = −7/2.\nlog(n+1) − log n = log(1 + 1/n) ≤ 1/n ⟹ ½ n(log n − log(n+1)) ≥ −1/2 ≥ −7/2 ✓.\n\nBeautiful — fully algebraic, no numeric constants anywhere. Both cases have slack.\n\nLean details for the assembly:\n- n : ℕ with 20 ≤ n. Case split: `Nat.even_or_odd n : Even n ∨ Odd n` — `Even n → ∃ r, n = r + r`; `Odd n → ∃ k, n = 2k+1`. For even, write n = q + q, then n = 2q via two_mul. q ≥ 10 since 20 ≤ 2q. Then K := q − 1, with q ≥ 10 so K ≥ 9, 2K+1 = 2q−1 = n−1: as naturals, 2(q−1)+1 = 2q−1 requires q ≥ 1 ✓.\n\nCasts: careful with ℕ→ℝ casts: (n : ℝ) where n = 2q etc. Work with real variable q':= (q:ℝ), n' = 2q'. Maybe cleaner: do everything over ℝ with n' = (n:ℝ) and real K, but the sums are over ℕ indices so K must be ℕ. It's fine.\n\nLog identities needed:\n- log(n/2) = log n − log 2: `Real.log_div (ne) (ne)`.\n- log((n+1)/2) = log(n+1) − log 2.\n- log(1+x) ≤ x for x > −1... `Real.add_one_le_exp`? The standard: `Real.log_le_sub_one_of_pos : 0 < x → log x ≤ x − 1`. So log(n/(n−1)) = log(1 + 1/(n−1)) ≤ 1/(n−1): apply log_le_sub_one_of_pos to x = n/(n−1) > 0: log ≤ n/(n−1) − 1 = 1/(n−1) ✓.\n- log(1 + 1/n) ≤ 1/n similarly.\n\nNow the Bernoulli inequality in Mathlib: let me search for it. Candidates: `Real.one_add_mul_le_pow`, `one_add_mul_le_pow`, `Real.one_sub_le_pow`... Let me grep. Also `geom_sum_mul`.\n\nAlso `sum_le_tsum` exact name/signature — check Mathlib. Also `Summable.subtype`, `tsum_subtype`... Also `Real.summable_one_div_nat_pow` name.\n\nLet me grep for these to pin names before writing code. Then write the proof in LiSkeleton.lean replacing the sorry. Since the proof is long, I'll write helper lemmas in the same file (or a new file LiSkeletonHelpers... better: keep in LiSkeleton.lean private lemmas before the theorem).\n\nLet me grep Mathlib for the needed lemma names.","signature":""},{"type":"text","text":"Mathlib has exactly the two bounds I need, in `Mathlib/NumberTheory/Harmonic/EulerMascheroni.lean`:\n- `eulerMascheroniConstant_lt_eulerMascheroniSeq'` → **H1**: `log n + γ < harmonic n` (n ≥ 1)\n- `eulerMascheroniSeq_lt_eulerMascheroniConstant` → **H2**: `harmonic n − log(n+1) < γ`\n\nNow let me pin down the other lemma names I'll need (Bernoulli, geom sum, `sum_le_tsum`, p-series summability)."},{"type":"tool_use","id":"Grep_17","name":"Grep","input":{"pattern":"theorem one_add_mul_le_pow|lemma one_add_mul_le_pow","path":"D:\\Python\\Quantum\\zeta-23-lean\\.lake\\packages\\mathlib\\Mathlib","output_mode":"content","-n":true,"head_limit":10},"extra_content":null},{"type":"tool_use","id":"Grep_18","name":"Grep","input":{"pattern":"theorem sum_le_tsum |lemma sum_le_tsum ","path":"D:\\Python\\Quantum\\zeta-23-lean\\.lake\\packages\\mathlib\\Mathlib","output_mode":"content","-n":true,"-A":3,"head_limit":15},"extra_content":null},{"type":"tool_use","id":"Grep_19","name":"Grep","input":{"pattern":"summable_one_div_nat_pow","path":"D:\\Python\\Quantum\\zeta-23-lean\\.lake\\packages\\mathlib\\Mathlib","output_mode":"content","-n":true,"head_limit":12},"extra_content":null}]