← Session 17 — Lean tier (i): elementary proofs (after crash)
thinking (5604 chars)
Batch 1 compiles: `deriv2_of_hasDerivAt_nhds`, `psiOf`, `psiOf_id`, `psiOf_log_shift`. Also need sign lemmas. Let me now add the SIGN lemmas for id and log_shift, plus block L2 (psiOf_log_log_shift) with formula + sign. And think about consolidating: sign lemmas will share bounds (T ≥ √20+1 ⟹ T ≥ 5.4721, L1 ≥ 2, L2 ≥ 0.693). Prove a bounds lemma first:
```lean
/-- Bounds at the block-table range: T ≥ √20+1 ⟹ T ≥ 5.4721, L1 ≥ 2, L2 ≥ 0.6931. -/
theorem block_range_bounds {T : ℝ} (hT : Real.sqrt 20 + 1 ≤ T) :
5.4721 ≤ T ∧ 2 ≤ Real.log (T + 2) ∧ 0.6931 ≤ Real.log (Real.log (T + 2)) := by
have hs : (4.4721 : ℝ) ≤ Real.sqrt 20 := by
rw [Real.le_sqrt (by norm_num)] -- ? signature: Real.le_sqrt (hy : 0 ≤ y) : x ≤ sqrt y ↔ x ^ 2 ≤ y? or (hx : 0 ≤ x)?
norm_num
...
```
Real.le_sqrt signature: `Real.le_sqrt (hx : 0 ≤ x) (hy : 0 ≤ y) : x ≤ sqrt y ↔ x ^ 2 ≤ y`? or one side. There's `Real.le_sqrt' (hx : 0 < x) : x ≤ sqrt y ↔ x^2 ≤ y`? Let me just: have : (4.4721:ℝ)^2 ≤ 20 := by norm_num; exact Real.le_sqrt_of_sq_le?? `Real.le_sqrt_of_sq_le : x^2 ≤ y → x ≤ sqrt y`? Hmm `Real.le_sqrt_of_sq_le (h : x ^ 2 ≤ y) : x ≤ Real.sqrt y`? I believe `Real.le_sqrt_of_sq_le` exists (needs 0 ≤ x? maybe not since sqrt handles). Grep at write time; fallback: rw [Real.le_sqrt (by norm_num : (0:ℝ) ≤ 4.4721)]; norm_num — check Real.le_sqrt form.
Then T ≥ 4.4721 + 1 = 5.4721 ✓ linarith.
L1 = log(T+2) ≥ 2: T+2 ≥ 7.4721 ≥ e²: e² = (exp 1)² ≤ 2.7182818286² ≈ 7.389056...: exp_one_lt_d9 : Real.exp 1 < 2.7182818286 ✓. So (exp 1)^2 ≤ 2.7182818286^2 = 7.3890570... ≤ 7.4721 ≤ T+2. log(exp 2) = 2: exp 2 = (exp 1)^2: Real.exp_nat_mul? exp 2 = exp(1+1) = exp 1 * exp 1 ✓ Real.exp_add. log((exp 1)^2) = 2·log(exp 1) = 2·1 = 2 (Real.log_exp ✓). So:
have hL1 : (2:ℝ) ≤ Real.log (T + 2) := by
have h1 : Real.exp 2 ≤ T + 2 := by
have he : Real.exp 2 = Real.exp 1 * Real.exp 1 := by rw [← Real.exp_add]; norm_num
have hd : Real.exp 1 < 2.7182818286 := Real.exp_one_lt_d9
have hle : Real.exp 1 * Real.exp 1 ≤ 2.7182818286 * 2.7182818286 := by
apply mul_le_mul (le_of_lt hd) (le_of_lt hd) (by positivity) (by positivity... le_trans (Real.exp_pos 1).le hd.le)
...
have h2 := Real.log_le_log (Real.exp_pos 2) h1 -- log (exp 2) ≤ log (T+2); name check
rwa [Real.log_exp] at h2
Real.log_le_log signature: `Real.log_le_log (h₀ : 0 < x) (h₁ : x ≤ y) : log x ≤ log y`? or (0 < x) → (x ≤ y) → ...: there's `Real.log_le_log_iff (hy : 0 < y)`? and `Real.log_le_log_of_le`? Let me grep once. Also `Real.log_le_log (hx : 0 < x) (h : x ≤ y)` — pretty sure this exact form exists.
L2 = log(L1) ≥ 0.6931: L1 ≥ 2 → log L1 ≥ log 2 ≥ 0.6931471803 > 0.6931: Real.log_two_gt_d9 : 0.6931471803 < Real.log 2 ✓. log_le_log (0 < 2) (L1 ≥ 2) ✓.
Then the sign lemmas:
sign_id: included in psiOf_id already (hT : 1 < T) ✓ done.
sign_log_shift: for T ≥ √20+1 (or just 1 < T): −1/(T+2)² − 1/((T+2)(T−1)) < 0: both terms negative: 1/(T+2)² > 0 (sq pos), 1/((T+2)(T−1)) > 0 ✓.
```lean
theorem psiOf_log_shift_neg {T : ℝ} (hT : 1 < T) :
psiOf (fun t => Real.log (t + 2)) T < 0 := by
rw [psiOf_log_shift T hT]
have h1 : (0:ℝ) < 1 / (T + 2)^2 := by positivity -- needs T+2 ≠ 0: positivity uses... 1/(T+2)^2 > 0 always since (T+2)^2 > 0 (≠0): positivity might not know T+2 ≠ 0 — provide
...
```
positivity for 1/(T+2)^2: (T+2)^2 ≥ 0, need > 0: T+2 ≠ 0 — positivity can't from context... use one_div_pos.mpr (pow_pos (by linarith) 2) ✓ explicit. Then linarith.
Block L2 (log log (t+2)): psiOf formula:
psiOf (fun t => Real.log (Real.log (t+2))) T = -(L1+1)/((T+2)*L1)^2 - 1/((T+2)*L1*(T-1)) where L1 := Real.log (T+2).
Proof:
h1 : ∀ᶠ x in 𝓝 T, HasDerivAt (fun t => Real.log (Real.log (t+2))) (((x+2) * Real.log (x+2))⁻¹) x:
filter_upwards [eventually_gt_nhds (-2 < T), eventually_gt_nhds (show (-1:ℝ) < T ...)] — need log(x+2) ≠ 0 ⟸ x+2 > 1 ⟸ x > −1: eventually x > −1 (T > 1 ≥ −1 ✓ use eventually_gt_nhds (by linarith : (-1:ℝ) < T)). Then per x: inner g1 = fun t => t+2 (HasDerivAt 1), g2 = log (point x+2 ≠ 0), g3 = log (point log(x+2) ≠ 0).
h_inner : HasDerivAt (fun t => Real.log (t+2)) (x+2)⁻¹ x := the comp thing (as before).
h_outer : HasDerivAt Real.log (Real.log (x+2))⁻¹ (Real.log (x+2)) := Real.hasDerivAt_log (log(x+2) ≠ 0 from x+2 > 1 → log > 0).
comp: HasDerivAt (log ∘ (fun t => log (t+2))) ((log(x+2))⁻¹ * (x+2)⁻¹) x — massage to ((x+2)*log(x+2))⁻¹: (log)⁻¹ * (x+2)⁻¹ = ((x+2)*log)⁻¹ by mul_inv_rev (comm: (a*b)⁻¹ = a⁻¹*b⁻¹: mul_inv : (a*b)⁻¹ = a⁻¹*b⁻¹ ✓): ((x+2)*log(x+2))⁻¹ = (x+2)⁻¹ * (log)⁻¹ — order: mul_inv gives (a*b)⁻¹ = a⁻¹*b⁻¹ — I have (log)⁻¹*(x+2)⁻¹ = ((log)*(x+2))⁻¹ reversed: rewrite goal form to match: state D1 x := (Real.log (x+2))⁻¹ * (x+2)⁻¹ instead of ((x+2)*log)⁻¹ — simpler! Let D1 x := (Real.log (x+2))⁻¹ * (x+2)⁻¹ and the final ψ-formula manipulated by field_simp at the end anyway.
h2 : HasDerivAt D1 (−(L1+1)/((T+2)*L1)²) T where D1 t = (log(t+2))⁻¹ * (t+2)⁻¹:
D1 = product of u(t) = (log(t+2))⁻¹ and v(t) = (t+2)⁻¹.
u' = −(log(t+2))⁻²·(t+2)⁻¹ (from .inv of log-deriv: HasDerivAt (log(t+2)) (T+2)⁻¹ T → .inv (log(T+2)≠0) : HasDerivAt u (−(T+2)⁻¹/(log(T+2))²) T ✓).
v' = −1/(T+2)² (as before).
product rule: (u·v)' = u'·v + u·v' = [−(T+2)⁻¹/L1²]·(T+2)⁻¹ + L1⁻¹·(−(T+2)⁻²) = −1/((T+2)²L1²) − 1/((T+2)²L1) = −(1 + L1)/((T+2)²L1²) ✓.
Via HasDerivAt.mul hu hv : HasDerivAt (u*v) (u' * v T + u T * v') T — then massage with field_simp to −(L1+1)/((T+2)*L1)².
This is getting long — each block ~40-60 lines. There are 6 more blocks (L2, L1², L1L2, L2², TL1, TL2). ~300 lines total for formulas + signs. Proceed block by block. Write block L2 now.
Batch 1 compiles. Adding sign lemmas + block L2 (formula + sign).
tool: Edit
input
{
"file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiSkeleton.lean",
"old_string": "/-- [SKELETON] Margin convexity (D-057, draft \u00a73.1 Step 4): for any",
"new_string": "/-- [PROVED session 011] Block #10 sign: \u03c8 < 0 for T > 1. -/\ntheorem psiOf_log_shift_neg {T : \u211d} (hT : 1 < T) :\n psiOf (fun t => Real.log (t + 2)) T < 0 := by\n rw [psiOf_log_shift T hT]\n have h1 : (0 : \u211d) < 1 / (T + 2) ^ 2 := one_div_pos.mpr (pow_pos (by linarith) 2)\n have h2 : (0 : \u211d) < 1 / ((T + 2) * (T - 1)) :=\n one_div_pos.mpr (mul_pos (by linarith) (by linarith))\n linarith\n\n/-- [PROVED session 011] Block #11 (L2 = log log(T+2)): \u03c8-formula. -/\ntheorem psiOf_log_log_shift (T : \u211d) (hT : 1 < T) :\n psiOf (fun t => Real.log (Real.log (t + 2))) T =\n -(Real.log (T + 2) + 1) / ((T + 2) * Real.log (T + 2)) ^ 2 -\n 1 / ((T + 2) * Real.log (T + 2) * (T - 1)) := by\n have hT2 : (0 : \u211d) < T + 2 := by linarith\n have hL1 : (0 : \u211d) < Real.log (T + 2) := Real.log_pos (by linarith)\n have h1 : \u2200\u1da0 x in \ud835\udcdd T, HasDerivAt (fun t => Real.log (Real.log (t + 2)))\n ((Real.log (x + 2))\u207b\u00b9 * (x + 2)\u207b\u00b9) x := by\n filter_upwards [eventually_gt_nhds (by linarith : (-2 : \u211d) < T),\n eventually_gt_nhds (by linarith : (-1 : \u211d) < T)] with x hx2 hx1\n have hin : HasDerivAt (fun t => Real.log (t + 2)) (x + 2)\u207b\u00b9 x := by\n have h := (Real.hasDerivAt_log (show x + 2 \u2260 0 by linarith)).comp x\n ((hasDerivAt_id' x).add_const 2)\n rwa [mul_one] at h\n have hout : HasDerivAt Real.log (Real.log (x + 2))\u207b\u00b9 (Real.log (x + 2)) :=\n Real.hasDerivAt_log (ne_of_gt (Real.log_pos (by linarith)))\n exact hout.comp x hin\n have h2 : HasDerivAt (fun t => (Real.log (t + 2))\u207b\u00b9 * (t + 2)\u207b\u00b9)\n (-(Real.log (T + 2) + 1) / ((T + 2) * Real.log (T + 2)) ^ 2) T := by\n have hu : HasDerivAt (fun t => (Real.log (t + 2))\u207b\u00b9)\n (-(T + 2)\u207b\u00b9 / Real.log (T + 2) ^ 2) T := by\n have hin : HasDerivAt (fun t => Real.log (t + 2)) (T + 2)\u207b\u00b9 T := by\n have h := (Real.hasDerivAt_log (show T + 2 \u2260 0 by linarith)).comp T\n ((hasDerivAt_id' T).add_const 2)\n rwa [mul_one] at h\n have h := hin.inv (ne_of_gt hL1)\n have e : -(T + 2)\u207b\u00b9 / Real.log (T + 2) ^ 2 =\n -((T + 2)\u207b\u00b9 / Real.log (T + 2) ^ 2) := by ring\n rwa [e] at h\n have hv : HasDerivAt (fun t => (t + 2)\u207b\u00b9) (-1 / (T + 2) ^ 2) T := by\n have h := ((hasDerivAt_id' T).add_const 2).inv (by linarith : (T + 2) \u2260 0)\n have e : (-(1 : \u211d)) / (T + 2) ^ 2 = -1 / (T + 2) ^ 2 := by ring\n rwa [e] at h\n have h := hu.mul hv\n have hT2' : (T + 2) \u2260 0 := ne_of_gt hT2\n have hL1' : Real.log (T + 2) \u2260 0 := ne_of_gt hL1\n convert h using 2 <;> field_simp [hT2', hL1'] <;> ring\n have hd2 := deriv2_of_hasDerivAt_nhds h1 h2\n have hd1 : deriv (fun t => Real.log (Real.log (t + 2))) T =\n (Real.log (T + 2))\u207b\u00b9 * (T + 2)\u207b\u00b9 := h1.self_of_nhds.deriv\n unfold psiOf\n rw [hd2, hd1]\n have hT1 : (T - 1) \u2260 0 := by linarith\n have hT2' : (T + 2) \u2260 0 := ne_of_gt hT2\n have hL1' : Real.log (T + 2) \u2260 0 := ne_of_gt hL1\n field_simp [hT1, hT2', hL1']\n ring\n\n/-- [PROVED session 011] Block #11 sign: \u03c8 < 0 for T > 1. -/\ntheorem psiOf_log_log_shift_neg {T : \u211d} (hT : 1 < T) :\n psiOf (fun t => Real.log (Real.log (t + 2))) T < 0 := by\n rw [psiOf_log_log_shift T hT]\n have hL1 : (0 : \u211d) < Real.log (T + 2) := Real.log_pos (by linarith)\n have hp1 : (0 : \u211d) < (Real.log (T + 2) + 1) / ((T + 2) * Real.log (T + 2)) ^ 2 :=\n div_pos (by linarith) (pow_pos (mul_pos (by linarith) hL1) 2)\n have hp2 : (0 : \u211d) < 1 / ((T + 2) * Real.log (T + 2) * (T - 1)) :=\n one_div_pos.mpr (mul_pos (mul_pos (by linarith) hL1) (by linarith))\n linarith\n\n/-- [SKELETON] Margin convexity (D-057, draft \u00a73.1 Step 4): for any"
}
raw content_json (database row)
[{"type":"thinking","thinking":"Batch 1 compiles: `deriv2_of_hasDerivAt_nhds`, `psiOf`, `psiOf_id`, `psiOf_log_shift`. Also need sign lemmas. Let me now add the SIGN lemmas for id and log_shift, plus block L2 (psiOf_log_log_shift) with formula + sign. And think about consolidating: sign lemmas will share bounds (T ≥ √20+1 ⟹ T ≥ 5.4721, L1 ≥ 2, L2 ≥ 0.693). Prove a bounds lemma first:\n\n```lean\n/-- Bounds at the block-table range: T ≥ √20+1 ⟹ T ≥ 5.4721, L1 ≥ 2, L2 ≥ 0.6931. -/\ntheorem block_range_bounds {T : ℝ} (hT : Real.sqrt 20 + 1 ≤ T) :\n 5.4721 ≤ T ∧ 2 ≤ Real.log (T + 2) ∧ 0.6931 ≤ Real.log (Real.log (T + 2)) := by\n have hs : (4.4721 : ℝ) ≤ Real.sqrt 20 := by\n rw [Real.le_sqrt (by norm_num)] -- ? signature: Real.le_sqrt (hy : 0 ≤ y) : x ≤ sqrt y ↔ x ^ 2 ≤ y? or (hx : 0 ≤ x)?\n norm_num\n ...\n```\nReal.le_sqrt signature: `Real.le_sqrt (hx : 0 ≤ x) (hy : 0 ≤ y) : x ≤ sqrt y ↔ x ^ 2 ≤ y`? or one side. There's `Real.le_sqrt' (hx : 0 < x) : x ≤ sqrt y ↔ x^2 ≤ y`? Let me just: have : (4.4721:ℝ)^2 ≤ 20 := by norm_num; exact Real.le_sqrt_of_sq_le?? `Real.le_sqrt_of_sq_le : x^2 ≤ y → x ≤ sqrt y`? Hmm `Real.le_sqrt_of_sq_le (h : x ^ 2 ≤ y) : x ≤ Real.sqrt y`? I believe `Real.le_sqrt_of_sq_le` exists (needs 0 ≤ x? maybe not since sqrt handles). Grep at write time; fallback: rw [Real.le_sqrt (by norm_num : (0:ℝ) ≤ 4.4721)]; norm_num — check Real.le_sqrt form.\n\nThen T ≥ 4.4721 + 1 = 5.4721 ✓ linarith.\nL1 = log(T+2) ≥ 2: T+2 ≥ 7.4721 ≥ e²: e² = (exp 1)² ≤ 2.7182818286² ≈ 7.389056...: exp_one_lt_d9 : Real.exp 1 < 2.7182818286 ✓. So (exp 1)^2 ≤ 2.7182818286^2 = 7.3890570... ≤ 7.4721 ≤ T+2. log(exp 2) = 2: exp 2 = (exp 1)^2: Real.exp_nat_mul? exp 2 = exp(1+1) = exp 1 * exp 1 ✓ Real.exp_add. log((exp 1)^2) = 2·log(exp 1) = 2·1 = 2 (Real.log_exp ✓). So:\nhave hL1 : (2:ℝ) ≤ Real.log (T + 2) := by\n have h1 : Real.exp 2 ≤ T + 2 := by\n have he : Real.exp 2 = Real.exp 1 * Real.exp 1 := by rw [← Real.exp_add]; norm_num\n have hd : Real.exp 1 < 2.7182818286 := Real.exp_one_lt_d9\n have hle : Real.exp 1 * Real.exp 1 ≤ 2.7182818286 * 2.7182818286 := by\n apply mul_le_mul (le_of_lt hd) (le_of_lt hd) (by positivity) (by positivity... le_trans (Real.exp_pos 1).le hd.le) \n ...\n have h2 := Real.log_le_log (Real.exp_pos 2) h1 -- log (exp 2) ≤ log (T+2); name check\n rwa [Real.log_exp] at h2\nReal.log_le_log signature: `Real.log_le_log (h₀ : 0 < x) (h₁ : x ≤ y) : log x ≤ log y`? or (0 < x) → (x ≤ y) → ...: there's `Real.log_le_log_iff (hy : 0 < y)`? and `Real.log_le_log_of_le`? Let me grep once. Also `Real.log_le_log (hx : 0 < x) (h : x ≤ y)` — pretty sure this exact form exists.\n\nL2 = log(L1) ≥ 0.6931: L1 ≥ 2 → log L1 ≥ log 2 ≥ 0.6931471803 > 0.6931: Real.log_two_gt_d9 : 0.6931471803 < Real.log 2 ✓. log_le_log (0 < 2) (L1 ≥ 2) ✓.\n\nThen the sign lemmas:\n\nsign_id: included in psiOf_id already (hT : 1 < T) ✓ done.\n\nsign_log_shift: for T ≥ √20+1 (or just 1 < T): −1/(T+2)² − 1/((T+2)(T−1)) < 0: both terms negative: 1/(T+2)² > 0 (sq pos), 1/((T+2)(T−1)) > 0 ✓. \n```lean\ntheorem psiOf_log_shift_neg {T : ℝ} (hT : 1 < T) :\n psiOf (fun t => Real.log (t + 2)) T < 0 := by\n rw [psiOf_log_shift T hT]\n have h1 : (0:ℝ) < 1 / (T + 2)^2 := by positivity -- needs T+2 ≠ 0: positivity uses... 1/(T+2)^2 > 0 always since (T+2)^2 > 0 (≠0): positivity might not know T+2 ≠ 0 — provide\n ...\n```\npositivity for 1/(T+2)^2: (T+2)^2 ≥ 0, need > 0: T+2 ≠ 0 — positivity can't from context... use one_div_pos.mpr (pow_pos (by linarith) 2) ✓ explicit. Then linarith.\n\nBlock L2 (log log (t+2)): psiOf formula:\npsiOf (fun t => Real.log (Real.log (t+2))) T = -(L1+1)/((T+2)*L1)^2 - 1/((T+2)*L1*(T-1)) where L1 := Real.log (T+2).\n\nProof:\nh1 : ∀ᶠ x in 𝓝 T, HasDerivAt (fun t => Real.log (Real.log (t+2))) (((x+2) * Real.log (x+2))⁻¹) x:\n filter_upwards [eventually_gt_nhds (-2 < T), eventually_gt_nhds (show (-1:ℝ) < T ...)] — need log(x+2) ≠ 0 ⟸ x+2 > 1 ⟸ x > −1: eventually x > −1 (T > 1 ≥ −1 ✓ use eventually_gt_nhds (by linarith : (-1:ℝ) < T)). Then per x: inner g1 = fun t => t+2 (HasDerivAt 1), g2 = log (point x+2 ≠ 0), g3 = log (point log(x+2) ≠ 0). \n h_inner : HasDerivAt (fun t => Real.log (t+2)) (x+2)⁻¹ x := the comp thing (as before).\n h_outer : HasDerivAt Real.log (Real.log (x+2))⁻¹ (Real.log (x+2)) := Real.hasDerivAt_log (log(x+2) ≠ 0 from x+2 > 1 → log > 0).\n comp: HasDerivAt (log ∘ (fun t => log (t+2))) ((log(x+2))⁻¹ * (x+2)⁻¹) x — massage to ((x+2)*log(x+2))⁻¹: (log)⁻¹ * (x+2)⁻¹ = ((x+2)*log)⁻¹ by mul_inv_rev (comm: (a*b)⁻¹ = a⁻¹*b⁻¹: mul_inv : (a*b)⁻¹ = a⁻¹*b⁻¹ ✓): ((x+2)*log(x+2))⁻¹ = (x+2)⁻¹ * (log)⁻¹ — order: mul_inv gives (a*b)⁻¹ = a⁻¹*b⁻¹ — I have (log)⁻¹*(x+2)⁻¹ = ((log)*(x+2))⁻¹ reversed: rewrite goal form to match: state D1 x := (Real.log (x+2))⁻¹ * (x+2)⁻¹ instead of ((x+2)*log)⁻¹ — simpler! Let D1 x := (Real.log (x+2))⁻¹ * (x+2)⁻¹ and the final ψ-formula manipulated by field_simp at the end anyway.\n\nh2 : HasDerivAt D1 (−(L1+1)/((T+2)*L1)²) T where D1 t = (log(t+2))⁻¹ * (t+2)⁻¹:\n D1 = product of u(t) = (log(t+2))⁻¹ and v(t) = (t+2)⁻¹.\n u' = −(log(t+2))⁻²·(t+2)⁻¹ (from .inv of log-deriv: HasDerivAt (log(t+2)) (T+2)⁻¹ T → .inv (log(T+2)≠0) : HasDerivAt u (−(T+2)⁻¹/(log(T+2))²) T ✓).\n v' = −1/(T+2)² (as before).\n product rule: (u·v)' = u'·v + u·v' = [−(T+2)⁻¹/L1²]·(T+2)⁻¹ + L1⁻¹·(−(T+2)⁻²) = −1/((T+2)²L1²) − 1/((T+2)²L1) = −(1 + L1)/((T+2)²L1²) ✓.\n Via HasDerivAt.mul hu hv : HasDerivAt (u*v) (u' * v T + u T * v') T — then massage with field_simp to −(L1+1)/((T+2)*L1)².\n\nThis is getting long — each block ~40-60 lines. There are 6 more blocks (L2, L1², L1L2, L2², TL1, TL2). ~300 lines total for formulas + signs. Proceed block by block. Write block L2 now.","signature":""},{"type":"text","text":"Batch 1 compiles. Adding sign lemmas + block L2 (formula + sign)."},{"type":"tool_use","id":"Edit_115","name":"Edit","input":{"file_path":"D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiSkeleton.lean","old_string":"/-- [SKELETON] Margin convexity (D-057, draft §3.1 Step 4): for any","new_string":"/-- [PROVED session 011] Block #10 sign: ψ < 0 for T > 1. -/\ntheorem psiOf_log_shift_neg {T : ℝ} (hT : 1 < T) :\n psiOf (fun t => Real.log (t + 2)) T < 0 := by\n rw [psiOf_log_shift T hT]\n have h1 : (0 : ℝ) < 1 / (T + 2) ^ 2 := one_div_pos.mpr (pow_pos (by linarith) 2)\n have h2 : (0 : ℝ) < 1 / ((T + 2) * (T - 1)) :=\n one_div_pos.mpr (mul_pos (by linarith) (by linarith))\n linarith\n\n/-- [PROVED session 011] Block #11 (L2 = log log(T+2)): ψ-formula. -/\ntheorem psiOf_log_log_shift (T : ℝ) (hT : 1 < T) :\n psiOf (fun t => Real.log (Real.log (t + 2))) T =\n -(Real.log (T + 2) + 1) / ((T + 2) * Real.log (T + 2)) ^ 2 -\n 1 / ((T + 2) * Real.log (T + 2) * (T - 1)) := by\n have hT2 : (0 : ℝ) < T + 2 := by linarith\n have hL1 : (0 : ℝ) < Real.log (T + 2) := Real.log_pos (by linarith)\n have h1 : ∀ᶠ x in 𝓝 T, HasDerivAt (fun t => Real.log (Real.log (t + 2)))\n ((Real.log (x + 2))⁻¹ * (x + 2)⁻¹) x := by\n filter_upwards [eventually_gt_nhds (by linarith : (-2 : ℝ) < T),\n eventually_gt_nhds (by linarith : (-1 : ℝ) < T)] with x hx2 hx1\n have hin : HasDerivAt (fun t => Real.log (t + 2)) (x + 2)⁻¹ x := by\n have h := (Real.hasDerivAt_log (show x + 2 ≠ 0 by linarith)).comp x\n ((hasDerivAt_id' x).add_const 2)\n rwa [mul_one] at h\n have hout : HasDerivAt Real.log (Real.log (x + 2))⁻¹ (Real.log (x + 2)) :=\n Real.hasDerivAt_log (ne_of_gt (Real.log_pos (by linarith)))\n exact hout.comp x hin\n have h2 : HasDerivAt (fun t => (Real.log (t + 2))⁻¹ * (t + 2)⁻¹)\n (-(Real.log (T + 2) + 1) / ((T + 2) * Real.log (T + 2)) ^ 2) T := by\n have hu : HasDerivAt (fun t => (Real.log (t + 2))⁻¹)\n (-(T + 2)⁻¹ / Real.log (T + 2) ^ 2) T := by\n have hin : HasDerivAt (fun t => Real.log (t + 2)) (T + 2)⁻¹ T := by\n have h := (Real.hasDerivAt_log (show T + 2 ≠ 0 by linarith)).comp T\n ((hasDerivAt_id' T).add_const 2)\n rwa [mul_one] at h\n have h := hin.inv (ne_of_gt hL1)\n have e : -(T + 2)⁻¹ / Real.log (T + 2) ^ 2 =\n -((T + 2)⁻¹ / Real.log (T + 2) ^ 2) := by ring\n rwa [e] at h\n have hv : HasDerivAt (fun t => (t + 2)⁻¹) (-1 / (T + 2) ^ 2) T := by\n have h := ((hasDerivAt_id' T).add_const 2).inv (by linarith : (T + 2) ≠ 0)\n have e : (-(1 : ℝ)) / (T + 2) ^ 2 = -1 / (T + 2) ^ 2 := by ring\n rwa [e] at h\n have h := hu.mul hv\n have hT2' : (T + 2) ≠ 0 := ne_of_gt hT2\n have hL1' : Real.log (T + 2) ≠ 0 := ne_of_gt hL1\n convert h using 2 <;> field_simp [hT2', hL1'] <;> ring\n have hd2 := deriv2_of_hasDerivAt_nhds h1 h2\n have hd1 : deriv (fun t => Real.log (Real.log (t + 2))) T =\n (Real.log (T + 2))⁻¹ * (T + 2)⁻¹ := h1.self_of_nhds.deriv\n unfold psiOf\n rw [hd2, hd1]\n have hT1 : (T - 1) ≠ 0 := by linarith\n have hT2' : (T + 2) ≠ 0 := ne_of_gt hT2\n have hL1' : Real.log (T + 2) ≠ 0 := ne_of_gt hL1\n field_simp [hT1, hT2', hL1']\n ring\n\n/-- [PROVED session 011] Block #11 sign: ψ < 0 for T > 1. -/\ntheorem psiOf_log_log_shift_neg {T : ℝ} (hT : 1 < T) :\n psiOf (fun t => Real.log (Real.log (t + 2))) T < 0 := by\n rw [psiOf_log_log_shift T hT]\n have hL1 : (0 : ℝ) < Real.log (T + 2) := Real.log_pos (by linarith)\n have hp1 : (0 : ℝ) < (Real.log (T + 2) + 1) / ((T + 2) * Real.log (T + 2)) ^ 2 :=\n div_pos (by linarith) (pow_pos (mul_pos (by linarith) hL1) 2)\n have hp2 : (0 : ℝ) < 1 / ((T + 2) * Real.log (T + 2) * (T - 1)) :=\n one_div_pos.mpr (mul_pos (mul_pos (by linarith) hL1) (by linarith))\n linarith\n\n/-- [SKELETON] Margin convexity (D-057, draft §3.1 Step 4): for any"},"extra_content":null}]