NLA-lib Explorer

An equioscillating error is the minimax error

Library · Result group

Theorem (AlternatesOn.minimaxError_eq). An equioscillating error is the minimax error: if \deg p \le n, \lvert f - p \rvert \le \varepsilon on s and f - p alternates on s at n + 2 points with level \varepsilon, then E_n(f; s) = \varepsilon, and p is a best approximation. On any set, for any f: the certificate direction of the equioscillation theorem. [Trefethen2019, Theorem 10.1]; [Rivlin1981, Ch. 1] (locators to check).

Headline (provisional)

Lean statement and details
NLAlib.AlternatesOn.minimaxError_eq {f : ℝ → ℝ} {s : Set ℝ} {n : ℕ} {p : Polynomial ℝ} {ε : ℝ}
  (h : AlternatesOn (fun x ↦ f x - Polynomial.eval x p) s (n + 2) ε) (hp : p.degree ≤ ↑n)
  (hε : Metric.IsUniformApproxOn (fun x ↦ Polynomial.eval x p) f s ε) : minimaxError f s n = ε

Full source on GitHub

Copy link

Other forms

Theorem (alternatesOn_minimaxPoly). The chosen best approximation equioscillates: for a < \mathbf{b} and f continuous on [a, \mathbf{b}], f - \mathrm{minimaxPoly}\ f\ [a, \mathbf{b}]\ n alternates on [a, \mathbf{b}] at n + 2 points with level E_n(f; [a, \mathbf{b}]). [Trefethen2019, Theorem 10.1].

Lean statement and details
NLAlib.alternatesOn_minimaxPoly {f : ℝ → ℝ} {a b : ℝ} (hab : a < b)
  (hf : ContinuousOn f (Set.Icc a b)) (n : ℕ) :
  AlternatesOn (fun x ↦ f x - Polynomial.eval x (minimaxPoly f (Set.Icc a b) n)) (Set.Icc a b)
    (n + 2) (minimaxError f (Set.Icc a b) n)

Full source on GitHub

Copy link

Theorem (alternatesOn_of_isUniformApproxOn_minimaxError). Chebyshev's equioscillation theorem, necessity. Let a < \mathbf{b}, f continuous on [a, \mathbf{b}], and p a real polynomial of degree at most n with \lvert f - p \rvert \le E_n(f; [a, \mathbf{b}]) on [a, \mathbf{b}] (a best approximation). Then f - p alternates on [a, \mathbf{b}] at n + 2 points with level E_n(f; [a, \mathbf{b}]): it equioscillates (AlternatesOn.exists_eq_of_abs_le). [Trefethen2019, Theorem 10.1]; [Rivlin1981, Ch. 1] (locators to check).

Lean statement and details
NLAlib.alternatesOn_of_isUniformApproxOn_minimaxError {f : ℝ → ℝ} {a b : ℝ} (hab : a < b)
  (hf : ContinuousOn f (Set.Icc a b)) {n : ℕ} {p : Polynomial ℝ} (hp : p.degree ≤ ↑n)
  (hbest :
    Metric.IsUniformApproxOn (fun x ↦ Polynomial.eval x p) f (Set.Icc a b)
      (minimaxError f (Set.Icc a b) n)) :
  AlternatesOn (fun x ↦ f x - Polynomial.eval x p) (Set.Icc a b) (n + 2)
    (minimaxError f (Set.Icc a b) n)

Full source on GitHub

Copy link

Theorem (isUniformApproxOn_minimaxError_iff_exists_alternatesOn). Chebyshev's equioscillation theorem. Let a < \mathbf{b}, f continuous on [a, \mathbf{b}] and p a real polynomial of degree at most n. Then p is a best approximation, \lvert f - p \rvert \le E_n(f; [a, \mathbf{b}]) on [a, \mathbf{b}], if and only if for some \varepsilon, \lvert f - p \rvert \le \varepsilon on [a, \mathbf{b}] and f - p alternates at n + 2 points of [a, \mathbf{b}] with level \varepsilon (and then \varepsilon = E_n(f; [a, \mathbf{b}])). [Trefethen2019, Theorem 10.1]; [Rivlin1981, Ch. 1] (locators to check).

Lean statement and details
NLAlib.isUniformApproxOn_minimaxError_iff_exists_alternatesOn {f : ℝ → ℝ} {a b : ℝ} (hab : a < b)
  (hf : ContinuousOn f (Set.Icc a b)) {n : ℕ} {p : Polynomial ℝ} (hp : p.degree ≤ ↑n) :
  Metric.IsUniformApproxOn (fun x ↦ Polynomial.eval x p) f (Set.Icc a b)
      (minimaxError f (Set.Icc a b) n) ↔
    ∃ ε,
      Metric.IsUniformApproxOn (fun x ↦ Polynomial.eval x p) f (Set.Icc a b) ε ∧
        AlternatesOn (fun x ↦ f x - Polynomial.eval x p) (Set.Icc a b) (n + 2) ε

Full source on GitHub

Copy link