NLA-lib Explorer

NLAlib.isLeast_sum_mul_sq_sub_eval

Library · theorem

Weighted least squares on q + 1 nodes: for distinct real nodes \mathbf{v}_i, i \in s, \lvert s \rvert = q + 1, weights u_i > 0 and values r_i, \min_{\deg p < q}\ \sum_{i \in s} u_i\,\bigl(r_i - p(\mathbf{v}_i)\bigr)^2 = \frac{r[s]^2}{\sum_{i \in s} w_i^2/u_i} \,, w_i the nodal weights; the minimum is attained at the interpolant of r - t\,w/u, t = r[s]/\sum_{i \in s} w_i^2/u_i. [ChenPersson2026, Lemma 9].

NLAlib.isLeast_sum_mul_sq_sub_eval.{u_2} {ι : Type u_2} [DecidableEq ι] {s : Finset ι} {v : ι → ℝ}
  (hvs : Set.InjOn v ↑s) {q : ℕ} (hs : s.card = q + 1) {u : ι → ℝ} (hu : ∀ i ∈ s, 0 < u i)
  (r : ι → ℝ) :
  IsLeast ((fun p ↦ ∑ i ∈ s, u i * (r i - Polynomial.eval (v i) p) ^ 2) '' {p | p.degree < ↑q})
    (dividedDifference s v r ^ 2 / ∑ i ∈ s, Lagrange.nodalWeight s v i ^ 2 / u i)

Full source on GitHub

Import NLAlib.Polynomial.Interpolation.DividedDifference.