Current task: —

← Session 22 — ii′-1: liCoeff pairing fix + residue machinery

#1022 assistant 2026-08-22 03:24:15.103 UTC · 598→4883 tok open ⤢
thinking (11277 chars)
`tsum_congr fun n => ... : ∑' n, c n • x^n = ...` — signature confirmed: `tsum_congr (h : ∀ n, f n = g n) : ∑' n, f n = ∑' n, g n` ✓ (it's probably to_additive-generated from `tprod_congr`, which is why plain grep missed the name — no, to_additive still writes "theorem tsum_congr"... whatever, the name resolves — the grep may have missed it due to where it's defined (maybe in a different file or with attribute). It exists. Moving on. Remaining unchecked: `tsum_eq_add_tsum_omit` — I saw `tsum_eq_add_tsum_ite` at Group.lean:186 area. Let me check what exists for omitting a single point: `tsum_eq_add_tsum_ite (hf : Summable f) (b : β) : ∑' n, f n = f b + ∑' n, ite (n = b) 0 (f n)`? That writes with ite, not subtype. For my lagariasA − 1 = Σ_{m odd≥3} step, maybe simpler to use tsum_eq_add_tsum_ite or restructure: lagariasA j := ∑' m : {m // Odd m}, (1/(m:ℝ))^j. I want: lagariasA j = 1 + ∑' m : {m // Odd m ∧ 3 ≤ m}, (1/(m:ℝ))^j for j ≥ 2. Alternative cleaner path — DEFINE lagariasA over {m // Odd m} and relate via tsum_eq_add_tsum_ite on the subtype {m // Odd m} omitting m := ⟨1, odd_one⟩: tsum_eq_add_tsum_ite : ∑' n, f n = f b + ∑' n, if n = b then 0 else f n — the ite form. Then ∑' n : {odd}, if n = ⟨1,_⟩ then 0 else (1/m)^j = ∑' n : {m // Odd m ∧ 3 ≤ m}, (1/m)^j — via an equivalence or via Summable.tsum_subtype... hmm still need subtype↔ite bridge. There might be `tsum_subtype` : ∑' x : {x // p x}, f x = ∑' x, if p x then f x else 0 — `tsum_subtype (s : Set α) (f) : ∑' x : s, f x = ∑' x, s.indicator f x`? I recall `tsum_subtype` exists: `theorem tsum_subtype (s : Set α) (f : α → M) : ∑' x : s, f x = ∑' x, s.indicator f x`? or the reverse `tsum_subtype'`. There's `tsum_subtype_eq_of_support_subset`... Alternatively — COMPLETELY different, much simpler approach for (ii): avoid the odd-≥1 subtype entirely. Define lagariasA j for j ≥ 2 DIRECTLY over the same subtype as SInfty: a_j := 1 + ∑' m : {m // Odd m ∧ 3 ≤ m}, (1/(m:ℝ))^j (j ≥ 2) with the "1 +" being the m = 1 term! Then Σ_{m odd≥3}(1/m)^j = a_j − 1 BY DEFINITION (defeq-ish: a_j − 1 = 1 + tsum − 1 = tsum — a ring step away, no tsum manipulation at all!). The mathematical content (a_j = Σ_{m odd ≥ 1} m^{−j}) is captured by the docstring; the (1−2^{−j})ζ(j) identification is ii′-3's concern. This is MUCH cleaner: ```lean /-- Lagarias's a_j (j ≥ 2): the odd-m zeta values Σ_{m odd ≥ 1} m^{−j}, encoded as 1 (the m = 1 term) + the odd ≥ 3 tail (the SInfty subtype). -/ def lagariasA (j : ℕ) : ℝ := if j = 1 then lagariasA1 else 1 + ∑' m : {m : ℕ // Odd m ∧ 3 ≤ m}, (1 / (m : ℝ)) ^ j ``` Then the swap gives: Σ_{m odd≥3} h⁺(m) = Σ_{j∈Icc 2 n} (−1)^j C(n,j)·(lagariasA j − 1) — with lagariasA j − 1 = tsum directly (if_neg (j ≠ 1 since j ≥ 2) then add_sub_cancel_left). But wait — for downstream (ii′-3, (4.10) in a-form: c_{k−1} = (−1)^k(a_k + σ_k) + (−1)^{k−1}), the a_k needed are the true Lagarias a_k = (1−2^{−k})ζ(k). My encoding as 1 + tail-sum is mathematically equal but ii′-3 will need the ζ(k) form — that's ii′-3's bridge to build (they'll prove lagariasA j = (1−2^{−j})ζ(j) as part of the (4.10) work, or re-encode). Fine — the ENCODING here just needs to be the odd-m series, which is what the swap needs and what (4.10)'s proof will consume. Good. Hmm — but there's a subtlety: is `if j = 1 then lagariasA1 else ...` the right encoding? For j = 0: lagariasA 0 = 1 + Σ (1/m)^0 = 1 + Σ 1 = junk/divergent-tsum-0. lagariasA 0 is never used (j ranges 1..n). Fine — junk at 0 acceptable (matches "if j = 1 ... else 1 + tsum" — for j = 0 the else branch gives junk 1 + 0 = 1 — harmless, never used). Also for the summability of the tail slices (j ≥ 2): Summable (fun m : {m // Odd m ∧ 3 ≤ m} => (1/(m:ℝ))^j): - bound: (1/m)^j ≤ (1/m)² for j ≥ 2, m ≥ 3... 1/m ≤ 1 ⟹ (1/m)^j ≤ (1/m)² ✓ pow_le_pow_right_of_le_one (0 ≤ 1/m, 1/m ≤ 1, 2 ≤ j). - Summable (fun m : subtype => (1/(m:ℝ))²): via Summable.subtype of summable_one_div_nat_pow (p=2, 1 < 2 ✓): Summable (fun m : ℕ => 1/(m:ℝ)²) → subtype — Summable.subtype (hf) (p : predicate) — from Group.lean:301 (Multipliable.subtype (hf) (p : β → Prop)) — to_additive: Summable.subtype (hf : Summable f) (p : β → Prop) : Summable (fun x : {x // p x} => f x) ✓ exactly my subtype ✓. - Then comparison: summable_of_nonneg_of_le : 0 ≤ f → f ≤ g → Summable g → Summable f ✓ (`summable_of_nonneg_of_le` exists ✓ standard). Now the swap (ii) in detail: ```lean theorem sInfty_eq_sum (n : ℕ) (hn : 1 ≤ n) : SInfty n = ∑ j ∈ Finset.Icc 1 n, (-1 : ℝ) ^ j * (n.choose j : ℝ) * lagariasA j ``` Proof: 1. h⁺ expansion: for m : {m // Odd m ∧ 3 ≤ m}, (1 − 1/(m:ℝ))^n − 1 + n/(m:ℝ) = ∑ j ∈ Finset.Icc 2 n, (−1)^j·C(n,j)·(1/(m:ℝ))^j. Proof: (1 − 1/m)^n = (−1/m + 1)^n = Σ_{k∈range(n+1)} (−1/m)^k·1^{n−k}·C(n,k) [add_pow] = Σ_k C(n,k)(−1)^k(1/m)^k. = 1 + C(n,1)(−1/m) + Σ_{k∈range(n−1)} C(n,k+2)(−1/m)^{k+2} [peel k=0 and k=1: sum_range_succ' twice?] hmm. Cleaner: 1 − X = −X + 1... I'll do: (1−1/m)^n − 1 + n/m = Σ_{j∈Icc 1 n} C(n,j)(−1)^j(1/m)^j + n/m — where Σ_{Icc 1 n} = the j=1 term + Σ_{Icc 2 n}: j=1 term: C(n,1)(−1)(1/m) = −n/m ✓ cancels +n/m. So: h⁺(m) = Σ_{j∈Icc 2 n} (−1)^j C(n,j)(1/m)^j + [−n/m + n/m] = the sum. In Lean: reuse one_sub_one_sub_pow?? That's for ℂ. Make it polymorphic? one_sub_one_sub_pow works over any CommRing: state it for ℝ separately or generalize: `lemma one_sub_one_sub_pow {R : Type*} [CommRing R] (n : ℕ) (x : R) : 1 − (1−x)^n = ∑ j ∈ Finset.Icc 1 n, (−1:R)^(j+1)·(n.choose j : R)·x^j` — with the cast n.choose j : R — Nat.choose cast to R ✓ works in a CommRing (CharZero not needed for the IDENTITY — the cast is just the natural map; the identity holds in ANY commutative ring: 1 − (1−x)^n = Σ (−1)^{j+1}C(n,j)x^j ✓). Make it polymorphic [CommRing R] — then use for both ℂ (i) and ℝ (ii) ✓ nice. For h⁺: (1 − 1/m)^n − 1 + n/m = −[1 − (1−1/m)^n] + n/m = −Σ_{j∈Icc 1 n} (−1)^{j+1}C(n,j)(1/m)^j + n/m = Σ_{j∈Icc 1 n} (−1)^j C(n,j)(1/m)^j + n/m. Split j = 1: for n ≥ 1: Icc 1 n = {1} ∪ Icc 2 n: `Finset.Icc 1 n = insert 1 (Finset.Icc 2 n)`? For n ≥ 1: `Finset.Icc_eq_insert...`? There's `Finset.Icc_erase_left`? Simpler: ∑_{Icc 1 n} f = f 1 + ∑_{Icc 2 n} f when 1 ≤ n: via `Finset.sum_Icc_succ_top`? no — I want bottom-peel. There's `Finset.sum_Icc_eq_sum_range`: ∑_{Icc 1 n} f j = ∑_{k∈range n} f(k+1) = f 1 + ∑_{k∈range(n−1)} f(k+2)?? getting messy. Alternative: prove the h⁺ identity directly as: h⁺(m) = Σ_{j∈Icc 2 n} (−1)^j C(n,j)(1/m)^j, via: (1−1/m)^n = 1 − n/m + Σ_{j∈Icc 2 n} (−1)^j C(n,j)(1/m)^j — a binomial identity with the first two terms peeled. Let me prove THIS directly: ```lean lemma one_sub_div_pow_eq (n : ℕ) (hn : 1 ≤ n) (x : ℝ) : (1 - x) ^ n = 1 - n * x + ∑ j ∈ Finset.Icc 2 n, (-1 : ℝ) ^ j * (n.choose j : ℝ) * x ^ j ``` Hmm — but with n = 1: Icc 2 1 = ∅: (1−x)^1 = 1 − x ✓ = 1 − 1·x + 0 ✓ works. Proof: from one_sub_one_sub_pow: 1 − (1−x)^n = Σ_{Icc 1 n} (−1)^{j+1}C(n,j)x^j — so (1−x)^n = 1 − Σ_{Icc 1 n} (−1)^{j+1}C(n,j)x^j = 1 + Σ_{Icc 1 n} (−1)^j C(n,j) x^j. Split: Icc 1 n = {1} ∪ Icc 2 n (n ≥ 1): Σ_{Icc 1 n} g j = g 1 + Σ_{Icc 2 n} g j with g 1 = (−1)^1 C(n,1) x = −n·x. So (1−x)^n = 1 + (−n x) + Σ_{Icc 2 n} = 1 − n x + Σ ✓. The split lemma: `Finset.Icc 1 n = insert 1 (Finset.Icc 2 n)` for 1 ≤ n: `Finset.Icc_insert_succ_left`? hmm — there's `Finset.Icc_succ_left`? Let me think: Icc 1 n with 1 ≤ n: 1 ∈ Icc 1 n ✓; Icc 1 n ∖ {1} = Icc 2 n: `Finset.Icc_erase_left : (Icc a b).erase a = Icc (a+1) b`? I recall `Finset.Icc_erase_left : (Finset.Icc a b).erase a = Finset.Icc (a + 1) b` ✓ probably exists. Then ∑_{Icc 1 n} g = g 1 + ∑_{(Icc 1 n).erase 1} g (Finset.sum_insert? — via `Finset.add_sum_erase`? `Finset.add_sum_erase (s) (f) (h : a ∈ s) : f a + ∑ x ∈ s.erase a, f x = ∑ x ∈ s, f x` ✓ exists). With 1 ∈ Icc 1 n (n ≥ 1: Finset.left_mem_Icc.mpr hn ✓). 2. The swap: Σ_{m} h⁺(m) = Σ_{m} Σ_{j∈Icc 2 n} c_j (1/m)^j = Σ_{j∈Icc 2 n} c_j Σ_m (1/m)^j [Summable.tsum_finsetSum — needs each slice summable: j ≥ 2 on Icc 2 n ✓] = Σ_{j∈Icc 2 n} c_j (lagariasA j − 1) [lagariasA j = 1 + tsum for j ≠ 1 ✓ j ≥ 2] 3. Assembly (as computed): SInfty n = (1−a₁)n − 1 + Σ_{Icc 2 n} (−1)^j C(n,j)(a_j − 1) and target Σ_{Icc 1 n} (−1)^j C(n,j) a_j = −n a₁ + Σ_{Icc 2 n} (−1)^j C(n,j) a_j — equality reduces to n − 1 = Σ_{Icc 2 n} (−1)^j C(n,j) — the alternating binomial: Σ_{j∈Icc 2 n} (−1)^j C(n,j) = n − 1 for n ≥ 1. Proof: 0 = (1 + (−1))^n = Σ_{k∈range(n+1)} (−1)^k·1^{n−k}·C(n,k) [add_pow with x := −1, y := 1: (−1+1)^n = Σ (−1)^k 1^{n−k} C(n,k)] = Σ_{k} (−1)^k C(n,k). And (1+(−1))^n = 0^n = 0 (n ≥ 1: zero_pow). So Σ_{k∈range(n+1)} (−1)^k C(n,k) = 0. Split k=0 (1) and k=1 (−n): Σ_{k∈range(n+1)} = 1 + (−n) + Σ_{k∈Icc 2 n}: via sum_range_succ' twice or the erase machinery. Get Σ_{Icc 2 n} (−1)^k C(n,k) = 0 − 1 + n = n − 1 ✓. In Lean (ℝ): ```lean lemma sum_Icc_two_choose (n : ℕ) (hn : 1 ≤ n) : ∑ j ∈ Finset.Icc 2 n, (-1 : ℝ) ^ j * (n.choose j : ℝ) = n - 1 ``` Proof: have h0 : (0:ℝ) = (1 + (-1))^n := by rw [add_neg_cancel...]; hmm (1 + (−1:ℝ))^n = 0^n = 0 (zero_pow (hn: 0 < n)); so 0 = Σ_{k∈range(n+1)} (−1)^k·1^{n−k}·C(n,k) [add_pow 1 (−1) — wait (1 + (−1))^n with add_pow 1 (−1) n : = Σ 1^k·(−1)^{n−k}·C(n,k) — different grading! Use add_pow (−1) 1: (−1 + 1)^n = Σ (−1)^k·1^{n−k}·C(n,k) ✓ and −1+1 = 0 (neg_add_cancel? add_neg_cancel: −1 + 1 = 0 — `neg_add_cancel : −a + a = 0`✓). So 0 = Σ_{k∈range(n+1)} (−1)^k·C(n,k) after simp [one_pow, mul_one]. Then Σ_{range(n+1)} g = g 0 + g 1 + Σ_{Icc 2 n}-ish... The cleanest: range(n+1) → Icc 0 n: `Finset.sum_range_eq_sum_Icc`? hmm: ∑_{k∈range(n+1)} g k = ∑_{k∈Icc 0 n} g k: `Finset.sum_range_eq_sum_Icc_succ_top`? or: Icc 0 n = range(n+1): `Finset.Icc_zero_eq_range`? There's `Finset.Icc_bot`... For ℕ: Finset.Icc 0 n = Finset.range (n+1): I recall `Finset.Icc_zero_eq_range : Finset.Icc 0 n = Finset.range (n + 1)`? not sure of the name. Alternative: keep range and peel twice with sum_range_succ': Σ_{k∈range(n+1)} g k = g 0 + Σ_{k∈range n} g(k+1) [sum_range_succ'] = g 0 + (g 1 + Σ_{k∈range(n−1)} g(k+2)) [sum_range_succ' again — needs range n = range((n−1)+1) — n ≥ 1: n − 1 + 1 = n — omega/Nat.sub_add_cancel hn]. And Σ_{Icc 2 n} g j = Σ_{k∈range(n+1−2)} g(k+2) [sum_Icc_eq_sum_range m=2] = Σ_{k∈range(n−1)} g(k+2) (n+1−2 = n−1 ✓). So: 0 = 1 + (−n) + Σ_{Icc 2 n} ⟹ Σ_{Icc 2 n} = n − 1 ✓. Wait — need sum_Icc_eq_sum_range's exact name — my earlier grep found nothing! Let me check: "sum_Icc_eq_sum_range" grep returned nothing. The actual lemma: `Finset.sum_Icc_eq_sum_range : ∑ i ∈ Finset.Icc m n, f i = ∑ i ∈ Finset.range (n + 1 - m), f (i + m)` — hmm grep found nothing for that name. Let me search alternatives: maybe it's `Finset.sum_Icc_eq_sum_range` in Mathlib/Algebra/BigOperators/Intervals.lean — my grep of that file found nothing?! Let me re-grep more carefully. Could be `Finset.Nat.sum_Icc_eq_sum_range` or in Mathlib/Algebra/BigOperators/Basic. Actually I recall: `Finset.sum_Icc_eq_sum_range (f : ℕ → M) (m n : ℕ) : ∑ i ∈ Finset.Icc m n, f i = ∑ i ∈ Finset.range (n + 1 - m), f (i + m)` — this definitely exists... or maybe it's stated with `Finset.range (n + 1 - m)` and f (i + m)... Let me verify by searching for "Icc_eq_sum_range" loosely.
All names confirmed except the Icc↔range conversion. Checking that plus a few alternatives.
tool: Bash
input
{
  "command": "cd \"D:/Python/Quantum/zeta-23-lean/.lake/packages/mathlib\" && grep -rn \"Icc_eq_sum_range\\|sum_range.*Icc\\|Icc.*range\" Mathlib/Algebra/BigOperators/Intervals.lean | head -6; echo ===; grep -rn \"sum_range_succ'\" Mathlib/Algebra/BigOperators/Basic.lean Mathlib/Algebra/BigOperators/Group/*.lean 2>/dev/null | head -3; echo ===; grep -rn \"Icc_erase_left\\|Icc_succ_left\\|left_mem_Icc\" Mathlib/Order/Interval/Finset/Basic.lean Mathlib/Order/Interval/Finset/Nat.lean 2>/dev/null | head -6",
  "description": "Verify Icc/range conversion and peel lemmas"
}
raw content_json (database row)
[{"type":"thinking","thinking":"`tsum_congr fun n => ... : ∑' n, c n • x^n = ...` — signature confirmed: `tsum_congr (h : ∀ n, f n = g n) : ∑' n, f n = ∑' n, g n` ✓ (it's probably to_additive-generated from `tprod_congr`, which is why plain grep missed the name — no, to_additive still writes \"theorem tsum_congr\"... whatever, the name resolves — the grep may have missed it due to where it's defined (maybe in a different file or with attribute). It exists. Moving on.\n\nRemaining unchecked: `tsum_eq_add_tsum_omit` — I saw `tsum_eq_add_tsum_ite` at Group.lean:186 area. Let me check what exists for omitting a single point: `tsum_eq_add_tsum_ite (hf : Summable f) (b : β) : ∑' n, f n = f b + ∑' n, ite (n = b) 0 (f n)`? That writes with ite, not subtype. For my lagariasA − 1 = Σ_{m odd≥3} step, maybe simpler to use tsum_eq_add_tsum_ite or restructure:\n\nlagariasA j := ∑' m : {m // Odd m}, (1/(m:ℝ))^j. I want: lagariasA j = 1 + ∑' m : {m // Odd m ∧ 3 ≤ m}, (1/(m:ℝ))^j for j ≥ 2.\n\nAlternative cleaner path — DEFINE lagariasA over {m // Odd m} and relate via tsum_eq_add_tsum_ite on the subtype {m // Odd m} omitting m := ⟨1, odd_one⟩:\ntsum_eq_add_tsum_ite : ∑' n, f n = f b + ∑' n, if n = b then 0 else f n — the ite form. Then ∑' n : {odd}, if n = ⟨1,_⟩ then 0 else (1/m)^j = ∑' n : {m // Odd m ∧ 3 ≤ m}, (1/m)^j — via an equivalence or via Summable.tsum_subtype... hmm still need subtype↔ite bridge. There might be `tsum_subtype` : ∑' x : {x // p x}, f x = ∑' x, if p x then f x else 0 — `tsum_subtype (s : Set α) (f) : ∑' x : s, f x = ∑' x, s.indicator f x`? I recall `tsum_subtype` exists: `theorem tsum_subtype (s : Set α) (f : α → M) : ∑' x : s, f x = ∑' x, s.indicator f x`? or the reverse `tsum_subtype'`. There's `tsum_subtype_eq_of_support_subset`... \n\nAlternatively — COMPLETELY different, much simpler approach for (ii): avoid the odd-≥1 subtype entirely. Define lagariasA j for j ≥ 2 DIRECTLY over the same subtype as SInfty:\n\na_j := 1 + ∑' m : {m // Odd m ∧ 3 ≤ m}, (1/(m:ℝ))^j  (j ≥ 2)\n\nwith the \"1 +\" being the m = 1 term! Then Σ_{m odd≥3}(1/m)^j = a_j − 1 BY DEFINITION (defeq-ish: a_j − 1 = 1 + tsum − 1 = tsum — a ring step away, no tsum manipulation at all!). The mathematical content (a_j = Σ_{m odd ≥ 1} m^{−j}) is captured by the docstring; the (1−2^{−j})ζ(j) identification is ii′-3's concern.\n\nThis is MUCH cleaner:\n```lean\n/-- Lagarias's a_j (j ≥ 2): the odd-m zeta values Σ_{m odd ≥ 1} m^{−j},\nencoded as 1 (the m = 1 term) + the odd ≥ 3 tail (the SInfty subtype). -/\ndef lagariasA (j : ℕ) : ℝ :=\n  if j = 1 then lagariasA1\n  else 1 + ∑' m : {m : ℕ // Odd m ∧ 3 ≤ m}, (1 / (m : ℝ)) ^ j\n```\nThen the swap gives: Σ_{m odd≥3} h⁺(m) = Σ_{j∈Icc 2 n} (−1)^j C(n,j)·(lagariasA j − 1) — with lagariasA j − 1 = tsum directly (if_neg (j ≠ 1 since j ≥ 2) then add_sub_cancel_left).\n\nBut wait — for downstream (ii′-3, (4.10) in a-form: c_{k−1} = (−1)^k(a_k + σ_k) + (−1)^{k−1}), the a_k needed are the true Lagarias a_k = (1−2^{−k})ζ(k). My encoding as 1 + tail-sum is mathematically equal but ii′-3 will need the ζ(k) form — that's ii′-3's bridge to build (they'll prove lagariasA j = (1−2^{−j})ζ(j) as part of the (4.10) work, or re-encode). Fine — the ENCODING here just needs to be the odd-m series, which is what the swap needs and what (4.10)'s proof will consume. Good.\n\nHmm — but there's a subtlety: is `if j = 1 then lagariasA1 else ...` the right encoding? For j = 0: lagariasA 0 = 1 + Σ (1/m)^0 = 1 + Σ 1 = junk/divergent-tsum-0. lagariasA 0 is never used (j ranges 1..n). Fine — junk at 0 acceptable (matches \"if j = 1 ... else 1 + tsum\" — for j = 0 the else branch gives junk 1 + 0 = 1 — harmless, never used).\n\nAlso for the summability of the tail slices (j ≥ 2): Summable (fun m : {m // Odd m ∧ 3 ≤ m} => (1/(m:ℝ))^j):\n- bound: (1/m)^j ≤ (1/m)² for j ≥ 2, m ≥ 3... 1/m ≤ 1 ⟹ (1/m)^j ≤ (1/m)² ✓ pow_le_pow_right_of_le_one (0 ≤ 1/m, 1/m ≤ 1, 2 ≤ j).\n- Summable (fun m : subtype => (1/(m:ℝ))²): via Summable.subtype of summable_one_div_nat_pow (p=2, 1 < 2 ✓): Summable (fun m : ℕ => 1/(m:ℝ)²) → subtype — Summable.subtype (hf) (p : predicate) — from Group.lean:301 (Multipliable.subtype (hf) (p : β → Prop)) — to_additive: Summable.subtype (hf : Summable f) (p : β → Prop) : Summable (fun x : {x // p x} => f x) ✓ exactly my subtype ✓.\n- Then comparison: summable_of_nonneg_of_le : 0 ≤ f → f ≤ g → Summable g → Summable f ✓ (`summable_of_nonneg_of_le` exists ✓ standard).\n\nNow the swap (ii) in detail:\n\n```lean\ntheorem sInfty_eq_sum (n : ℕ) (hn : 1 ≤ n) :\n    SInfty n = ∑ j ∈ Finset.Icc 1 n, (-1 : ℝ) ^ j * (n.choose j : ℝ) * lagariasA j\n```\n\nProof:\n1. h⁺ expansion: for m : {m // Odd m ∧ 3 ≤ m}, \n   (1 − 1/(m:ℝ))^n − 1 + n/(m:ℝ) = ∑ j ∈ Finset.Icc 2 n, (−1)^j·C(n,j)·(1/(m:ℝ))^j.\n   Proof: (1 − 1/m)^n = (−1/m + 1)^n = Σ_{k∈range(n+1)} (−1/m)^k·1^{n−k}·C(n,k) [add_pow] = Σ_k C(n,k)(−1)^k(1/m)^k.\n   = 1 + C(n,1)(−1/m) + Σ_{k∈range(n−1)} C(n,k+2)(−1/m)^{k+2} [peel k=0 and k=1: sum_range_succ' twice?] hmm.\n   \n   Cleaner: 1 − X = −X + 1... I'll do: (1−1/m)^n − 1 + n/m = Σ_{j∈Icc 1 n} C(n,j)(−1)^j(1/m)^j + n/m — where Σ_{Icc 1 n} = the j=1 term + Σ_{Icc 2 n}: j=1 term: C(n,1)(−1)(1/m) = −n/m ✓ cancels +n/m. \n   \n   So: h⁺(m) = Σ_{j∈Icc 2 n} (−1)^j C(n,j)(1/m)^j + [−n/m + n/m] = the sum.\n   \n   In Lean: reuse one_sub_one_sub_pow?? That's for ℂ. Make it polymorphic? one_sub_one_sub_pow works over any CommRing: state it for ℝ separately or generalize: `lemma one_sub_one_sub_pow {R : Type*} [CommRing R] (n : ℕ) (x : R) : 1 − (1−x)^n = ∑ j ∈ Finset.Icc 1 n, (−1:R)^(j+1)·(n.choose j : R)·x^j` — with the cast n.choose j : R — Nat.choose cast to R ✓ works in a CommRing (CharZero not needed for the IDENTITY — the cast is just the natural map; the identity holds in ANY commutative ring: 1 − (1−x)^n = Σ (−1)^{j+1}C(n,j)x^j ✓). Make it polymorphic [CommRing R] — then use for both ℂ (i) and ℝ (ii) ✓ nice.\n   \n   For h⁺: (1 − 1/m)^n − 1 + n/m = −[1 − (1−1/m)^n] + n/m = −Σ_{j∈Icc 1 n} (−1)^{j+1}C(n,j)(1/m)^j + n/m = Σ_{j∈Icc 1 n} (−1)^j C(n,j)(1/m)^j + n/m.\n   Split j = 1: for n ≥ 1: Icc 1 n = {1} ∪ Icc 2 n: `Finset.Icc 1 n = insert 1 (Finset.Icc 2 n)`? For n ≥ 1: `Finset.Icc_eq_insert...`? There's `Finset.Icc_erase_left`? Simpler: ∑_{Icc 1 n} f = f 1 + ∑_{Icc 2 n} f when 1 ≤ n: via `Finset.sum_Icc_succ_top`? no — I want bottom-peel. There's `Finset.sum_Icc_eq_sum_range`: ∑_{Icc 1 n} f j = ∑_{k∈range n} f(k+1) = f 1 + ∑_{k∈range(n−1)} f(k+2)?? getting messy. \n\n   Alternative: prove the h⁺ identity directly as:\n   h⁺(m) = Σ_{j∈Icc 2 n} (−1)^j C(n,j)(1/m)^j, via:\n   (1−1/m)^n = 1 − n/m + Σ_{j∈Icc 2 n} (−1)^j C(n,j)(1/m)^j — a binomial identity with the first two terms peeled. Let me prove THIS directly:\n   \n   ```lean\n   lemma one_sub_div_pow_eq (n : ℕ) (hn : 1 ≤ n) (x : ℝ) :\n       (1 - x) ^ n = 1 - n * x + ∑ j ∈ Finset.Icc 2 n, (-1 : ℝ) ^ j * (n.choose j : ℝ) * x ^ j\n   ```\n   Hmm — but with n = 1: Icc 2 1 = ∅: (1−x)^1 = 1 − x ✓ = 1 − 1·x + 0 ✓ works.\n   \n   Proof: from one_sub_one_sub_pow: 1 − (1−x)^n = Σ_{Icc 1 n} (−1)^{j+1}C(n,j)x^j — so (1−x)^n = 1 − Σ_{Icc 1 n} (−1)^{j+1}C(n,j)x^j = 1 + Σ_{Icc 1 n} (−1)^j C(n,j) x^j. Split: Icc 1 n = {1} ∪ Icc 2 n (n ≥ 1): \n   Σ_{Icc 1 n} g j = g 1 + Σ_{Icc 2 n} g j with g 1 = (−1)^1 C(n,1) x = −n·x.\n   So (1−x)^n = 1 + (−n x) + Σ_{Icc 2 n} = 1 − n x + Σ ✓.\n   \n   The split lemma: `Finset.Icc 1 n = insert 1 (Finset.Icc 2 n)` for 1 ≤ n: `Finset.Icc_insert_succ_left`? hmm — there's `Finset.Icc_succ_left`? Let me think: Icc 1 n with 1 ≤ n: 1 ∈ Icc 1 n ✓; Icc 1 n ∖ {1} = Icc 2 n: `Finset.Icc_erase_left : (Icc a b).erase a = Icc (a+1) b`? I recall `Finset.Icc_erase_left : (Finset.Icc a b).erase a = Finset.Icc (a + 1) b` ✓ probably exists. Then ∑_{Icc 1 n} g = g 1 + ∑_{(Icc 1 n).erase 1} g (Finset.sum_insert? — via `Finset.add_sum_erase`? `Finset.add_sum_erase (s) (f) (h : a ∈ s) : f a + ∑ x ∈ s.erase a, f x = ∑ x ∈ s, f x` ✓ exists). With 1 ∈ Icc 1 n (n ≥ 1: Finset.left_mem_Icc.mpr hn ✓).\n   \n2. The swap:\n   Σ_{m} h⁺(m) = Σ_{m} Σ_{j∈Icc 2 n} c_j (1/m)^j = Σ_{j∈Icc 2 n} c_j Σ_m (1/m)^j [Summable.tsum_finsetSum — needs each slice summable: j ≥ 2 on Icc 2 n ✓]\n   = Σ_{j∈Icc 2 n} c_j (lagariasA j − 1) [lagariasA j = 1 + tsum for j ≠ 1 ✓ j ≥ 2]\n   \n3. Assembly (as computed): SInfty n = (1−a₁)n − 1 + Σ_{Icc 2 n} (−1)^j C(n,j)(a_j − 1) and target Σ_{Icc 1 n} (−1)^j C(n,j) a_j = −n a₁ + Σ_{Icc 2 n} (−1)^j C(n,j) a_j — equality reduces to n − 1 = Σ_{Icc 2 n} (−1)^j C(n,j) — the alternating binomial:\n   Σ_{j∈Icc 2 n} (−1)^j C(n,j) = n − 1 for n ≥ 1.\n   Proof: 0 = (1 + (−1))^n = Σ_{k∈range(n+1)} (−1)^k·1^{n−k}·C(n,k) [add_pow with x := −1, y := 1: (−1+1)^n = Σ (−1)^k 1^{n−k} C(n,k)] = Σ_{k} (−1)^k C(n,k). And (1+(−1))^n = 0^n = 0 (n ≥ 1: zero_pow). So Σ_{k∈range(n+1)} (−1)^k C(n,k) = 0. Split k=0 (1) and k=1 (−n): Σ_{k∈range(n+1)} = 1 + (−n) + Σ_{k∈Icc 2 n}: via sum_range_succ' twice or the erase machinery. Get Σ_{Icc 2 n} (−1)^k C(n,k) = 0 − 1 + n = n − 1 ✓.\n   \n   In Lean (ℝ): \n   ```lean\n   lemma sum_Icc_two_choose (n : ℕ) (hn : 1 ≤ n) :\n       ∑ j ∈ Finset.Icc 2 n, (-1 : ℝ) ^ j * (n.choose j : ℝ) = n - 1\n   ```\n   Proof: have h0 : (0:ℝ) = (1 + (-1))^n := by rw [add_neg_cancel...]; hmm (1 + (−1:ℝ))^n = 0^n = 0 (zero_pow (hn: 0 < n)); so 0 = Σ_{k∈range(n+1)} (−1)^k·1^{n−k}·C(n,k) [add_pow 1 (−1) — wait (1 + (−1))^n with add_pow 1 (−1) n : = Σ 1^k·(−1)^{n−k}·C(n,k) — different grading! Use add_pow (−1) 1: (−1 + 1)^n = Σ (−1)^k·1^{n−k}·C(n,k) ✓ and −1+1 = 0 (neg_add_cancel? add_neg_cancel: −1 + 1 = 0 — `neg_add_cancel : −a + a = 0`✓). So 0 = Σ_{k∈range(n+1)} (−1)^k·C(n,k) after simp [one_pow, mul_one].\n   Then Σ_{range(n+1)} g = g 0 + g 1 + Σ_{Icc 2 n}-ish... The cleanest: range(n+1) → Icc 0 n: `Finset.sum_range_eq_sum_Icc`? hmm: ∑_{k∈range(n+1)} g k = ∑_{k∈Icc 0 n} g k: `Finset.sum_range_eq_sum_Icc_succ_top`? or: Icc 0 n = range(n+1): `Finset.Icc_zero_eq_range`? There's `Finset.Icc_bot`... For ℕ: Finset.Icc 0 n = Finset.range (n+1): I recall `Finset.Icc_zero_eq_range : Finset.Icc 0 n = Finset.range (n + 1)`? not sure of the name. Alternative: keep range and peel twice with sum_range_succ':\n   Σ_{k∈range(n+1)} g k = g 0 + Σ_{k∈range n} g(k+1) [sum_range_succ'] = g 0 + (g 1 + Σ_{k∈range(n−1)} g(k+2)) [sum_range_succ' again — needs range n = range((n−1)+1) — n ≥ 1: n − 1 + 1 = n — omega/Nat.sub_add_cancel hn].\n   And Σ_{Icc 2 n} g j = Σ_{k∈range(n+1−2)} g(k+2) [sum_Icc_eq_sum_range m=2] = Σ_{k∈range(n−1)} g(k+2) (n+1−2 = n−1 ✓).\n   So: 0 = 1 + (−n) + Σ_{Icc 2 n} ⟹ Σ_{Icc 2 n} = n − 1 ✓.\n   \n   Wait — need sum_Icc_eq_sum_range's exact name — my earlier grep found nothing! Let me check: \"sum_Icc_eq_sum_range\" grep returned nothing. The actual lemma: `Finset.sum_Icc_eq_sum_range : ∑ i ∈ Finset.Icc m n, f i = ∑ i ∈ Finset.range (n + 1 - m), f (i + m)` — hmm grep found nothing for that name. Let me search alternatives: maybe it's `Finset.sum_Icc_eq_sum_range` in Mathlib/Algebra/BigOperators/Intervals.lean — my grep of that file found nothing?! Let me re-grep more carefully. Could be `Finset.Nat.sum_Icc_eq_sum_range` or in Mathlib/Algebra/BigOperators/Basic. Actually I recall: `Finset.sum_Icc_eq_sum_range (f : ℕ → M) (m n : ℕ) : ∑ i ∈ Finset.Icc m n, f i = ∑ i ∈ Finset.range (n + 1 - m), f (i + m)` — this definitely exists... or maybe it's stated with `Finset.range (n + 1 - m)` and f (i + m)... Let me verify by searching for \"Icc_eq_sum_range\" loosely.","signature":""},{"type":"text","text":"All names confirmed except the Icc↔range conversion. Checking that plus a few alternatives."},{"type":"tool_use","id":"Bash_102","name":"Bash","input":{"command":"cd \"D:/Python/Quantum/zeta-23-lean/.lake/packages/mathlib\" && grep -rn \"Icc_eq_sum_range\\|sum_range.*Icc\\|Icc.*range\" Mathlib/Algebra/BigOperators/Intervals.lean | head -6; echo ===; grep -rn \"sum_range_succ'\" Mathlib/Algebra/BigOperators/Basic.lean Mathlib/Algebra/BigOperators/Group/*.lean 2>/dev/null | head -3; echo ===; grep -rn \"Icc_erase_left\\|Icc_succ_left\\|left_mem_Icc\" Mathlib/Order/Interval/Finset/Basic.lean Mathlib/Order/Interval/Finset/Nat.lean 2>/dev/null | head -6","description":"Verify Icc/range conversion and peel lemmas"},"extra_content":null}]