Documentation

LeanCert.Engine.Algebra.QPolyBernstein

Computable Bernstein certificates for rational polynomials #

Engine/TaylorModel/Core.lean proves that a polynomial on a closed interval lies between the minimum and maximum of its Bernstein coefficients, but states the result over Mathlib's noncomputable Polynomial ℚ. This file evaluates the same enclosure on the executable QPoly representation so it can serve as a Boolean certificate:

Bisection recomputes the coefficients on each child from p (exact, O(n²) per box) so the soundness proof reduces to the one-box enclosure every time. Unlike Horner interval evaluation, the Bernstein enclosure is exact at the endpoints and converges quadratically under bisection, so polynomial bounds that are tight near an endpoint need no subdivision at all.

Affine reparametrisation #

The affine map t ↦ I.lo + (I.hi - I.lo) · t sending [0,1] onto I.

Equations
Instances For

    Coefficients of t ↦ p(I.lo + (I.hi - I.lo) t), padded to be nonempty.

    Equations
    Instances For
      theorem LeanCert.Engine.QPoly.aeval_shiftedCoeffs (p : QPoly) (I : Core.IntervalRat) (t : ℝ) :
      (Polynomial.aeval (↑I.lo + (↑I.hi - ↑I.lo) * t)) p.toPoly = ∑ j ∈ Finset.range (p.shiftedCoeffs I).length, ↑((p.shiftedCoeffs I).getD j 0) * t ^ j

      Bernstein coefficients and enclosure #

      Exact Bernstein coefficients of p on I (degree p.coeffs.size - 1).

      Equations
      Instances For

        [min bₖ, max bₖ] over the Bernstein coefficients of p on I.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Bernstein enclosure. Every value of p on I lies in bernsteinEnclosure p I.

          Recursive certificates #

          The four comparisons certified against an enclosure.

          Instances For
            @[instance_reducible]
            Equations
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Semantic comparison c ?? y for each Cmp.

              Equations
              Instances For

                Does the enclosure J prove c ?? y for every y ∈ J?

                Equations
                Instances For
                  theorem LeanCert.Engine.QPoly.Cmp.holds_of_check {cmp : Cmp} {J : Core.IntervalRat} {c : ℚ} (h : cmp.check J c = true) {y : ℝ} (hy : y ∈ J) :
                  cmp.holds (↑c) y

                  Recursive Bernstein certificate: prove cmp from the enclosure on I, or bisect and certify both halves, up to depth levels.

                  Equations
                  Instances For
                    def LeanCert.Engine.QPoly.bernsteinDepth? (cmp : Cmp) (p : QPoly) (c : ℚ) (I : Core.IntervalRat) (maxDepth : ℕ) :

                    Least depth at which bernsteinCheck succeeds, if any up to maxDepth. Untrusted search helper used for reporting; certificates re-run the checker.

                    Equations
                    Instances For

                      Number of boxes examined by bernsteinCheck (reporting only).

                      Equations
                      Instances For
                        theorem LeanCert.Engine.QPoly.bernsteinCheck_sound {cmp : Cmp} {p : QPoly} {c : ℚ} {I : Core.IntervalRat} {depth : ℕ} (h : bernsteinCheck cmp p c I depth = true) (x : ℝ) :
                        x ∈ I → cmp.holds (↑c) ((Polynomial.aeval x) p.toPoly)

                        Soundness of the recursive Bernstein certificate.

                        theorem LeanCert.Engine.QPoly.le_aeval_of_bernsteinCheck {p : QPoly} {c : ℚ} {I : Core.IntervalRat} {depth : ℕ} (h : bernsteinCheck Cmp.lower p c I depth = true) (x : ℝ) :
                        x ∈ I → ↑c ≤ (Polynomial.aeval x) p.toPoly

                        Lower bounds from a Bernstein certificate.