pith. machine review for the scientific record. sign in
lemma

phi_minus_one_abs

proved
show as:
view math explainer →
module
IndisputableMonolith.Numerics.Interval.Log
domain
Numerics
line
92 · github
papers citing
none yet

open explainer

Generate a durable explainer page for this declaration.

open lean source

IndisputableMonolith.Numerics.Interval.Log on GitHub at line 92.

browse module

All declarations in this module, on Recognition.

explainer page

Tracked in the explainer inventory; generation is lazy so crawlers do not trigger LLM jobs.

open explainer

depends on

used by

formal source

  89-/
  90
  91/-- For x = φ - 1, we have 0 < x < 1, so |x| = x -/
  92lemma phi_minus_one_abs : |Real.goldenRatio - 1| = Real.goldenRatio - 1 := by
  93  rw [abs_of_pos phi_sub_one_pos]
  94
  95/-- x = φ - 1 satisfies |x| < 1 -/
  96lemma phi_minus_one_abs_lt_one : |Real.goldenRatio - 1| < 1 := by
  97  rw [phi_minus_one_abs]
  98  exact phi_sub_one_lt_one
  99
 100/-- Helper: ‖(x : ℂ)‖ = |x| for real x -/
 101lemma complex_norm_ofReal (x : ℝ) : ‖(x : ℂ)‖ = |x| := by
 102  have : (x : ℂ) = (RCLike.ofReal x : ℂ) := rfl
 103  rw [this, RCLike.norm_ofReal]
 104
 105/-- Error bound for log Taylor polynomial on reals, using Complex.norm_log_sub_logTaylor_le -/
 106lemma log_taylor_error_bound {x : ℝ} (hx : |x| < 1) (n : ℕ) :
 107    |log (1 + x) - (Complex.logTaylor (n + 1) x).re| ≤ |x| ^ (n + 1) * (1 - |x|)⁻¹ / (n + 1) := by
 108  -- Use the complex version and specialize to reals
 109  have hx_complex : ‖(x : ℂ)‖ < 1 := by rw [complex_norm_ofReal]; exact hx
 110  have h := Complex.norm_log_sub_logTaylor_le n hx_complex
 111  -- log(1 + x) for real x equals Re(log(1 + x)) when 1 + x > 0
 112  have h1x_pos : (0 : ℝ) < 1 + x := by
 113    have : -1 < x := by
 114      have := abs_lt.mp hx
 115      linarith
 116    linarith
 117  have hlog_real : log (1 + x) = (Complex.log (1 + x)).re := by
 118    have h1 : (1 : ℂ) + (x : ℂ) = ((1 + x : ℝ) : ℂ) := by push_cast; ring
 119    rw [h1, Complex.log_ofReal_re]
 120  rw [hlog_real]
 121  have hsub_re : (Complex.log (1 + ↑x) - Complex.logTaylor (n + 1) ↑x).re =
 122      (Complex.log (1 + ↑x)).re - (Complex.logTaylor (n + 1) ↑x).re := by