Quadratic bounds for the arithmetic-geometric mean #
One arithmetic-geometric mean step bounds the new gap by the square of the old gap,
divided by eight times the smaller input. For 0 < y ≤ x, iterating this estimate
gives the bound
(agmSequences x y n).2 - (agmSequences x y n).1 ≤ 8 * y * ((x - y) / (8 * y)) ^ (2 ^ (n + 1)).
This upper bound decays to zero only when x < 9 * y, equivalently
(x - y) / (8 * y) < 1. Mathlib's NNReal.agmSequences has its zeroth term
already one step after the input pair.
We also show that the weighted differences of squares of the two means tend to zero. This controls the remainder in the AGM series for the second-kind elliptic integral.
The quadratic estimate follows Carlson.agmSeq_gap_succ from Bastiaan J Braams'
lean-codes, adapted to Mathlib's existing AGM sequences and their indexing.
References #
- J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, Chapters 1–2.
- Bastiaan J Braams,
Carlson/Elliptic/AGMSecondKind.leaninlean-codes: https://github.com/bjbraams/lean-codes/blob/2b8cba1/Carlson/Elliptic/AGMSecondKind.lean.
Both positive inputs give a positive geometric mean at every AGM step.
For 0 < y ≤ x, the gap between the arithmetic and geometric AGM sequences is
at most 8 * y * ((x - y) / (8 * y)) ^ (2 ^ (n + 1)). This upper bound decays to
zero only when x < 9 * y, equivalently (x - y) / (8 * y) < 1.
The index 0 already includes one AGM step.
The square of any geometric AGM mean is at most the square of any arithmetic AGM mean.
An AGM step turns the difference of squares into one quarter of the squared gap.
The weighted difference of squares decays geometrically:
2ⁿ⁺¹ (aₙ₊₁² - gₙ₊₁²) ≤ dist x y ² / 8 · (1/2)ⁿ, where
(gₙ₊₁, aₙ₊₁) = agmSequences x y (n + 1).
The differences of squares of the AGM means tend to zero even after multiplication
by 2ⁿ. This controls remainders in second-kind elliptic integral evaluation.