Documentation

LeanCert.Engine.TaylorModel.Log1p

Taylor Models - log(1+x) and Related Functions #

This file contains Taylor polynomial definitions and remainder bounds for log(1+x) centered at 0, which is essential for handling principal value integrals like li(x).

Main definitions #

Application: Bounds for the Logarithmic Integral li(x) #

The symmetric combination g(t) = 1/log(1+t) + 1/log(1-t) appears in the principal value integral for li(x). Despite each term having a singularity at t=0, the combination is bounded. This file provides the infrastructure to prove this.

Key identity: g(t) = [log(1-t) + log(1+t)] / [log(1+t) · log(1-t)] = log(1-t²) / [log(1+t) · log(1-t)]

Using Taylor: log(1±t) ≈ ±t - t²/2 ∓ ... Numerator: log(1-t²) = -t² + O(t⁴) Denominator: log(1+t)·log(1-t) = -t² + O(t³) Therefore: g(t) → 1 as t → 0

log(1+x) Taylor polynomial #

log(1+x) = x - x²/2 + x³/3 - x⁴/4 + ... = ∑_{k=1}^∞ (-1)^(k+1) x^k / k

Converges for x ∈ (-1, 1].

Taylor polynomial coefficients for log(1+x) at center 0: For k ≥ 1: coeff_k = (-1)^(k+1) / k For k = 0: coeff_0 = 0 (since log(1+0) = 0)

Equations
Instances For

    Lagrange remainder bound for log(1+x) Taylor series centered at 0. The (n+1)th derivative of log(1+x) is (-1)^n · n! / (1+x)^(n+1). For the Taylor expansion at center 0, ξ lies between 0 and z:

    • If z ≥ 0: ξ ∈ [0, z], so min(1+ξ) = 1
    • If z < 0: ξ ∈ [z, 0], so min(1+ξ) = 1+z ≥ 1+lo Overall minimum is min(1, 1+lo). |R_n(x)| ≤ |x|^(n+1) / [(n+1) · min(1, 1+lo)^(n+1)]
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Remainder bound is nonnegative for valid domains

      Taylor model for log(1+z) on domain J, centered at 0, degree n. Requires J.lo > -1 (domain must be in (-1, ∞)).

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Correctness theorem #

        theorem LeanCert.Engine.TaylorModel.iteratedDeriv_log1p {n : } (hn : n 0) {y : } (hy : -1 < y) :
        iteratedDeriv n (fun (x : ) => Real.log (1 + x)) y = (-1) ^ (n - 1) * (n - 1).factorial * (1 + y) ^ (-n)

        The n-th iterated derivative of log(1+x) at a point y > -1. Uses chain rule: since (1+x)' = 1, we have iteratedDeriv n (log ∘ (1+·)) y = iteratedDeriv n log (1+y). Combined with iteratedDeriv_log, this gives (-1)^(n-1) * (n-1)! * (1+y)^(-n).

        theorem LeanCert.Engine.TaylorModel.iteratedDeriv_log1p_zero {n : } (hn : n 0) :
        iteratedDeriv n (fun (x : ) => Real.log (1 + x)) 0 = (-1) ^ (n - 1) * (n - 1).factorial

        At x = 0, the n-th derivative of log(1+x) is (-1)^(n-1) * (n-1)!.

        theorem LeanCert.Engine.TaylorModel.log1pTaylorCoeffs_eq_deriv (n i : ) (hi_pos : 0 < i) (hi_le : i n) :
        (log1pTaylorCoeffs n i) = iteratedDeriv i (fun (x : ) => Real.log (1 + x)) 0 / i.factorial

        The coefficients of log1pTaylorPoly match the Taylor coefficients of log(1+x).

        The polynomial evaluation of log1pTaylorPoly equals the Taylor sum.

        The Taylor remainder for log(1+x) at center 0 is bounded by the Lagrange form. This follows the standard Lagrange remainder bound proof:

        • log(1+x) is C^∞ on (-1, ∞)
        • The (n+1)th derivative is ±n!/(1+x)^(n+1)
        • Apply taylor_remainder_bound_on to get the bound
        theorem LeanCert.Engine.TaylorModel.tmLog1p_correct (J : Core.IntervalRat) (n : ) (tm : TaylorModel) (h : tmLog1p J n = some tm) (z : ) :
        z JReal.log (1 + z) tm.evalSet z

        log(1+z) ∈ (tmLog1p J n).evalSet z for all z in J when J.lo > -1.

        Symmetric combination bound for li(x) #

        The key insight: g(t) = 1/log(1+t) + 1/log(1-t) is bounded for t ∈ (0, 1).

        Algebraically: g(t) = [log(1-t) + log(1+t)] / [log(1+t) · log(1-t)] = log(1-t²) / [log(1+t) · log(1-t)]

        Using Taylor expansions: log(1+t) = t - t²/2 + t³/3 - ... log(1-t) = -t - t²/2 - t³/3 - ... log(1-t²) = -t² - t⁴/2 - t⁶/3 - ...

        Numerator: log(1-t²) = -t² · (1 + t²/2 + t⁴/3 + ...) Denominator: log(1+t) · log(1-t) = (t - t²/2 + ...)(-t - t²/2 - ...) = -t² + t⁴/4 + ... = -t² · (1 - t²/4 - ...)

        So g(t) = [-t² · (1 + O(t²))] / [-t² · (1 + O(t²))] = 1 + O(t²)

        More precisely: g(t) = [1 + t²/2 + O(t⁴)] / [1 - t²/4 + O(t⁴)] → 1 as t → 0

        The symmetric combination g(t) = 1/log(1+t) + 1/log(1-t). This is well-defined for t ∈ (0, 1) despite the apparent singularity at t = 0.

        Equations
        Instances For
          theorem LeanCert.Engine.TaylorModel.symmetricLogCombination_alt (t : ) (ht_pos : 0 < t) (ht_lt : t < 1) :

          Alternative form: g(t) = log(1-t²) / (log(1+t) · log(1-t))

          Helper: log(1+t)/t → 1 as t → 0. This follows from log'(1) = 1.

          Helper: log(1-t)/t → -1 as t → 0⁺.

          Helper: log(1-t²)/t² → -1 as t → 0⁺.

          The limit as t → 0⁺ of g(t) is 1.

          Proof using the key identity and limits: g(t) = log(1-t²) / (log(1+t) · log(1-t)) = [log(1-t²)/t²] / [(log(1+t)/t) · (log(1-t)/t)]

          As t → 0⁺:

          • log(1-t²)/t² → -1
          • log(1+t)/t → 1
          • log(1-t)/t → -1

          So g(t) → (-1) / (1 · (-1)) = 1

          Symmetric combination bound: |g(t)| ≤ C for t ∈ (0, δ) where δ < 1.

          For small t, using Taylor analysis: g(t) = 1 + t²/2 · (1/log(1-t²) - 1/log(1+t) - 1/log(1-t)) + O(t⁴)

          A crude but sufficient bound: for t ∈ (0, 1/2), |g(t)| ≤ 2. This can be refined using Taylor model arithmetic.

          Summary of proven results for the li(2) computation #

          All proofs complete (no sorry):

          The key insight for the li(2) computation is symmetricLogCombination_tendsto_one: the symmetric combination g(t) = 1/log(1+t) + 1/log(1-t) has a REMOVABLE SINGULARITY at t=0, with limit 1. This makes the principal value integral for li(2) = ∫₀¹ g(t) dt absolutely convergent.