The areas / V15. Real analysis in one variable
Mathlib.Analysis.SpecialFunctions.ArithmeticGeometricMean
39 declarations. Mathlib docs · Source
The arithmetic-geometric mean
Starting with two nonnegative real numbers, repeatedly replace them with their arithmetic and geometric means. By the AM-GM inequality, the smaller number (geometric mean) will monotonically increase and the larger number (arithmetic mean) will monotonically decrease.
The two monotone sequences converge to the same limit – the arithmetic-geometric mean (AGM).
This file defines the AGM in the NNReal namespace and proves some of its basic properties.
References
- https://en.wikipedia.org/wiki/Arithmetic–geometric_mean
theorem NNReal.sqrt_mul_le_half_add E1 #
∀ (x y : NNReal), NNReal.sqrt (x * y) ≤ (x + y) / 2
The AM–GM inequality for two NNReals, with means in canonical form.
theorem NNReal.sqrt_mul_lt_half_add_of_ne E1 #
∀ {x y : NNReal}, x ≠ y → NNReal.sqrt (x * y) < (x + y) / 2
The strict AM–GM inequality for two NNReals, with means in canonical form.
def NNReal.agmSequences E1 #
NNReal → NNReal → ℕ → NNReal × NNReal
agmSequences x y is the sequence of (geometric, arithmetic) means
converging to the arithmetic-geometric mean starting from x and y.
theorem NNReal.agmSequences_zero E0 #
∀ {x y : NNReal}, x.agmSequences y 0 = (NNReal.sqrt (x * y), (x + y) / 2)
theorem NNReal.agmSequences_succ E1 #
∀ {x y : NNReal} {n : ℕ}, x.agmSequences y (n + 1) = (NNReal.sqrt (x * y)).agmSequences ((x + y) / 2) n
theorem NNReal.agmSequences_succ' E1 #
∀ {x y : NNReal} {n : ℕ},
x.agmSequences y (n + 1) =
(NNReal.sqrt ((x.agmSequences y n).1 * (x.agmSequences y n).2),
((x.agmSequences y n).1 + (x.agmSequences y n).2) / 2)
theorem NNReal.agmSequences_comm E1 #
∀ {x y : NNReal}, x.agmSequences y = y.agmSequences x
theorem NNReal.le_gm_and_am_le E1 #
∀ {x y : NNReal}, x ≤ y → x ≤ NNReal.sqrt (x * y) ∧ (x + y) / 2 ≤ y
theorem NNReal.dist_gm_am_le E1 #
∀ {x y : NNReal}, dist (NNReal.sqrt (x * y)) ((x + y) / 2) ≤ dist x y / 2
theorem NNReal.agmSequences_monotone_and_antitone E1 #
∀ {x y : NNReal}, (Monotone fun n ↦ (x.agmSequences y n).1) ∧ Antitone fun n ↦ (x.agmSequences y n).2
theorem NNReal.agmSequences_fst_monotone E1 #
∀ {x y : NNReal}, Monotone fun n ↦ (x.agmSequences y n).1
theorem NNReal.agmSequences_snd_antitone E1 #
∀ {x y : NNReal}, Antitone fun n ↦ (x.agmSequences y n).2
theorem NNReal.agmSequences_fst_le_snd E1 #
∀ {x y : NNReal} (n m : ℕ), (x.agmSequences y n).1 ≤ (x.agmSequences y m).2
theorem NNReal.agmSequences_fst_lt_snd_of_ne E1 #
∀ {x y : NNReal}, x ≠ y → ∀ (n m : ℕ), (x.agmSequences y n).1 < (x.agmSequences y m).2
theorem NNReal.agmSequences_min_max E1 #
∀ {x y : NNReal}, (min x y).agmSequences (max x y) = x.agmSequences y
theorem NNReal.dist_agmSequences_fst_snd E1 #
∀ {x y : NNReal} (n : ℕ), dist (x.agmSequences y n).1 (x.agmSequences y n).2 ≤ dist x y / 2 ^ (n + 1)
theorem NNReal.tendsto_dist_agmSequences_atTop_zero E1 #
∀ {x y : NNReal}, Filter.Tendsto (fun n ↦ dist (x.agmSequences y n).1 (x.agmSequences y n).2) Filter.atTop (nhds 0)
def NNReal.agm E1 #
NNReal → NNReal → NNReal
The arithmetic-geometric mean of two NNReals, defined as the infimum of arithmetic means.
theorem NNReal.agm_comm E1 #
∀ {x y : NNReal}, x.agm y = y.agm x
theorem NNReal.agm_eq_ciInf E1 #
∀ {x y : NNReal}, x.agm y = ⨅ n, (x.agmSequences y n).2
theorem NNReal.tendsto_agmSequences_snd_agm E1 #
∀ {x y : NNReal}, Filter.Tendsto (fun n ↦ (x.agmSequences y n).2) Filter.atTop (nhds (x.agm y))
theorem NNReal.agm_le_agmSequences_snd E1 #
∀ {x y : NNReal} (n : ℕ), x.agm y ≤ (x.agmSequences y n).2
theorem NNReal.agm_le_max E1 #
∀ {x y : NNReal}, x.agm y ≤ max x y
theorem NNReal.bddAbove_range_agmSequences_fst E1 #
∀ {x y : NNReal}, BddAbove (Set.range fun n ↦ (x.agmSequences y n).1)
theorem NNReal.agm_eq_ciSup E1 #
∀ {x y : NNReal}, x.agm y = ⨆ n, (x.agmSequences y n).1
The AGM is also the supremum of the geometric means.
theorem NNReal.tendsto_agmSequences_fst_agm E1 #
∀ {x y : NNReal}, Filter.Tendsto (fun n ↦ (x.agmSequences y n).1) Filter.atTop (nhds (x.agm y))
theorem NNReal.agmSequences_fst_le_agm E1 #
∀ {x y : NNReal} (n : ℕ), (x.agmSequences y n).1 ≤ x.agm y
theorem NNReal.min_le_agm E1 #
∀ {x y : NNReal}, min x y ≤ x.agm y
theorem NNReal.agm_self E0 #
∀ {x : NNReal}, x.agm x = x
theorem NNReal.agm_zero_left E0 #
∀ {y : NNReal}, NNReal.agm 0 y = 0
theorem NNReal.agm_zero_right E0 #
∀ {x : NNReal}, x.agm 0 = 0
theorem NNReal.agm_pos E1 #
∀ {x y : NNReal}, 0 < x → 0 < y → 0 < x.agm y
theorem NNReal.agm_eq_agm_agmSequences_fst_agmSequences_snd E1 #
∀ {x y : NNReal} (n : ℕ), x.agm y = (x.agmSequences y n).1.agm (x.agmSequences y n).2
theorem NNReal.agm_eq_agm_gm_am E1 #
∀ {x y : NNReal}, x.agm y = (NNReal.sqrt (x * y)).agm ((x + y) / 2)
theorem NNReal.agmSequences_fst_lt_agm_of_pos_of_ne E1 #
∀ {x y : NNReal}, 0 < x → 0 < y → x ≠ y → ∀ (n : ℕ), (x.agmSequences y n).1 < x.agm y
theorem NNReal.agm_lt_agmSequences_snd_of_ne E1 #
∀ {x y : NNReal}, x ≠ y → ∀ (n : ℕ), x.agm y < (x.agmSequences y n).2
theorem NNReal.min_lt_agm_of_pos_of_ne E1 #
∀ {x y : NNReal}, 0 < x → 0 < y → x ≠ y → min x y < x.agm y
theorem NNReal.agm_lt_max_of_ne E1 #
∀ {x y : NNReal}, x ≠ y → x.agm y < max x y
theorem NNReal.agm_mul_distrib E1 #
∀ {x y k : NNReal}, (k * x).agm (k * y) = k * x.agm y
The AGM distributes over multiplication.