Guide

Series and limits

Taylor and Laurent expansions with a little-o remainder, and limits at a point, from one side or at ±∞.

On paper a Taylor expansion ends with +…, and I rarely stop to say what the dots mean. Here they become a theorem. Use a series to describe the local expansion of a function, and a limit to prove its limiting value. A series has exact coefficients and a theorem that the remainder is little-o of the last power, in Mathlib’s =o[𝓝 a]. A limit comes with a theorem about Filter.Tendsto on the filter that fits: the neighborhood of the point or the punctured one, one side of it, or atTop and atBot for ±∞.

Series

  • seriesA Taylor or Laurent expansion at a rational point, with exact coefficients and a little-o remainder theorem.

Limits

  • limitA limit at a rational point, from one side, or at ±∞, with a theorem about Mathlib’s Filter.Tendsto.

The exponential at 0. The theorem is the precise form of the dots: ex minus the printed polynomial is little-o of x6 as x→0:

In[1]:=
#cas [series x 0 6] (exp x)
Out[1]=

Taylor polynomial with exact coefficients

1+x+12x2+16x3+124x4+1120x5+1720x6+o(x6)
1 + x + 1/2*x^2 + 1/6*x^3 + 1/24*x^4 + 1/120*x^5 + 1/720*x^6 + o(x^6)
Domain
x → 0

Checked by Lean’s kernel: Taylor expansion with a little-o remainder

(fun x ↦
    Real.exp x -
      (1 + x + 1 / 2 * x ^ 2 + 1 / 6 * x ^ 3 + 1 / 24 * x ^ 4 + 1 / 120 * x ^ 5 + 1 / 720 * x ^ 6)) =o[nhds 0]
  fun x ↦ x ^ 6
The certificate: 1 checked step
  1. Taylor expansion with a little-o remainder

    (fun x ↦
        Real.exp x -
          (1 + x + 1 / 2 * x ^ 2 + 1 / 6 * x ^ 3 + 1 / 24 * x ^ 4 + 1 / 120 * x ^ 5 + 1 / 720 * x ^ 6)) =o[nhds 0]
      fun x ↦ x ^ 6

    Checked by Lean’s kernel

The computation
  • Checked coefficients

    Coefficients of (x - 0)^0, …, ^6: [1, 1, 1/2, 1/6, 1/24, 1/120, 1/720]

The classical limit. In Lean sinx/x is 0/0=0 at x=0, so the value there is beside the point, and the theorem is on the punctured neighborhood of 0. In a proof, the tactic cas proves the same Tendsto statement:

In[2]:=
#cas [limit x → 0] (sin x / x)
Out[2]=

exact limit

1
Domain
x → 0, x ≠ 0

Checked by Lean’s kernel: Limit from the leading terms of order 1

Filter.Tendsto (fun x ↦ Real.sin x / x) (nhdsWithin 0 {0}ᶜ) (nhds 1)
The certificate: 1 checked step
  1. Limit from the leading terms of order 1

    Filter.Tendsto (fun x ↦ Real.sin x / x) (nhdsWithin 0 {0}ᶜ) (nhds 1)

    Checked by Lean’s kernel

The computation
  • Leading terms

    Numerator 1 (x - a)^1, denominator 1 (x - a)^1 (not proof)

A series needs exact coefficients, so every function in it has to sit at a point where its value is rational: sin, cos, exp, atan and asin at 0, log at 1, and square roots of rational squares. The same goes for the derivatives that a limit of a quotient uses when its denominator vanishes. The center of a series is a rational number, and so is the point of a limit, unless it is ±∞. A series goes up to order 12. Limits at infinity go through an asymptotic comparison or the substitution x=1/t. Some are out of reach of both routes, and then the message says why each one stopped. The tactic cas doesn’t prove the little-o statement, so in a proof I take the printed theorem as a hypothesis.