Documentation

Mathlib.Analysis.SpecialFunctions.ArithmeticGeometricMean

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 #

theorem NNReal.sqrt_mul_le_half_add (x y : 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 {x y : NNReal} (h : x β‰  y) :
sqrt (x * y) < (x + y) / 2

The strict AM–GM inequality for two NNReals, with means in canonical form.

noncomputable def NNReal.agmSequences (x y : NNReal) :
β„• β†’ NNReal Γ— NNReal

agmSequences x y is the sequence of (geometric, arithmetic) means converging to the arithmetic-geometric mean starting from x and y.

Instances For
    @[simp]
    theorem NNReal.agmSequences_zero {x y : NNReal} :
    x.agmSequences y 0 = (sqrt (x * y), (x + y) / 2)
    theorem NNReal.agmSequences_succ {x y : NNReal} {n : β„•} :
    x.agmSequences y (n + 1) = (sqrt (x * y)).agmSequences ((x + y) / 2) n
    theorem NNReal.agmSequences_succ' {x y : NNReal} {n : β„•} :
    x.agmSequences y (n + 1) = (sqrt ((x.agmSequences y n).1 * (x.agmSequences y n).2), ((x.agmSequences y n).1 + (x.agmSequences y n).2) / 2)
    theorem NNReal.le_gm_and_am_le {x y : NNReal} (h : x ≀ y) :
    x ≀ sqrt (x * y) ∧ (x + y) / 2 ≀ y
    theorem NNReal.dist_gm_am_le {x y : NNReal} :
    dist (sqrt (x * y)) ((x + y) / 2) ≀ dist x y / 2
    theorem NNReal.agmSequences_monotone_and_antitone {x y : NNReal} :
    (Monotone fun (n : β„•) => (x.agmSequences y n).1) ∧ Antitone fun (n : β„•) => (x.agmSequences y n).2
    theorem NNReal.agmSequences_fst_lt_snd_of_ne {x y : NNReal} (h : x β‰  y) (n m : β„•) :
    (x.agmSequences y n).1 < (x.agmSequences y m).2
    theorem NNReal.dist_agmSequences_fst_snd {x y : NNReal} (n : β„•) :
    dist (x.agmSequences y n).1 (x.agmSequences y n).2 ≀ dist x y / 2 ^ (n + 1)
    noncomputable def NNReal.agm (x y : NNReal) :

    The arithmetic-geometric mean of two NNReals, defined as the infimum of arithmetic means.

    Instances For
      theorem NNReal.agm_eq_ciInf {x y : NNReal} :
      x.agm y = β¨… (n : β„•), (x.agmSequences y n).2
      theorem NNReal.agm_eq_ciSup {x y : NNReal} :
      x.agm y = ⨆ (n : β„•), (x.agmSequences y n).1

      The AGM is also the supremum of the geometric means.

      @[simp]
      theorem NNReal.agm_self {x : NNReal} :
      x.agm x = x
      @[simp]
      theorem NNReal.agm_zero_left {y : NNReal} :
      agm 0 y = 0
      theorem NNReal.agm_pos {x y : NNReal} (hx : 0 < x) (hy : 0 < y) :
      0 < x.agm y
      theorem NNReal.agm_eq_agm_gm_am {x y : NNReal} :
      x.agm y = (sqrt (x * y)).agm ((x + y) / 2)
      theorem NNReal.agmSequences_fst_lt_agm_of_pos_of_ne {x y : NNReal} (hx : 0 < x) (hy : 0 < y) (hn : x β‰  y) (n : β„•) :
      (x.agmSequences y n).1 < x.agm y
      theorem NNReal.agm_lt_agmSequences_snd_of_ne {x y : NNReal} (hn : x β‰  y) (n : β„•) :
      x.agm y < (x.agmSequences y n).2
      theorem NNReal.min_lt_agm_of_pos_of_ne {x y : NNReal} (hx : 0 < x) (hy : 0 < y) (hn : x β‰  y) :
      min x y < x.agm y
      theorem NNReal.agm_lt_max_of_ne {x y : NNReal} (hn : x β‰  y) :
      x.agm y < max x y
      theorem NNReal.agm_mul_distrib {x y k : NNReal} :
      (k * x).agm (k * y) = k * x.agm y

      The AGM distributes over multiplication.