Taylor Models - Core Definitions #
This file contains the core Taylor model abstraction, polynomial helpers, and basic operations with their correctness proofs.
Main definitions #
TaylorModel- A polynomial plus remainder intervalevalSet,evalPoly,polyBoundInterval,bound- Evaluation and boundingconst,identity,add,neg,mul,inv- Basic operationsevalPoly_mem_polyBoundInterval,taylorModel_correct- Core correctness
Design notes #
A Taylor model for f on interval I centered at c is: TM(f) = (P, R) where ∀x ∈ I, f(x) ∈ P(x-c) + R
Operations on Taylor models (add, mul, compose) preserve this property.
Polynomial helpers for Taylor models #
Truncate a polynomial to terms of degree ≤ n by summing coefficients
Equations
- LeanCert.Engine.truncPoly p n = ∑ i ∈ Finset.range (n + 1), Polynomial.C (p.coeff i) * Polynomial.X ^ i
Instances For
The tail of a polynomial (terms with degree > n)
Equations
- LeanCert.Engine.tailPoly p n = p - LeanCert.Engine.truncPoly p n
Instances For
Bound a polynomial over an interval centered at c. Evaluates at shifted argument: P(x - c) for x ∈ domain.
We bound each term: |aᵢ (x-c)ⁱ| ≤ |aᵢ| * r^i where r = radius of domain from c. Then the total bound is ∑ᵢ |aᵢ| * rⁱ
Equations
Instances For
The bound computed by boundPolyAbs is nonnegative
Bound the tail of polynomial p (terms with degree > d) when evaluated at (x-c) for x ∈ domain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Taylor Model structure #
A Taylor model: polynomial approximation with remainder interval.
- poly : Polynomial ℚ
The polynomial part (coefficients are rationals)
- remainder : Core.IntervalRat
The remainder interval
- center : ℚ
The center of expansion
- domain : Core.IntervalRat
The domain interval
Instances For
Evaluate polynomial part at a point
Instances For
Interval bound for the polynomial part over the domain.
Equations
- tm.polyBoundInterval = { lo := -LeanCert.Engine.boundPolyAbs tm.poly tm.domain tm.center, hi := LeanCert.Engine.boundPolyAbs tm.poly tm.domain tm.center, le := ⋯ }
Instances For
Get bounds on the Taylor model over its domain: polynomial bound + remainder
Equations
- tm.bound = tm.polyBoundInterval.add tm.remainder
Instances For
Interval bound for f(center).
Equations
- tm.valueAtCenterInterval = (LeanCert.Core.IntervalRat.singleton (tm.poly.coeff 0)).add tm.remainder
Instances For
Correctness: the true function value at center is in valueAtCenterInterval.
Taylor model operations #
Constant Taylor model
Equations
- LeanCert.Engine.TaylorModel.const q domain = { poly := Polynomial.C q, remainder := LeanCert.Core.IntervalRat.singleton 0, center := domain.midpoint, domain := domain }
Instances For
Identity Taylor model: represents the function x ↦ x
Equations
- One or more equations did not get rendered due to their size.
Instances For
Negate a Taylor model
Equations
Instances For
Subtract Taylor models
Instances For
Invert a Taylor model, assuming its bound does not contain 0.
Equations
Instances For
Multiply Taylor models with truncation and proper remainder handling.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Core Correctness Theorems #
Key lemma: polynomial evaluation is bounded by polyBoundInterval.
Local evalSet correctness lemmas #
Constant TM correctness for evalSet: q ∈ const(q).evalSet x.
Identity TM correctness for evalSet: x ∈ identity.evalSet x.
Polynomial helper lemmas for multiplication #
truncPoly + tailPoly = original polynomial
aeval distributes over truncPoly + tailPoly
Tail polynomial evaluation is bounded by boundPolyAbs of tail.
Polynomial bound lemma: |P(y)| ≤ boundPolyAbs P domain c for y = x - c, x ∈ domain
Generic Taylor model algebra lemmas #
These lemmas are pure TM algebra that don't depend on Expr or transcendentals.
If x ∈ bound and bound doesn't contain zero, then x ≠ 0.
FOIL expansion for Taylor model multiplication. (P₁ + r₁)(P₂ + r₂) = trunc(P₁P₂) + [tail(P₁P₂) + P₁r₂ + P₂r₁ + r₁r₂]
Four-term remainder membership: tail + p1r2 + p2r1 + r1r2 ∈ totalRemainder. This extracts the nested interval addition pattern from mul_evalSet_correct.
Multiplication preserves evalSet membership.
Given:
- f₁(x) ∈ tm1.evalSet x (i.e., f₁(x) = P₁(y) + r₁ with r₁ ∈ tm1.remainder)
- f₂(x) ∈ tm2.evalSet x (i.e., f₂(x) = P₂(y) + r₂ with r₂ ∈ tm2.remainder)
Then f₁(x) * f₂(x) ∈ (TaylorModel.mul tm1 tm2 degree).evalSet x.
The expansion is: (P₁ + r₁)(P₂ + r₂) = P₁P₂ + P₁r₂ + P₂r₁ + r₁r₂ = trunc(P₁P₂) + [tail(P₁P₂) + P₁r₂ + P₂r₁ + r₁r₂]
Inversion preserves evalSet membership (conservative construction).
Since TaylorModel.inv uses poly = 0 and remainder = invBound, we show
that if f(x) ∈ tm.evalSet x for all x in domain, then f(x)⁻¹ ∈ (inv tm hnz).evalSet x.