Documentation

Mathlib.RingTheory.Polynomial.Bernstein

Bernstein polynomials #

The definition of the Bernstein polynomials

bernsteinPolynomial (R : Type*) [CommRing R] (n ν : ℕ) : R[X] :=
(choose n ν) * X^ν * (1 - X)^(n - ν)

and the fact that for ν : Fin (n+1) these are linearly independent over ℚ.

We prove the basic identities

Notes #

See also Mathlib/Analysis/SpecialFunctions/Bernstein.lean, which defines the Bernstein approximations of a continuous function f : C([0,1], ℝ), and shows that these converge uniformly to f.

noncomputable def bernsteinPolynomial (R : Type u_1) [CommRing R] (n ν : ℕ) :

bernsteinPolynomial R n ν is (choose n ν) * X^ν * (1 - X)^(n - ν).

Although the coefficients are integers, it is convenient to work over an arbitrary commutative ring.

Equations
Instances For
    theorem bernsteinPolynomial.eq_zero_of_lt (R : Type u_1) [CommRing R] {n ν : ℕ} (h : n < ν) :
    @[simp]
    theorem bernsteinPolynomial.map {R : Type u_1} [CommRing R] {S : Type u_2} [CommRing S] (f : R →+* S) (n ν : ℕ) :
    theorem bernsteinPolynomial.flip (R : Type u_1) [CommRing R] (n ν : ℕ) (h : ν ≤ n) :
    theorem bernsteinPolynomial.flip' (R : Type u_1) [CommRing R] (n ν : ℕ) (h : ν ≤ n) :

    Rather than redoing the work of evaluating the derivatives at 1, we use the symmetry of the Bernstein polynomials.

    @[simp]
    theorem bernsteinPolynomial.iterate_derivative_at_1 (R : Type u_1) [CommRing R] (n ν : ℕ) (h : ν ≤ n) :
    Polynomial.eval 1 ((⇑Polynomial.derivative)^[n - ν] (bernsteinPolynomial R n ν)) = (-1) ^ (n - ν) * Polynomial.eval (↑ν + 1) (ascPochhammer R (n - ν))

    The Bernstein polynomials are linearly independent.

    We prove by induction that the collection of bernsteinPolynomial n ν for ν = 0, ..., k are linearly independent. The inductive step relies on the observation that the (n-k)-th derivative, evaluated at 1, annihilates bernsteinPolynomial n ν for ν < k, but has a nonzero value at ν = k.

    theorem bernsteinPolynomial.sum (R : Type u_1) [CommRing R] (n : ℕ) :
    ∑ ν ∈ Finset.range (n + 1), bernsteinPolynomial R n ν = 1
    theorem bernsteinPolynomial.sum_smul (R : Type u_1) [CommRing R] (n : ℕ) :
    ∑ ν ∈ Finset.range (n + 1), ν • bernsteinPolynomial R n ν = n • Polynomial.X
    theorem bernsteinPolynomial.sum_mul_smul (R : Type u_1) [CommRing R] (n : ℕ) :
    ∑ ν ∈ Finset.range (n + 1), (ν * (ν - 1)) • bernsteinPolynomial R n ν = (n * (n - 1)) • Polynomial.X ^ 2
    theorem bernsteinPolynomial.variance (R : Type u_1) [CommRing R] (n : ℕ) :
    ∑ ν ∈ Finset.range (n + 1), (n • Polynomial.X - ↑ν) ^ 2 * bernsteinPolynomial R n ν = n • Polynomial.X * (1 - Polynomial.X)

    A certain linear combination of the previous three identities, which we'll want later.