← Session 31 — ii′-5f: tight R-bound 10.5/48 (piece 3 + pinch)
thinking (21966 chars)
1. The ring_nf timeout persists at 3155 — ring_nf is also too slow on this expression. The problem is likely the h9 rewrite creating a huge term that ring_nf's isDefEq check chokes on. Let me avoid the heavy normalization entirely — prove the equality term-by-term via tsum-congr-style: actually the equality I need is just algebra: 4.5·(c0+c1+c2)/D² = 4.5·(c0·(1/D²)+c1/D²+c2/D²). Let me prove it by `congr 1` then expand:
```
exact h2.trans (le_of_eq (by
have hD : ((10 : ℝ) + ((ℓ + 14 : ℕ) : ℝ)) = ((ℓ : ℝ) + 14) + 10 := by rw [hcast]; ring
rw [hD, h9]
-- goal: 4.5·(c0+0.433·log X+0.886·loglog X)/D² = 4.5·(c0·(1/D²)+0.433·log X/D²+0.886·loglog X/D²)
field_simp [show ((ℓ : ℝ) + 14 + 10) ^ 2 ≠ 0 by positivity]
ring))
```
Hmm — field_simp was the original timeout. The issue: field_simp + ring on this. Let me try a totally different approach — div_eq_mul_inv + mul_add:
```
rw [hD, h9, div_eq_mul_inv, mul_add, mul_add]
ring
```
div_eq_mul_inv : a/b = a·b⁻¹ — LHS: 4.5·(combo)·(D²)⁻¹; mul_add : 4.5·c0·(D²)⁻¹ + 4.5·(0.433·log X)·(D²)⁻¹ + 4.5·(0.886·loglog X)·(D²)⁻¹?? — mul_add : a·(b+c) = a·b+a·c — 4.5·(c0+c1+c2)·(D²)⁻¹ — the product is (4.5·(c0+c1+c2))·(D²)⁻¹ — mul_add matches (4.5)·((c0+c1+c2)·(D²)⁻¹)?? — the assoc: div_eq_mul_inv gives (4.5·(c0+c1+c2))·(D²)⁻¹ = 4.5·((c0+c1+c2)·(D²)⁻¹)?? — the elaborated form: HDiv (4.5·combo) D² → (4.5·combo)·(D²)⁻¹ — mul_add's pattern a·(b+c): with a = 4.5, b+c = combo·... no — the term is (4.5·combo)·(D²)⁻¹ = HMul (HMul 4.5 combo) (D²)⁻¹ — mul_add matches HMul 4.5 (combo·(D²)⁻¹)? — the inner HMul 4.5 combo: mul_add rewrites 4.5·(c0+c1+c2) → 4.5·c0+4.5·c1+4.5·c2 (two applications, each rewriting instances of the first unifier). Then the outer (·(D²)⁻¹): (4.5·c0+4.5·c1+4.5·c2)·(D²)⁻¹. The RHS: 4.5·(c0·(1/D²)+c1/D²+c2/D²) — div_eq_mul_inv inside: c1/D² = c1·(D²)⁻¹ etc. ring should close: (4.5·c0+4.5·c1+4.5·c2)·(D²)⁻¹ = 4.5·(c0·(D²)⁻¹+c1·(D²)⁻¹+c2·(D²)⁻¹) — YES by mul_add reversed — ring handles ✓. But ring also timed out before... the timeout might be ring's preprocessing on Real.log atoms?? ring treats Real.log X as an atom ✓ should be fast. The isDefEq timeout — maybe from ring's final check comparing huge expanded polynomials with the ↑ℓ casts.
ALTERNATIVE: avoid the equality entirely — bound the tsum directly per-term: the Summable.tsum_le_tsum hle gives tsum(farGLeftMaj(ℓ+14)) ≤ tsum(combo-form) — then bound tsum(combo-form) ≤ 4.5·(c0·(1/23)+0.433·0.1687+0.886·0.0621) via POINTWISE comparison with a 4-piece sum — actually, decompose the combo-form tsum INTO the four summand tsums FIRST (tsum_add/tsum_mul_left on the combo-form itself — that's an EQUALITY of tsums, which I already do in heval!). The heval part is where the pain is. Let me restructure heval to avoid tsum-level algebra on the combo: bound tsum(combo) ≤ tsum(c0·A + c1·B + c2·C expanded)...
Hmm wait — actually the real problem child is the `ring_nf`/`ring` in farGLeftMaj_shift_le (line 3155) — the equality inside farGLeftMaj_shift_le's le_of_eq. The heval error at 3199 is a DIFFERENT issue: `tsum_mul_left`'s pattern — the target has the UNMULTIPLIED form — my rw [tsum_mul_left] sequence: after `rw [tsum_mul_left]` (the 4.5), the goal is 4.5·(tsum A+B+C) ≤ 4.5·(combo): mul_le_mul... then `rw [Summable.tsum_add ...]` turned the tsum into pieces, then `rw [tsum_mul_left, tsum_mul_left, tsum_mul_left]` — the error at 3199: the third tsum_mul_left's pattern didn't match — after two tsum_mul_left rewrites, the remaining tsum is `∑' (x:ℕ), (c0·A + c1·B + c2·C)`?? — hmm, the Summable.tsum_add rewrote the sum-of-three into (A+B)+C form: ∑' (c0·A+c1·B) + ∑' c2·C — then tsum_add again: ∑' c0·A + ∑' c1·B + ∑' c2·C — then three tsum_mul_left: each rewrites ∑' (ci·fi) → ci·∑' fi — the FIRST tsum_mul_left rewrites the first match (c0·A) ✓, second rewrites c1·B ✓, third should rewrite c2·C — error says pattern not found with the goal showing `∑' (x:ℕ), ((c0·A) + (c1·B) + (c2·C)) ≤ ...` — wait — the goal display at 3199 shows the tsum as the UNEXPANDED sum: `∑' (x:ℕ), ((0.433*0.1942+0.886*736e-4+2.9)·A + 0.433·B + 0.886·C) ≤ combo` — so the Summable.tsum_add rewrites did NOT fire (the goal still has the summed form)! The `rw [Summable.tsum_add X Y]` — Summable.tsum_add (hf : Summable f) (hg : Summable g) : ∑' (f+g) = ∑' f + ∑' g — using it as a rewrite with EXPLICIT summability args: the pattern in the goal: ∑' (x:ℕ), (A-sum + B-sum + C-sum) — the function is fun x => c0·A x + c1·B x + c2·C x — Summable.tsum_add with my supplied f = (c0·A+c1·B)?? — I supplied `((tail14_inv_add_sq_summable.mul_left _).add (tail14_log_div_add_sq_summable.mul_left _))` as hf for f := (fun x => c0·A x + c1·B x)?? — wait — the tsum's function: (fun ℓ => c0·A ℓ + c1·B ℓ + c2·C ℓ) = ((fun ℓ => c0·A ℓ + c1·B ℓ) + (fun ℓ => c2·C ℓ))?? — Pi.add association: (f+g)+h = fun ℓ => (f+g) ℓ + h ℓ = (f ℓ + g ℓ) + h ℓ ✓ matches the left-nested form ✓. So Summable.tsum_add (hf : Summable (f+g)) (hg : Summable h) : ∑' ((f+g)+h) = ∑' (f+g) + ∑' h — my first rw [Summable.tsum_add ((...).add ...) (...)] — didn't fire — "did not find pattern ∑' (b), (?m·A + ?m·B + ?m·C)" — the pattern shows the f/g as METAVARS (?m.548 etc.) — meaning Summable.tsum_add's LHS is just ∑' (f+g) with f,g as arguments? No — Summable.tsum_add is an EQUATION: `Summable.tsum_add (hf : Summable f) (hg : Summable g) : ∑' x, (f x + g x) = ∑' x, f x + ∑' x, g x` — as a rewrite rule it rewrites `∑' x, (f x + g x)` where f,g are determined by the supplied hf/hg. The error's pattern shows ?m's — the supplied hf determined f := fun x => (0.433*0.1942+0.886*736e-4+2.9)·A x + 0.433·B x?? — hmm, hf := (tail14_inv_add_sq_summable.mul_left _).add (tail14_log_div_add_sq_summable.mul_left _) : Summable ((fun x => c0·A x) + (fun x => c1·B x)) = Summable (fun x => c0·A x + c1·B x) — with c0 := 0.433*0.1942+0.886*736e-4+2.9, c1 := 0.433 ✓. hg := tail14_loglog_div_add_sq_summable.mul_left _ : Summable (fun x => c2·C x) ✓. So the rewrite pattern: ∑' (fun x => (c0·A x + c1·B x) + c2·C x) — the goal's tsum function: fun x => (c0·A x + c1·B x + c2·C x) — the association (c0·A x + c1·B x) + c2·C x ✓ SHOULD match... The error pattern shows `?m.548 * (1/(...)²) + ?m.564·(log/²) + ?m.572·(loglog/²)` — three DISTINCT coeff metavars — so Lean read the GOAL's function as (c0·A + c1·B + c2·C) and my Summable.tsum_add's LHS as `∑' ((?f) + (?g))` — unification: the goal's function vs (f+g): f must be (c0·A+c1·B)-lambda: fun x => c0·A x + c1·B x — but my hf's type is Summable (fun x => c0·A x + c1·B x)?? — hmm — Summable.mul_left c : Summable (fun x => c·f x) — the mul_left's function is fun x => c0·A x ✓. The .add : Summable f → Summable g → Summable (f + g) — f+g is Pi.add — fun x => f x + g x — with the Pi.add form! The goal's function is written as `fun x => c0·A x + c1·B x + c2·C x` — a LAMBDA with adds inside, NOT a Pi.add application!! Summable.tsum_add's LHS is `∑' x, (f + g) x`?? — the statement: ∑' (f + g) — as a function — vs the goal's explicit lambda — defeq but not syntactic — rw needs syntactic match. The standard workaround: use Summable.tsum_add as a TERM not a rewrite: the heval should be built by calc/transitivity:
```
have heval : tsum-combo ≤ 4.5·(c0·(1/23)+0.433·0.1687+0.886·0.0621) := by
rw [tsum_mul_left]
apply mul_le_mul_of_nonneg_left _ (by norm_num)
-- goal: ∑' (fun x => c0·A x + c1·B x + c2·C x) ≤ combo
have hdecomp : (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))
= c0·(∑' x, A x) + 0.433·(∑' x, B x) + 0.886·(∑' x, C x) := by
rw [Summable.tsum_add (hAB) (hC), Summable.tsum_add (hA) (hB), tsum_mul_left, tsum_mul_left, tsum_mul_left]
```
— same rw problem for the =. The issue is whether the goal's tsum function syntactically matches ((f+g)+h). The goal after `rw [tsum_mul_left]` — WAIT — maybe the goal's function IS the combo-lambda from the lemma statement: fun ℓ => 4.5·(c0·A ℓ + ...) — after tsum_mul_left: fun ℓ => c0·A ℓ + c1·B ℓ + c2·C ℓ — still a lambda. Summable.tsum_add (hf)(hg) : ∑' x, (f x + g x) = ... — its LHS pattern is ∑' x, f x + g x with f and g as ARGS from hf/hg: hf : Summable f, hg : Summable g — with f = fun x => c0·A x + c1·B x and g = fun x => c2·C x: the LHS = ∑' x, ((fun x => c0·A x + c1·B x) x + c2·C x) — beta: c0·A x + c1·B x + c2·C x ✓ — rw should unify the goal's tsum with ∑' x, f x + g x — the goal is ∑' (fun x => c0·A x + c1·B x + c2·C x) — matching ∑' x, (f x + g x) with f = fun.., g = fun..: f x + g x = (fun x => c0·A x + c1·B x) x + c2·C x — rw's matching is up to reducible defeq — the beta-redex should unify... Apparently NOT (that's the error). The banked gotcha: "redex-RHS show-before-rw". Fix: state the goal's tsum with the (f+g)-form via `show`:
```
show (∑' x : ℕ, ((fun x => (c0·A x + c1·B x)) x + (fun x => c2·C x) x)) ≤ combo
```
— ugly. ALTERNATIVE: use `Summable.tsum_add` with the FUNCTION forms via `tsum_add` (the non-Summable-gated? no such). OR use `tsum_add` if it exists for summable via Summable.tsum_add — the clean fix: `rw [show (∑' x : ℕ, (c0·A x + c1·B x + c2·C x)) = ∑' x : ℕ, ((c0·A x + c1·B x) + c2·C x) from rfl]`?? — the show with the Pi.add body...
SIMPLEST ROBUST FIX: prove the decomposition equality via `tsum_add` doesn't exist, so instead use the LINEARITY through `Summable.tsum_le_tsum`-free paths: bound the combo-tsum ≤ combo via Summable.tsum_le_tsum with a DECOMPOSED majorant:
```
have hle2 : (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))
≤ c0·(1/23) + 0.433·0.1687 + 0.886·0.0621 := by
have hA0 ..., hA1 ..., hA2 ...
-- use: ∑' (c0·A + c1·B + c2·C) ≤ c0·S0 + c1·S1 + c2·S2 via
-- tsum_le_tsum against the constant majorant? no — via the add/mul_left tsum EQUALITIES.
```
Hmm. The equalities ARE needed. Let me look at how LiCircleBound's zero_tail_inv_sq_le did the analogous step — it used `Summable.tsum_add` and `tsum_mul_left`? From my reading earlier (htotal): `calc ∑' j, F j ≤ ∑' j, (4A₀/X)·G j := Summable.tsum_le_tsum hFle hFsum hGsum; _ = (4A₀/X)·(10 log 2 + 2 log X) := by rw [tsum_mul_left, hGtotal]; _ ≤ ...` — only ONE tsum_mul_left — and the G-function was a single form. And tsum_dyadic_log used Summable.tsum_add successfully: `rw [hsplit, Summable.tsum_add (hlinH.summable.mul_left _) (hgeom2H.mul_left _)]` — there the hsplit FIRST rewrote the function into the (f + g)-lambda form: `have hsplit : (fun j => ...) = fun j => L·(j·r^j) + (4L+logX)·r^j := by funext j; ...` — and then Summable.tsum_add fired — because hsplit made the function EXACTLY `fun j => (L·(j·r^j)) + ((4L+logX)·r^j)` — a single lambda whose body is (f-term + g-term) — and Summable.tsum_add's LHS `∑' x, (f x + g x)` — hmm — how did that match? Because the goal after rw [hsplit] is ∑' (fun j => L·(j·r^j) + (4L+logX)·r^j) — and Summable.tsum_add (hf)(hg) with f = fun j => L·(j·r^j), g = fun j => (4L+logX)·r^j: LHS = ∑' x, (f x + g x) — rw matched fine there! So why does mine fail? — because of the THREE-term nesting and the (f+g)+h association. In tsum_dyadic_log, there were TWO terms only. For three: ∑' ((f+g)+h) = ∑' (f+g) + ∑' h: the goal's lambda: fun x => (f x + g x) + h x — my goal's lambda: fun x => c0·A x + c1·B x + c2·C x — that IS ((c0·A + c1·B) + c2·C)-form?? — parses as (c0·A x + c1·B x) + c2·C x ✓ — matches (f'+h) with f' = (c0·A+c1·B)-lambda ✓ should work... unless the elaboration of my hf's type gave a DIFFERENT f'. hf := (h1.mul_left _).add (h2.mul_left _) : Summable ((fun x => c0·A x) + (fun x => c1·B x)) — the f' here is the Pi.add ((fun x => c0·A x) + (fun x => c1·B x)) — NOT the lambda fun x => c0·A x + c1·B x!! Pi.add vs lambda-with-plus — DEFEQ but not syntactic — that's the mismatch! tsum_dyadic_log worked because hsplit wrote the function as a lambda and Summable.tsum_add unified up to reducible (Pi.add applied to x reduces to the plus-form ✓). Hmm — but then it should unify for mine too... The Summable.add returns Summable (f + g) with Pi.add — and Summable.tsum_add's hf : Summable f — the f is inferred from hf's TYPE: f := (fun x => c0·A x) + (fun x => c1·B x) (Pi.add). Then the LHS pattern: ∑' x, ((Pi.add f₁ f₂) x + g x) — beta-reducible to c0·A x + c1·B x + c2·C x ✓ — rw SHOULD unify reducibly... The error suggests it didn't. Whatever — let me use the tsum_dyadic_log approach: FIRST rewrite the goal's function into the EXPLICIT Pi.add form via a show/funext, THEN apply Summable.tsum_add. OR simpler: give the decomposition via `Summable.tsum_le_tsum` pointwise:
combo-tsum ≤ tsum(fun x => c0·A x + c1·B x + c2·C x)·... no that's the same.
ALTERNATIVE clean approach: bound the combo-tsum via `Summable.tsum_le_tsum` against the CONSTANT family: no.
Let me just use the funext approach:
```
have hdecomp : (∑' x : ℕ, ((0.433*0.1942+0.886*0.0736+2.9)·(1/(((x:ℝ)+14)+10)^2)
+ 0.433·(log((x:ℝ)+14)/(((x:ℝ)+14)+10)^2)
+ 0.886·(loglog((x:ℝ)+14)/(((x:ℝ)+14)+10)^2)))
= (0.433*0.1942+0.886*0.0736+2.9)·(∑' x : ℕ, 1/(((x:ℝ)+14)+10)^2)
+ 0.433·(∑' x : ℕ, log((x:ℝ)+14)/(((x:ℝ)+14)+10)^2)
+ 0.886·(∑' x : ℕ, loglog((x:ℝ)+14)/(((x:ℝ)+14)+10)^2) := by
rw [show (fun x : ℕ => (c0·(A x) + c1·(B x) + c2·(C x)))
= (fun x : ℕ => c0·(A x) + c1·(B x)) + (fun x : ℕ => c2·(C x)) from by
funext x; simp only [Pi.add_apply]]
rw [Summable.tsum_add hf' hg, Summable.tsum_add hf1 hf2, tsum_mul_left, tsum_mul_left, tsum_mul_left]
```
— with the explicit function forms ascribed so f'/hf1/hf2/hg match syntactically. This is getting really messy. PRAGMATIC: use `Summable.tsum_le_tsum` to bound the combo-tsum by the (c0·A+c1·B+c2·C)-tsum is an equality...
You know what — CLEANEST: avoid the whole heval-in-ℝ approach. Bound farGLeftMaj_series_le directly with THREE separate Summable.tsum_le_tsum calls on a decomposed pointwise bound:
- farGLeftMaj (ℓ+14) ≤ 4.5·(c0·A ℓ) + 4.5·(0.433·B ℓ) + 4.5·(0.886·C ℓ)?? — no, it's ONE inequality with the sum on the RHS.
Hmm — alternative: bound the farGLeftMaj tsum by summing the four scalar families directly:
```
have hpt2 : ∀ ℓ : ℕ, farGLeftMaj (ℓ + 14)
≤ (4.5 * (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)) * (1/(((ℓ:ℝ)+14)+10)^2)
+ (4.5 * 0.433) * (log((ℓ:ℝ)+14)/(((ℓ:ℝ)+14)+10)^2)
+ (4.5 * 0.886) * (loglog((ℓ:ℝ)+14)/(((ℓ:ℝ)+14)+10)^2) := farGLeftMaj_shift_le-ish (rewrite the RHS association — the current shift_le's RHS is 4.5·(c0·A + 0.433·B + 0.886·C): 4.5·(c0·A + 0.433·B + 0.886·C) = (4.5·c0)·A + (4.5·0.433)·B + (4.5·0.886)·C by ring — prove the variant by rw + ring on hpt's RHS... — ring on THAT should be fast (no logs? has logs as atoms ✓).
```
Then: tsum(farGLeftMaj(ℓ+14)) ≤ tsum(RHS-form) = (4.5·c0)·S0 + (4.5·0.433)·S1 + (4.5·0.886)·S2 — the decomposition: AGAIN tsum_add ×2 + tsum_mul_left ×3 — same problem. UNLESS: bound tsum(RHS) ≤ (4.5·c0)·S0+(4.5·0.433)·S1+(4.5·0.886)·S2 via... tsum_le_tsum is pointwise, not for decomposition.
OK — let me just accept the funext/show approach for the decomposition. Write it carefully:
```
have hdecomp : (∑' x : ℕ,
(4.5 * (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)) * (1 / (((x : ℝ) + 14) + 10) ^ 2)
+ (4.5 * 0.433) * (Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2)
+ (4.5 * 0.886) * (Real.log (Real.log ((x : ℝ) + 14)) / (((x : ℝ) + 14) + 10) ^ 2))
= (4.5 * (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)) * (1 / 23)
+ (4.5 * 0.433) * 0.1687 + (4.5 * 0.886) * 0.0621 := by
```
NO — that's an inequality direction too. ARGH.
Let me look at exactly how the goal's tsum function looks and why Summable.tsum_add fails. The heval goal after `rw [tsum_mul_left]` + `apply mul_le_mul_of_nonneg_left _ ...`:
`∑' (x : ℕ), ((0.433*0.1942+0.886*736e-4+2.9)·(1/((↑x+14+10)^2)) + 0.433·(Real.log (↑x+14)/(↑x+14+10)^2) + 0.886·(Real.log (Real.log (↑x+14))/(↑x+14+10)^2)) ≤ combo`
Summable.tsum_add (hf : Summable f) (hg : Summable g) : ∑' x, (f x + g x) = ∑' x, f x + ∑' x, g x. To rewrite the goal's tsum: pattern `∑' x, f x + g x` — Lean 4 rw can match with f, g determined by hf, hg. hf := ((...).add (...)) : Summable ((fun x => c0·A x) + (fun x => c1·B x)) — so f := (fun x => c0·A x) + (fun x => c1·B x) (Pi.add). The pattern: ∑' x, (f x + g x) = ∑' x, (Pi.add (fun c0·A) (fun c1·B)) x + (fun c2·C) x — reducible-unify with the goal's body `c0·A x + c1·B x + c2·C x`: (Pi.add ..) x → c0·A x + c1·B x ✓ then + c2·C x ✓ — association (c0·A x + c1·B x) + c2·C x ✓ matches. Why did it fail?! The error message's "target expression" shows the goal — and the pattern `∑' (b : ℕ), (?m.548·(1/..²) + ?m.564·(log/..²) + ?m.572·(loglog/..²))` — the pattern has THREE SEPARATE coefficient-metavars for the three terms — this is `∑' x, (?c0·A x + ?c1·B x + ?c2·C x)` — that's tsum_add applied TWICE mentally — no wait — the error is from `rw [tsum_mul_left, tsum_mul_left, tsum_mul_left]` — the FIRST tsum_mul_left fired (c0), the second (c1), the THIRD failed?? The pattern shown (?m.548·A + ?m.564·B + ?m.572·C) — tsum_mul_left's LHS is ∑' x, (c·f x) with c,f metavars — the displayed pattern is the union of all three attempts?? The error at 3199 says "Did not find the pattern ∑' (b:ℕ), (?m.548·(1/..²) + ?m.564·(log/..²) + ?m.572·(loglog/..²))" — that's the pattern AFTER my Summable.tsum_add rewrites supposedly...
I'm going in circles. PRAGMATIC: replace the entire heval decomposition with a robust approach — `Summable.tsum_le_tsum` to move to a sum of THREE separate tsums is NOT possible directly. Instead use `tsum_add` via the calc with EXPLICIT function names via `set`:
Actually — the ROBUST way: `Summable.tsum_add` as a TERM-level equality:
```
have hdecomp : (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))
= c0·(∑' x, A x) + c1·(∑' x, B x) + c2·(∑' x, C x) := by
have e1 := Summable.tsum_add (f := fun x : ℕ => c0·A x + c1·B x) (g := fun x : ℕ => c2·C x)
(by exact hf') (by exact hg)
-- e1 : ∑' x, ((fun x => c0·A x + c1·B x) x + (fun x => c2·C x) x) = ...
rw [show (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))
= ∑' x : ℕ, ((fun x => c0·A x + c1·B x) x + (fun x => c2·C x) x) from rfl]
rw [e1]
have e2 := Summable.tsum_add (f := fun x : ℕ => c0·A x) (g := fun x : ℕ => c1·B x) hf1 hf2
rw [show (∑' x : ℕ, ((fun x => c0·A x + c1·B x) x)) = ∑' x : ℕ, ((fun x => c0·A x) x + (fun x => c1·B x) x) from rfl]
rw [e2, tsum_mul_left, tsum_mul_left, tsum_mul_left]
```
The `from rfl` shows: ∑' x, (c0·A x + c1·B x + c2·C x) = ∑' x, ((fun..) x + (fun..) x) — beta-defeq rfl ✓. Then e1/e2 fire as rewrites of the explicit forms ✓. This should work. Similarly for the farGLeftMaj_shift_le's ring problem (the le_of_eq) — replace with explicit stepwise: the equality 4.5·(c0+c1+c2)/D² = 4.5·(c0·(1/D²)+c1/D²+c2/D²): prove via:
```
rw [hD, h9]
rw [div_eq_mul_inv, div_eq_mul_inv, div_eq_mul_inv, div_eq_mul_inv]
```
no — messy. Use `mul_add` and `add_mul`:
goal: 4.5·(c0+c1+c2)/D² = 4.5·(c0·(1/D²)+c1/D²+c2/D²)
= 4.5·c0·(1/D²) + 4.5·c1·(1/D²) + 4.5·c2·(1/D²) (expand RHS's 4.5·)
LHS = (4.5·c0 + 4.5·c1 + 4.5·c2)/D² (mul_add on 4.5·(c0+c1+c2)) = 4.5·c0/D² + 4.5·c1/D² + 4.5·c2/D² (add_div ×2) ✓ then both sides match after turning c1/D² → c1·(1/D²)?? — the RHS terms: 4.5·(c0·(1/D²)) = 4.5·c0·(1/D²) = 4.5·c0/D² (div_eq_mul_inv backwards) — rw [div_eq_mul_inv] rewrites /D² → ·(D²)⁻¹ and 1/D² → (D²)⁻¹ — both become ·(D²)⁻¹ forms ✓ then ring/mul_add closes. Let me do:
```
rw [hD, h9, show (4.5 : ℝ) * (c0 + c1 + c2) = 4.5*c0 + 4.5*c1 + 4.5*c2 from by ring]
```
no — h9's RHS is (c0 + 0.433·log + 0.886·loglog) with c0 already grouped. Steps: after rw [hD, h9]: LHS = 4.5·(c0 + c1 + c2)/D². Then:
```
rw [mul_add, add_div, add_div]
ring
```
mul_add : a·(b+c) = a·b+a·c: matches 4.5·(c0 + (c1+c2))? — the combo (c0+c1+c2) parses ((c0+c1)+c2): mul_add rewrites 4.5·((c0+c1)+c2) → 4.5·(c0+c1) + 4.5·c2 (one instance — then does it rewrite recursively? rw rewrites all instances of the FIRST unifier: (a=4.5, b=(c0+c1), c=c2) — one instance. Then (4.5·(c0+c1) + 4.5·c2)/D²: add_div: (X+Y)/D² → X/D²+Y/D²: X = 4.5·(c0+c1): (4.5·(c0+c1))/D² + (4.5·c2)/D² — second add_div rewrites (4.5·(c0+c1))/D²?? — add_div's pattern (a+b)/c: matches the outer first: already done; second call: (4.5·(c0+c1))/D² — numerator 4.5·(c0+c1) — not (a+b)-form (it's 4.5·(c0+c1)) — add_div doesn't decompose through mul. Then need mul_add again on 4.5·(c0+c1): 4.5·c0+4.5·c1. Choreography: rw [mul_add, mul_add, add_div, add_div, add_div]?? — mul_add twice: first the outer (4.5·((c0+c1)+c2) → 4.5·(c0+c1)+4.5·c2), second 4.5·(c0+c1) → 4.5·c0+4.5·c1. Then add_div ×2: ((4.5·c0+4.5·c1)+4.5·c2)/D² → (4.5·c0+4.5·c1)/D² + 4.5·c2/D² → 4.5·c0/D² + 4.5·c1/D² + 4.5·c2/D². RHS: 4.5·(c0·(1/D²)+c1/D²+c2/D²) → via mul_add: 4.5·c0·(1/D²) + 4.5·(c1/D²) + 4.5·(c2/D²)... the RHS has 4.5·(c0·(1/D²) + c1/D² + c2/D²): mul_add → 4.5·(c0·(1/D²)) + 4.5·(c1/D²) + 4.5·(c2/D²) — and 4.5·c0/D² vs 4.5·(c0·(1/D²)): 4.5·c0/D² = (4.5·c0)/D² and 4.5·(c0·(1/D²)) = 4.5·c0·(1/D²) = 4.5·c0·(D²)⁻¹: (4.5·c0)/D² = (4.5·c0)·(D²)⁻¹ (div_eq_mul_inv) = same up to association: 4.5·c0·(D²)⁻¹ vs (4.5·c0)·(D²)⁻¹ ✓ same. And c1/D² vs c1·(1/D²): 1/D² = (D²)⁻¹ via one_div — ring handles these ✓. So: rw [hD, h9, mul_add, mul_add, add_div, add_div, mul_add]; ring. — the second mul_add on the RHS... rw applies to the GOAL (both sides) — mul_add matches the first instance anywhere. This choreography is fragile but let me just try: after the rewrites, `ring` on atoms (Real.log X as atom, D² as atom, (D²)⁻¹ as atom) — should be fast since no defeq explosion (all rewrites done).
Hmm — the timeout before was ring/ring_nf doing the whole job including the cast bridges. Now hcast is applied BEFORE via rw [hD] — the goal has no ↑(ℓ+14) left ✓ lighter.
And the kernel "unknown constant farGLeftMaj_combo_summable" — that's downstream of farGLeftMaj_shift_le failing?? no — combo_summable is defined after shift_le — the kernel error might be because shift_le's proof timed out leaving the environment inconsistent. Fix the shift_le first.
Let me rewrite the two problematic spots with these explicit choreographies.
Rewriting the two fragile spots with explicit, lighter choreographies.
tool: Write
input
{
"file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\patch_s17c.py",
"content": "p = 'NguyenRH1/LiTightR.lean'\nsrc = open(p, encoding='utf-8').read()\n\n# farGLeftMaj_shift_le's le_of_eq: explicit rewrite choreography\nold = \"\"\" exact h2.trans (le_of_eq (by\n rw [show (10 + ((\u2113 + 14 : \u2115) : \u211d)) = ((\u2113 : \u211d) + 14) + 10 from by rw [hcast]; ring, h9]\n ring_nf))\"\"\"\nnew = \"\"\" exact h2.trans (le_of_eq (by\n have hD : ((10 : \u211d) + ((\u2113 + 14 : \u2115) : \u211d)) = ((\u2113 : \u211d) + 14) + 10 := by rw [hcast]; ring\n rw [hD, h9, mul_add, mul_add, add_div, add_div, mul_add]\n ring))\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# heval in farGLeftMaj_series_le: robust decomposition via explicit beta-rfl bridges\nold = \"\"\" have heval : (\u2211' \u2113 : \u2115,\n 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((\u2113 : \u211d) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((\u2113 : \u211d) + 14) / (((\u2113 : \u211d) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((\u2113 : \u211d) + 14)) / (((\u2113 : \u211d) + 14) + 10) ^ 2)))\n \u2264 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / 23)\n + 0.433 * 0.1687 + 0.886 * 0.0621) := by\n rw [tsum_mul_left]\n apply mul_le_mul_of_nonneg_left _ (by norm_num : (0 : \u211d) \u2264 4.5)\n rw [Summable.tsum_add ((tail14_inv_add_sq_summable.mul_left _).add\n (tail14_log_div_add_sq_summable.mul_left _)) (tail14_loglog_div_add_sq_summable.mul_left _)]\n rw [Summable.tsum_add (tail14_inv_add_sq_summable.mul_left _)\n (tail14_log_div_add_sq_summable.mul_left _)]\n rw [tsum_mul_left, tsum_mul_left, tsum_mul_left]\n have hle1 := mul_le_mul_of_nonneg_left hA0 (by positivity : (0 : \u211d) \u2264\n 0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)\n have hle2 := mul_le_mul_of_nonneg_left hA1 (by positivity : (0 : \u211d) \u2264 0.433)\n have hle3 := mul_le_mul_of_nonneg_left hA2 (by positivity : (0 : \u211d) \u2264 0.886)\n linarith [hle1, hle2, hle3]\"\"\"\nnew = \"\"\" have heval : (\u2211' \u2113 : \u2115,\n 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((\u2113 : \u211d) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((\u2113 : \u211d) + 14) / (((\u2113 : \u211d) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((\u2113 : \u211d) + 14)) / (((\u2113 : \u211d) + 14) + 10) ^ 2)))\n \u2264 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / 23)\n + 0.433 * 0.1687 + 0.886 * 0.0621) := by\n rw [tsum_mul_left]\n apply mul_le_mul_of_nonneg_left _ (by norm_num : (0 : \u211d) \u2264 4.5)\n have hdecomp : (\u2211' x : \u2115,\n ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : \u211d) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((x : \u211d) + 14)) / (((x : \u211d) + 14) + 10) ^ 2)))\n = (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (\u2211' x : \u2115, (1 / (((x : \u211d) + 14) + 10) ^ 2))\n + 0.433 * (\u2211' x : \u2115, (Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2))\n + 0.886 * (\u2211' x : \u2115, (Real.log (Real.log ((x : \u211d) + 14)) / (((x : \u211d) + 14) + 10) ^ 2)) := by\n have e1 := Summable.tsum_add\n (f := fun x : \u2115 => (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : \u211d) + 14) + 10) ^ 2)\n + 0.433 * Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2)\n (g := fun x : \u2115 => 0.886 * Real.log (Real.log ((x : \u211d) + 14)) / (((x : \u211d) + 14) + 10) ^ 2)\n ((tail14_inv_add_sq_summable.mul_left _).add (tail14_log_div_add_sq_summable.mul_left _))\n (tail14_loglog_div_add_sq_summable.mul_left _)\n have e2 := Summable.tsum_add\n (f := fun x : \u2115 => (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : \u211d) + 14) + 10) ^ 2))\n (g := fun x : \u2115 => 0.433 * Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2)\n (tail14_inv_add_sq_summable.mul_left _) (tail14_log_div_add_sq_summable.mul_left _)\n rw [show (\u2211' x : \u2115,\n ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : \u211d) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((x : \u211d) + 14)) / (((x : \u211d) + 14) + 10) ^ 2)))\n = \u2211' x : \u2115, ((fun x : \u2115 =>\n (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : \u211d) + 14) + 10) ^ 2)\n + 0.433 * Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2) x\n + (fun x : \u2115 => 0.886 * Real.log (Real.log ((x : \u211d) + 14)) / (((x : \u211d) + 14) + 10) ^ 2) x)\n from rfl]\n rw [e1]\n rw [show (\u2211' x : \u2115, (fun x : \u2115 =>\n (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : \u211d) + 14) + 10) ^ 2)\n + 0.433 * Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2) x)\n = \u2211' x : \u2115, ((fun x : \u2115 =>\n (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : \u211d) + 14) + 10) ^ 2)) x\n + (fun x : \u2115 => 0.433 * Real.log ((x : \u211d) + 14) / (((x : \u211d) + 14) + 10) ^ 2) x)\n from rfl]\n rw [e2, tsum_mul_left, tsum_mul_left, tsum_mul_left]\n rw [hdecomp]\n have hle1 := mul_le_mul_of_nonneg_left hA0 (by positivity : (0 : \u211d) \u2264\n 0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)\n have hle2 := mul_le_mul_of_nonneg_left hA1 (by positivity : (0 : \u211d) \u2264 0.433)\n have hle3 := mul_le_mul_of_nonneg_left hA2 (by positivity : (0 : \u211d) \u2264 0.886)\n linarith [hle1, hle2, hle3]\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\nopen(p, 'w', encoding='utf-8').write(src)\nprint(\"done\")\n"
}
raw content_json (database row)
[{"type":"thinking","thinking":"1. The ring_nf timeout persists at 3155 — ring_nf is also too slow on this expression. The problem is likely the h9 rewrite creating a huge term that ring_nf's isDefEq check chokes on. Let me avoid the heavy normalization entirely — prove the equality term-by-term via tsum-congr-style: actually the equality I need is just algebra: 4.5·(c0+c1+c2)/D² = 4.5·(c0·(1/D²)+c1/D²+c2/D²). Let me prove it by `congr 1` then expand:\n```\n exact h2.trans (le_of_eq (by\n have hD : ((10 : ℝ) + ((ℓ + 14 : ℕ) : ℝ)) = ((ℓ : ℝ) + 14) + 10 := by rw [hcast]; ring\n rw [hD, h9]\n -- goal: 4.5·(c0+0.433·log X+0.886·loglog X)/D² = 4.5·(c0·(1/D²)+0.433·log X/D²+0.886·loglog X/D²)\n field_simp [show ((ℓ : ℝ) + 14 + 10) ^ 2 ≠ 0 by positivity]\n ring))\n```\nHmm — field_simp was the original timeout. The issue: field_simp + ring on this. Let me try a totally different approach — div_eq_mul_inv + mul_add:\n```\n rw [hD, h9, div_eq_mul_inv, mul_add, mul_add]\n ring\n```\ndiv_eq_mul_inv : a/b = a·b⁻¹ — LHS: 4.5·(combo)·(D²)⁻¹; mul_add : 4.5·c0·(D²)⁻¹ + 4.5·(0.433·log X)·(D²)⁻¹ + 4.5·(0.886·loglog X)·(D²)⁻¹?? — mul_add : a·(b+c) = a·b+a·c — 4.5·(c0+c1+c2)·(D²)⁻¹ — the product is (4.5·(c0+c1+c2))·(D²)⁻¹ — mul_add matches (4.5)·((c0+c1+c2)·(D²)⁻¹)?? — the assoc: div_eq_mul_inv gives (4.5·(c0+c1+c2))·(D²)⁻¹ = 4.5·((c0+c1+c2)·(D²)⁻¹)?? — the elaborated form: HDiv (4.5·combo) D² → (4.5·combo)·(D²)⁻¹ — mul_add's pattern a·(b+c): with a = 4.5, b+c = combo·... no — the term is (4.5·combo)·(D²)⁻¹ = HMul (HMul 4.5 combo) (D²)⁻¹ — mul_add matches HMul 4.5 (combo·(D²)⁻¹)? — the inner HMul 4.5 combo: mul_add rewrites 4.5·(c0+c1+c2) → 4.5·c0+4.5·c1+4.5·c2 (two applications, each rewriting instances of the first unifier). Then the outer (·(D²)⁻¹): (4.5·c0+4.5·c1+4.5·c2)·(D²)⁻¹. The RHS: 4.5·(c0·(1/D²)+c1/D²+c2/D²) — div_eq_mul_inv inside: c1/D² = c1·(D²)⁻¹ etc. ring should close: (4.5·c0+4.5·c1+4.5·c2)·(D²)⁻¹ = 4.5·(c0·(D²)⁻¹+c1·(D²)⁻¹+c2·(D²)⁻¹) — YES by mul_add reversed — ring handles ✓. But ring also timed out before... the timeout might be ring's preprocessing on Real.log atoms?? ring treats Real.log X as an atom ✓ should be fast. The isDefEq timeout — maybe from ring's final check comparing huge expanded polynomials with the ↑ℓ casts. \n\nALTERNATIVE: avoid the equality entirely — bound the tsum directly per-term: the Summable.tsum_le_tsum hle gives tsum(farGLeftMaj(ℓ+14)) ≤ tsum(combo-form) — then bound tsum(combo-form) ≤ 4.5·(c0·(1/23)+0.433·0.1687+0.886·0.0621) via POINTWISE comparison with a 4-piece sum — actually, decompose the combo-form tsum INTO the four summand tsums FIRST (tsum_add/tsum_mul_left on the combo-form itself — that's an EQUALITY of tsums, which I already do in heval!). The heval part is where the pain is. Let me restructure heval to avoid tsum-level algebra on the combo: bound tsum(combo) ≤ tsum(c0·A + c1·B + c2·C expanded)... \n\nHmm wait — actually the real problem child is the `ring_nf`/`ring` in farGLeftMaj_shift_le (line 3155) — the equality inside farGLeftMaj_shift_le's le_of_eq. The heval error at 3199 is a DIFFERENT issue: `tsum_mul_left`'s pattern — the target has the UNMULTIPLIED form — my rw [tsum_mul_left] sequence: after `rw [tsum_mul_left]` (the 4.5), the goal is 4.5·(tsum A+B+C) ≤ 4.5·(combo): mul_le_mul... then `rw [Summable.tsum_add ...]` turned the tsum into pieces, then `rw [tsum_mul_left, tsum_mul_left, tsum_mul_left]` — the error at 3199: the third tsum_mul_left's pattern didn't match — after two tsum_mul_left rewrites, the remaining tsum is `∑' (x:ℕ), (c0·A + c1·B + c2·C)`?? — hmm, the Summable.tsum_add rewrote the sum-of-three into (A+B)+C form: ∑' (c0·A+c1·B) + ∑' c2·C — then tsum_add again: ∑' c0·A + ∑' c1·B + ∑' c2·C — then three tsum_mul_left: each rewrites ∑' (ci·fi) → ci·∑' fi — the FIRST tsum_mul_left rewrites the first match (c0·A) ✓, second rewrites c1·B ✓, third should rewrite c2·C — error says pattern not found with the goal showing `∑' (x:ℕ), ((c0·A) + (c1·B) + (c2·C)) ≤ ...` — wait — the goal display at 3199 shows the tsum as the UNEXPANDED sum: `∑' (x:ℕ), ((0.433*0.1942+0.886*736e-4+2.9)·A + 0.433·B + 0.886·C) ≤ combo` — so the Summable.tsum_add rewrites did NOT fire (the goal still has the summed form)! The `rw [Summable.tsum_add X Y]` — Summable.tsum_add (hf : Summable f) (hg : Summable g) : ∑' (f+g) = ∑' f + ∑' g — using it as a rewrite with EXPLICIT summability args: the pattern in the goal: ∑' (x:ℕ), (A-sum + B-sum + C-sum) — the function is fun x => c0·A x + c1·B x + c2·C x — Summable.tsum_add with my supplied f = (c0·A+c1·B)?? — I supplied `((tail14_inv_add_sq_summable.mul_left _).add (tail14_log_div_add_sq_summable.mul_left _))` as hf for f := (fun x => c0·A x + c1·B x)?? — wait — the tsum's function: (fun ℓ => c0·A ℓ + c1·B ℓ + c2·C ℓ) = ((fun ℓ => c0·A ℓ + c1·B ℓ) + (fun ℓ => c2·C ℓ))?? — Pi.add association: (f+g)+h = fun ℓ => (f+g) ℓ + h ℓ = (f ℓ + g ℓ) + h ℓ ✓ matches the left-nested form ✓. So Summable.tsum_add (hf : Summable (f+g)) (hg : Summable h) : ∑' ((f+g)+h) = ∑' (f+g) + ∑' h — my first rw [Summable.tsum_add ((...).add ...) (...)] — didn't fire — \"did not find pattern ∑' (b), (?m·A + ?m·B + ?m·C)\" — the pattern shows the f/g as METAVARS (?m.548 etc.) — meaning Summable.tsum_add's LHS is just ∑' (f+g) with f,g as arguments? No — Summable.tsum_add is an EQUATION: `Summable.tsum_add (hf : Summable f) (hg : Summable g) : ∑' x, (f x + g x) = ∑' x, f x + ∑' x, g x` — as a rewrite rule it rewrites `∑' x, (f x + g x)` where f,g are determined by the supplied hf/hg. The error's pattern shows ?m's — the supplied hf determined f := fun x => (0.433*0.1942+0.886*736e-4+2.9)·A x + 0.433·B x?? — hmm, hf := (tail14_inv_add_sq_summable.mul_left _).add (tail14_log_div_add_sq_summable.mul_left _) : Summable ((fun x => c0·A x) + (fun x => c1·B x)) = Summable (fun x => c0·A x + c1·B x) — with c0 := 0.433*0.1942+0.886*736e-4+2.9, c1 := 0.433 ✓. hg := tail14_loglog_div_add_sq_summable.mul_left _ : Summable (fun x => c2·C x) ✓. So the rewrite pattern: ∑' (fun x => (c0·A x + c1·B x) + c2·C x) — the goal's tsum function: fun x => (c0·A x + c1·B x + c2·C x) — the association (c0·A x + c1·B x) + c2·C x ✓ SHOULD match... The error pattern shows `?m.548 * (1/(...)²) + ?m.564·(log/²) + ?m.572·(loglog/²)` — three DISTINCT coeff metavars — so Lean read the GOAL's function as (c0·A + c1·B + c2·C) and my Summable.tsum_add's LHS as `∑' ((?f) + (?g))` — unification: the goal's function vs (f+g): f must be (c0·A+c1·B)-lambda: fun x => c0·A x + c1·B x — but my hf's type is Summable (fun x => c0·A x + c1·B x)?? — hmm — Summable.mul_left c : Summable (fun x => c·f x) — the mul_left's function is fun x => c0·A x ✓. The .add : Summable f → Summable g → Summable (f + g) — f+g is Pi.add — fun x => f x + g x — with the Pi.add form! The goal's function is written as `fun x => c0·A x + c1·B x + c2·C x` — a LAMBDA with adds inside, NOT a Pi.add application!! Summable.tsum_add's LHS is `∑' x, (f + g) x`?? — the statement: ∑' (f + g) — as a function — vs the goal's explicit lambda — defeq but not syntactic — rw needs syntactic match. The standard workaround: use Summable.tsum_add as a TERM not a rewrite: the heval should be built by calc/transitivity:\n\n```\n have heval : tsum-combo ≤ 4.5·(c0·(1/23)+0.433·0.1687+0.886·0.0621) := by\n rw [tsum_mul_left]\n apply mul_le_mul_of_nonneg_left _ (by norm_num)\n -- goal: ∑' (fun x => c0·A x + c1·B x + c2·C x) ≤ combo\n have hdecomp : (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))\n = c0·(∑' x, A x) + 0.433·(∑' x, B x) + 0.886·(∑' x, C x) := by\n rw [Summable.tsum_add (hAB) (hC), Summable.tsum_add (hA) (hB), tsum_mul_left, tsum_mul_left, tsum_mul_left]\n```\n— same rw problem for the =. The issue is whether the goal's tsum function syntactically matches ((f+g)+h). The goal after `rw [tsum_mul_left]` — WAIT — maybe the goal's function IS the combo-lambda from the lemma statement: fun ℓ => 4.5·(c0·A ℓ + ...) — after tsum_mul_left: fun ℓ => c0·A ℓ + c1·B ℓ + c2·C ℓ — still a lambda. Summable.tsum_add (hf)(hg) : ∑' x, (f x + g x) = ... — its LHS pattern is ∑' x, f x + g x with f and g as ARGS from hf/hg: hf : Summable f, hg : Summable g — with f = fun x => c0·A x + c1·B x and g = fun x => c2·C x: the LHS = ∑' x, ((fun x => c0·A x + c1·B x) x + c2·C x) — beta: c0·A x + c1·B x + c2·C x ✓ — rw should unify the goal's tsum with ∑' x, f x + g x — the goal is ∑' (fun x => c0·A x + c1·B x + c2·C x) — matching ∑' x, (f x + g x) with f = fun.., g = fun..: f x + g x = (fun x => c0·A x + c1·B x) x + c2·C x — rw's matching is up to reducible defeq — the beta-redex should unify... Apparently NOT (that's the error). The banked gotcha: \"redex-RHS show-before-rw\". Fix: state the goal's tsum with the (f+g)-form via `show`:\n```\n show (∑' x : ℕ, ((fun x => (c0·A x + c1·B x)) x + (fun x => c2·C x) x)) ≤ combo\n```\n— ugly. ALTERNATIVE: use `Summable.tsum_add` with the FUNCTION forms via `tsum_add` (the non-Summable-gated? no such). OR use `tsum_add` if it exists for summable via Summable.tsum_add — the clean fix: `rw [show (∑' x : ℕ, (c0·A x + c1·B x + c2·C x)) = ∑' x : ℕ, ((c0·A x + c1·B x) + c2·C x) from rfl]`?? — the show with the Pi.add body... \n\nSIMPLEST ROBUST FIX: prove the decomposition equality via `tsum_add` doesn't exist, so instead use the LINEARITY through `Summable.tsum_le_tsum`-free paths: bound the combo-tsum ≤ combo via Summable.tsum_le_tsum with a DECOMPOSED majorant: \n```\n have hle2 : (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))\n ≤ c0·(1/23) + 0.433·0.1687 + 0.886·0.0621 := by\n have hA0 ..., hA1 ..., hA2 ...\n -- use: ∑' (c0·A + c1·B + c2·C) ≤ c0·S0 + c1·S1 + c2·S2 via\n -- tsum_le_tsum against the constant majorant? no — via the add/mul_left tsum EQUALITIES.\n```\nHmm. The equalities ARE needed. Let me look at how LiCircleBound's zero_tail_inv_sq_le did the analogous step — it used `Summable.tsum_add` and `tsum_mul_left`? From my reading earlier (htotal): `calc ∑' j, F j ≤ ∑' j, (4A₀/X)·G j := Summable.tsum_le_tsum hFle hFsum hGsum; _ = (4A₀/X)·(10 log 2 + 2 log X) := by rw [tsum_mul_left, hGtotal]; _ ≤ ...` — only ONE tsum_mul_left — and the G-function was a single form. And tsum_dyadic_log used Summable.tsum_add successfully: `rw [hsplit, Summable.tsum_add (hlinH.summable.mul_left _) (hgeom2H.mul_left _)]` — there the hsplit FIRST rewrote the function into the (f + g)-lambda form: `have hsplit : (fun j => ...) = fun j => L·(j·r^j) + (4L+logX)·r^j := by funext j; ...` — and then Summable.tsum_add fired — because hsplit made the function EXACTLY `fun j => (L·(j·r^j)) + ((4L+logX)·r^j)` — a single lambda whose body is (f-term + g-term) — and Summable.tsum_add's LHS `∑' x, (f x + g x)` — hmm — how did that match? Because the goal after rw [hsplit] is ∑' (fun j => L·(j·r^j) + (4L+logX)·r^j) — and Summable.tsum_add (hf)(hg) with f = fun j => L·(j·r^j), g = fun j => (4L+logX)·r^j: LHS = ∑' x, (f x + g x) — rw matched fine there! So why does mine fail? — because of the THREE-term nesting and the (f+g)+h association. In tsum_dyadic_log, there were TWO terms only. For three: ∑' ((f+g)+h) = ∑' (f+g) + ∑' h: the goal's lambda: fun x => (f x + g x) + h x — my goal's lambda: fun x => c0·A x + c1·B x + c2·C x — that IS ((c0·A + c1·B) + c2·C)-form?? — parses as (c0·A x + c1·B x) + c2·C x ✓ — matches (f'+h) with f' = (c0·A+c1·B)-lambda ✓ should work... unless the elaboration of my hf's type gave a DIFFERENT f'. hf := (h1.mul_left _).add (h2.mul_left _) : Summable ((fun x => c0·A x) + (fun x => c1·B x)) — the f' here is the Pi.add ((fun x => c0·A x) + (fun x => c1·B x)) — NOT the lambda fun x => c0·A x + c1·B x!! Pi.add vs lambda-with-plus — DEFEQ but not syntactic — that's the mismatch! tsum_dyadic_log worked because hsplit wrote the function as a lambda and Summable.tsum_add unified up to reducible (Pi.add applied to x reduces to the plus-form ✓). Hmm — but then it should unify for mine too... The Summable.add returns Summable (f + g) with Pi.add — and Summable.tsum_add's hf : Summable f — the f is inferred from hf's TYPE: f := (fun x => c0·A x) + (fun x => c1·B x) (Pi.add). Then the LHS pattern: ∑' x, ((Pi.add f₁ f₂) x + g x) — beta-reducible to c0·A x + c1·B x + c2·C x ✓ — rw SHOULD unify reducibly... The error suggests it didn't. Whatever — let me use the tsum_dyadic_log approach: FIRST rewrite the goal's function into the EXPLICIT Pi.add form via a show/funext, THEN apply Summable.tsum_add. OR simpler: give the decomposition via `Summable.tsum_le_tsum` pointwise: \n\ncombo-tsum ≤ tsum(fun x => c0·A x + c1·B x + c2·C x)·... no that's the same.\n\nALTERNATIVE clean approach: bound the combo-tsum via `Summable.tsum_le_tsum` against the CONSTANT family: no. \n\nLet me just use the funext approach:\n```\n have hdecomp : (∑' x : ℕ, ((0.433*0.1942+0.886*0.0736+2.9)·(1/(((x:ℝ)+14)+10)^2)\n + 0.433·(log((x:ℝ)+14)/(((x:ℝ)+14)+10)^2)\n + 0.886·(loglog((x:ℝ)+14)/(((x:ℝ)+14)+10)^2)))\n = (0.433*0.1942+0.886*0.0736+2.9)·(∑' x : ℕ, 1/(((x:ℝ)+14)+10)^2)\n + 0.433·(∑' x : ℕ, log((x:ℝ)+14)/(((x:ℝ)+14)+10)^2)\n + 0.886·(∑' x : ℕ, loglog((x:ℝ)+14)/(((x:ℝ)+14)+10)^2) := by\n rw [show (fun x : ℕ => (c0·(A x) + c1·(B x) + c2·(C x)))\n = (fun x : ℕ => c0·(A x) + c1·(B x)) + (fun x : ℕ => c2·(C x)) from by\n funext x; simp only [Pi.add_apply]]\n rw [Summable.tsum_add hf' hg, Summable.tsum_add hf1 hf2, tsum_mul_left, tsum_mul_left, tsum_mul_left]\n```\n— with the explicit function forms ascribed so f'/hf1/hf2/hg match syntactically. This is getting really messy. PRAGMATIC: use `Summable.tsum_le_tsum` to bound the combo-tsum by the (c0·A+c1·B+c2·C)-tsum is an equality... \n\nYou know what — CLEANEST: avoid the whole heval-in-ℝ approach. Bound farGLeftMaj_series_le directly with THREE separate Summable.tsum_le_tsum calls on a decomposed pointwise bound:\n- farGLeftMaj (ℓ+14) ≤ 4.5·(c0·A ℓ) + 4.5·(0.433·B ℓ) + 4.5·(0.886·C ℓ)?? — no, it's ONE inequality with the sum on the RHS.\n\nHmm — alternative: bound the farGLeftMaj tsum by summing the four scalar families directly:\n```\n have hpt2 : ∀ ℓ : ℕ, farGLeftMaj (ℓ + 14)\n ≤ (4.5 * (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)) * (1/(((ℓ:ℝ)+14)+10)^2)\n + (4.5 * 0.433) * (log((ℓ:ℝ)+14)/(((ℓ:ℝ)+14)+10)^2)\n + (4.5 * 0.886) * (loglog((ℓ:ℝ)+14)/(((ℓ:ℝ)+14)+10)^2) := farGLeftMaj_shift_le-ish (rewrite the RHS association — the current shift_le's RHS is 4.5·(c0·A + 0.433·B + 0.886·C): 4.5·(c0·A + 0.433·B + 0.886·C) = (4.5·c0)·A + (4.5·0.433)·B + (4.5·0.886)·C by ring — prove the variant by rw + ring on hpt's RHS... — ring on THAT should be fast (no logs? has logs as atoms ✓).\n```\nThen: tsum(farGLeftMaj(ℓ+14)) ≤ tsum(RHS-form) = (4.5·c0)·S0 + (4.5·0.433)·S1 + (4.5·0.886)·S2 — the decomposition: AGAIN tsum_add ×2 + tsum_mul_left ×3 — same problem. UNLESS: bound tsum(RHS) ≤ (4.5·c0)·S0+(4.5·0.433)·S1+(4.5·0.886)·S2 via... tsum_le_tsum is pointwise, not for decomposition.\n\nOK — let me just accept the funext/show approach for the decomposition. Write it carefully:\n\n```\n have hdecomp : (∑' x : ℕ,\n (4.5 * (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)) * (1 / (((x : ℝ) + 14) + 10) ^ 2)\n + (4.5 * 0.433) * (Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2)\n + (4.5 * 0.886) * (Real.log (Real.log ((x : ℝ) + 14)) / (((x : ℝ) + 14) + 10) ^ 2))\n = (4.5 * (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)) * (1 / 23)\n + (4.5 * 0.433) * 0.1687 + (4.5 * 0.886) * 0.0621 := by\n```\nNO — that's an inequality direction too. ARGH.\n\nLet me look at exactly how the goal's tsum function looks and why Summable.tsum_add fails. The heval goal after `rw [tsum_mul_left]` + `apply mul_le_mul_of_nonneg_left _ ...`:\n`∑' (x : ℕ), ((0.433*0.1942+0.886*736e-4+2.9)·(1/((↑x+14+10)^2)) + 0.433·(Real.log (↑x+14)/(↑x+14+10)^2) + 0.886·(Real.log (Real.log (↑x+14))/(↑x+14+10)^2)) ≤ combo`\n\nSummable.tsum_add (hf : Summable f) (hg : Summable g) : ∑' x, (f x + g x) = ∑' x, f x + ∑' x, g x. To rewrite the goal's tsum: pattern `∑' x, f x + g x` — Lean 4 rw can match with f, g determined by hf, hg. hf := ((...).add (...)) : Summable ((fun x => c0·A x) + (fun x => c1·B x)) — so f := (fun x => c0·A x) + (fun x => c1·B x) (Pi.add). The pattern: ∑' x, (f x + g x) = ∑' x, (Pi.add (fun c0·A) (fun c1·B)) x + (fun c2·C) x — reducible-unify with the goal's body `c0·A x + c1·B x + c2·C x`: (Pi.add ..) x → c0·A x + c1·B x ✓ then + c2·C x ✓ — association (c0·A x + c1·B x) + c2·C x ✓ matches. Why did it fail?! The error message's \"target expression\" shows the goal — and the pattern `∑' (b : ℕ), (?m.548·(1/..²) + ?m.564·(log/..²) + ?m.572·(loglog/..²))` — the pattern has THREE SEPARATE coefficient-metavars for the three terms — this is `∑' x, (?c0·A x + ?c1·B x + ?c2·C x)` — that's tsum_add applied TWICE mentally — no wait — the error is from `rw [tsum_mul_left, tsum_mul_left, tsum_mul_left]` — the FIRST tsum_mul_left fired (c0), the second (c1), the THIRD failed?? The pattern shown (?m.548·A + ?m.564·B + ?m.572·C) — tsum_mul_left's LHS is ∑' x, (c·f x) with c,f metavars — the displayed pattern is the union of all three attempts?? The error at 3199 says \"Did not find the pattern ∑' (b:ℕ), (?m.548·(1/..²) + ?m.564·(log/..²) + ?m.572·(loglog/..²))\" — that's the pattern AFTER my Summable.tsum_add rewrites supposedly... \n\nI'm going in circles. PRAGMATIC: replace the entire heval decomposition with a robust approach — `Summable.tsum_le_tsum` to move to a sum of THREE separate tsums is NOT possible directly. Instead use `tsum_add` via the calc with EXPLICIT function names via `set`:\n\nActually — the ROBUST way: `Summable.tsum_add` as a TERM-level equality: \n```\nhave hdecomp : (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))\n = c0·(∑' x, A x) + c1·(∑' x, B x) + c2·(∑' x, C x) := by\n have e1 := Summable.tsum_add (f := fun x : ℕ => c0·A x + c1·B x) (g := fun x : ℕ => c2·C x)\n (by exact hf') (by exact hg)\n -- e1 : ∑' x, ((fun x => c0·A x + c1·B x) x + (fun x => c2·C x) x) = ...\n rw [show (∑' x : ℕ, (c0·A x + c1·B x + c2·C x))\n = ∑' x : ℕ, ((fun x => c0·A x + c1·B x) x + (fun x => c2·C x) x) from rfl] \n rw [e1]\n have e2 := Summable.tsum_add (f := fun x : ℕ => c0·A x) (g := fun x : ℕ => c1·B x) hf1 hf2\n rw [show (∑' x : ℕ, ((fun x => c0·A x + c1·B x) x)) = ∑' x : ℕ, ((fun x => c0·A x) x + (fun x => c1·B x) x) from rfl]\n rw [e2, tsum_mul_left, tsum_mul_left, tsum_mul_left]\n```\nThe `from rfl` shows: ∑' x, (c0·A x + c1·B x + c2·C x) = ∑' x, ((fun..) x + (fun..) x) — beta-defeq rfl ✓. Then e1/e2 fire as rewrites of the explicit forms ✓. This should work. Similarly for the farGLeftMaj_shift_le's ring problem (the le_of_eq) — replace with explicit stepwise: the equality 4.5·(c0+c1+c2)/D² = 4.5·(c0·(1/D²)+c1/D²+c2/D²): prove via:\n```\n rw [hD, h9]\n rw [div_eq_mul_inv, div_eq_mul_inv, div_eq_mul_inv, div_eq_mul_inv]\n```\nno — messy. Use `mul_add` and `add_mul`:\ngoal: 4.5·(c0+c1+c2)/D² = 4.5·(c0·(1/D²)+c1/D²+c2/D²)\n= 4.5·c0·(1/D²) + 4.5·c1·(1/D²) + 4.5·c2·(1/D²) (expand RHS's 4.5·)\nLHS = (4.5·c0 + 4.5·c1 + 4.5·c2)/D² (mul_add on 4.5·(c0+c1+c2)) = 4.5·c0/D² + 4.5·c1/D² + 4.5·c2/D² (add_div ×2) ✓ then both sides match after turning c1/D² → c1·(1/D²)?? — the RHS terms: 4.5·(c0·(1/D²)) = 4.5·c0·(1/D²) = 4.5·c0/D² (div_eq_mul_inv backwards) — rw [div_eq_mul_inv] rewrites /D² → ·(D²)⁻¹ and 1/D² → (D²)⁻¹ — both become ·(D²)⁻¹ forms ✓ then ring/mul_add closes. Let me do:\n```\n rw [hD, h9, show (4.5 : ℝ) * (c0 + c1 + c2) = 4.5*c0 + 4.5*c1 + 4.5*c2 from by ring]\n```\nno — h9's RHS is (c0 + 0.433·log + 0.886·loglog) with c0 already grouped. Steps: after rw [hD, h9]: LHS = 4.5·(c0 + c1 + c2)/D². Then:\n```\n rw [mul_add, add_div, add_div]\n ring\n```\nmul_add : a·(b+c) = a·b+a·c: matches 4.5·(c0 + (c1+c2))? — the combo (c0+c1+c2) parses ((c0+c1)+c2): mul_add rewrites 4.5·((c0+c1)+c2) → 4.5·(c0+c1) + 4.5·c2 (one instance — then does it rewrite recursively? rw rewrites all instances of the FIRST unifier: (a=4.5, b=(c0+c1), c=c2) — one instance. Then (4.5·(c0+c1) + 4.5·c2)/D²: add_div: (X+Y)/D² → X/D²+Y/D²: X = 4.5·(c0+c1): (4.5·(c0+c1))/D² + (4.5·c2)/D² — second add_div rewrites (4.5·(c0+c1))/D²?? — add_div's pattern (a+b)/c: matches the outer first: already done; second call: (4.5·(c0+c1))/D² — numerator 4.5·(c0+c1) — not (a+b)-form (it's 4.5·(c0+c1)) — add_div doesn't decompose through mul. Then need mul_add again on 4.5·(c0+c1): 4.5·c0+4.5·c1. Choreography: rw [mul_add, mul_add, add_div, add_div, add_div]?? — mul_add twice: first the outer (4.5·((c0+c1)+c2) → 4.5·(c0+c1)+4.5·c2), second 4.5·(c0+c1) → 4.5·c0+4.5·c1. Then add_div ×2: ((4.5·c0+4.5·c1)+4.5·c2)/D² → (4.5·c0+4.5·c1)/D² + 4.5·c2/D² → 4.5·c0/D² + 4.5·c1/D² + 4.5·c2/D². RHS: 4.5·(c0·(1/D²)+c1/D²+c2/D²) → via mul_add: 4.5·c0·(1/D²) + 4.5·(c1/D²) + 4.5·(c2/D²)... the RHS has 4.5·(c0·(1/D²) + c1/D² + c2/D²): mul_add → 4.5·(c0·(1/D²)) + 4.5·(c1/D²) + 4.5·(c2/D²) — and 4.5·c0/D² vs 4.5·(c0·(1/D²)): 4.5·c0/D² = (4.5·c0)/D² and 4.5·(c0·(1/D²)) = 4.5·c0·(1/D²) = 4.5·c0·(D²)⁻¹: (4.5·c0)/D² = (4.5·c0)·(D²)⁻¹ (div_eq_mul_inv) = same up to association: 4.5·c0·(D²)⁻¹ vs (4.5·c0)·(D²)⁻¹ ✓ same. And c1/D² vs c1·(1/D²): 1/D² = (D²)⁻¹ via one_div — ring handles these ✓. So: rw [hD, h9, mul_add, mul_add, add_div, add_div, mul_add]; ring. — the second mul_add on the RHS... rw applies to the GOAL (both sides) — mul_add matches the first instance anywhere. This choreography is fragile but let me just try: after the rewrites, `ring` on atoms (Real.log X as atom, D² as atom, (D²)⁻¹ as atom) — should be fast since no defeq explosion (all rewrites done).\n\nHmm — the timeout before was ring/ring_nf doing the whole job including the cast bridges. Now hcast is applied BEFORE via rw [hD] — the goal has no ↑(ℓ+14) left ✓ lighter.\n\nAnd the kernel \"unknown constant farGLeftMaj_combo_summable\" — that's downstream of farGLeftMaj_shift_le failing?? no — combo_summable is defined after shift_le — the kernel error might be because shift_le's proof timed out leaving the environment inconsistent. Fix the shift_le first.\n\nLet me rewrite the two problematic spots with these explicit choreographies.","signature":""},{"type":"text","text":"Rewriting the two fragile spots with explicit, lighter choreographies."},{"type":"tool_use","id":"Write_193","name":"Write","input":{"file_path":"D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\patch_s17c.py","content":"p = 'NguyenRH1/LiTightR.lean'\nsrc = open(p, encoding='utf-8').read()\n\n# farGLeftMaj_shift_le's le_of_eq: explicit rewrite choreography\nold = \"\"\" exact h2.trans (le_of_eq (by\n rw [show (10 + ((ℓ + 14 : ℕ) : ℝ)) = ((ℓ : ℝ) + 14) + 10 from by rw [hcast]; ring, h9]\n ring_nf))\"\"\"\nnew = \"\"\" exact h2.trans (le_of_eq (by\n have hD : ((10 : ℝ) + ((ℓ + 14 : ℕ) : ℝ)) = ((ℓ : ℝ) + 14) + 10 := by rw [hcast]; ring\n rw [hD, h9, mul_add, mul_add, add_div, add_div, mul_add]\n ring))\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\n# heval in farGLeftMaj_series_le: robust decomposition via explicit beta-rfl bridges\nold = \"\"\" have heval : (∑' ℓ : ℕ,\n 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((ℓ : ℝ) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((ℓ : ℝ) + 14) / (((ℓ : ℝ) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((ℓ : ℝ) + 14)) / (((ℓ : ℝ) + 14) + 10) ^ 2)))\n ≤ 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / 23)\n + 0.433 * 0.1687 + 0.886 * 0.0621) := by\n rw [tsum_mul_left]\n apply mul_le_mul_of_nonneg_left _ (by norm_num : (0 : ℝ) ≤ 4.5)\n rw [Summable.tsum_add ((tail14_inv_add_sq_summable.mul_left _).add\n (tail14_log_div_add_sq_summable.mul_left _)) (tail14_loglog_div_add_sq_summable.mul_left _)]\n rw [Summable.tsum_add (tail14_inv_add_sq_summable.mul_left _)\n (tail14_log_div_add_sq_summable.mul_left _)]\n rw [tsum_mul_left, tsum_mul_left, tsum_mul_left]\n have hle1 := mul_le_mul_of_nonneg_left hA0 (by positivity : (0 : ℝ) ≤\n 0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)\n have hle2 := mul_le_mul_of_nonneg_left hA1 (by positivity : (0 : ℝ) ≤ 0.433)\n have hle3 := mul_le_mul_of_nonneg_left hA2 (by positivity : (0 : ℝ) ≤ 0.886)\n linarith [hle1, hle2, hle3]\"\"\"\nnew = \"\"\" have heval : (∑' ℓ : ℕ,\n 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((ℓ : ℝ) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((ℓ : ℝ) + 14) / (((ℓ : ℝ) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((ℓ : ℝ) + 14)) / (((ℓ : ℝ) + 14) + 10) ^ 2)))\n ≤ 4.5 * ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / 23)\n + 0.433 * 0.1687 + 0.886 * 0.0621) := by\n rw [tsum_mul_left]\n apply mul_le_mul_of_nonneg_left _ (by norm_num : (0 : ℝ) ≤ 4.5)\n have hdecomp : (∑' x : ℕ,\n ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : ℝ) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((x : ℝ) + 14)) / (((x : ℝ) + 14) + 10) ^ 2)))\n = (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (∑' x : ℕ, (1 / (((x : ℝ) + 14) + 10) ^ 2))\n + 0.433 * (∑' x : ℕ, (Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2))\n + 0.886 * (∑' x : ℕ, (Real.log (Real.log ((x : ℝ) + 14)) / (((x : ℝ) + 14) + 10) ^ 2)) := by\n have e1 := Summable.tsum_add\n (f := fun x : ℕ => (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : ℝ) + 14) + 10) ^ 2)\n + 0.433 * Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2)\n (g := fun x : ℕ => 0.886 * Real.log (Real.log ((x : ℝ) + 14)) / (((x : ℝ) + 14) + 10) ^ 2)\n ((tail14_inv_add_sq_summable.mul_left _).add (tail14_log_div_add_sq_summable.mul_left _))\n (tail14_loglog_div_add_sq_summable.mul_left _)\n have e2 := Summable.tsum_add\n (f := fun x : ℕ => (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : ℝ) + 14) + 10) ^ 2))\n (g := fun x : ℕ => 0.433 * Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2)\n (tail14_inv_add_sq_summable.mul_left _) (tail14_log_div_add_sq_summable.mul_left _)\n rw [show (∑' x : ℕ,\n ((0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : ℝ) + 14) + 10) ^ 2)\n + (0.433 * Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2)\n + (0.886 * Real.log (Real.log ((x : ℝ) + 14)) / (((x : ℝ) + 14) + 10) ^ 2)))\n = ∑' x : ℕ, ((fun x : ℕ =>\n (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : ℝ) + 14) + 10) ^ 2)\n + 0.433 * Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2) x\n + (fun x : ℕ => 0.886 * Real.log (Real.log ((x : ℝ) + 14)) / (((x : ℝ) + 14) + 10) ^ 2) x)\n from rfl]\n rw [e1]\n rw [show (∑' x : ℕ, (fun x : ℕ =>\n (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : ℝ) + 14) + 10) ^ 2)\n + 0.433 * Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2) x)\n = ∑' x : ℕ, ((fun x : ℕ =>\n (0.433 * 0.1942 + 0.886 * 0.0736 + 2.9) * (1 / (((x : ℝ) + 14) + 10) ^ 2)) x\n + (fun x : ℕ => 0.433 * Real.log ((x : ℝ) + 14) / (((x : ℝ) + 14) + 10) ^ 2) x)\n from rfl]\n rw [e2, tsum_mul_left, tsum_mul_left, tsum_mul_left]\n rw [hdecomp]\n have hle1 := mul_le_mul_of_nonneg_left hA0 (by positivity : (0 : ℝ) ≤\n 0.433 * 0.1942 + 0.886 * 0.0736 + 2.9)\n have hle2 := mul_le_mul_of_nonneg_left hA1 (by positivity : (0 : ℝ) ≤ 0.433)\n have hle3 := mul_le_mul_of_nonneg_left hA2 (by positivity : (0 : ℝ) ≤ 0.886)\n linarith [hle1, hle2, hle3]\"\"\"\nassert old in src\nsrc = src.replace(old, new)\n\nopen(p, 'w', encoding='utf-8').write(src)\nprint(\"done\")\n"},"extra_content":null}]