MindFormal v1.0.0One Mind

MindFormal.Tools.ScalarExit.TaylorBounds

theorem MindFormal.ScalarExit.exp_taylor_bound {x M : ℝ} {n : ℕ} (hx : |x| ≤ M) (hM : M / (↑n + 1) ≤ 1 / 2) :
|Real.exp x - ∑ k ∈ Finset.range n, x ^ k / ↑k.factorial| ≤ M ^ n / ↑n.factorial * 2

A rational Taylor remainder for arbitrary bounded real exponents.

theorem MindFormal.ScalarExit.quadratic_integral_bound (A B a b M : ℝ) (n : ℕ) (hab : a ≤ b) (hM : M / (↑n + 1) ≤ 1 / 2) (hexp : ∀ z ∈ Set.Icc a b, |A * z ^ 2 + B * z| ≤ M) (P : Polynomial ℝ) (hP : ∀ (z : ℝ), Polynomial.eval z (Polynomial.derivative P) = ∑ k ∈ Finset.range n, (A * z ^ 2 + B * z) ^ k / ↑k.factorial) :
|(∫ (z : ℝ) in a..b, Real.exp (A * z ^ 2 + B * z)) - (Polynomial.eval b P - Polynomial.eval a P)| ≤ (b - a) * (M ^ n / ↑n.factorial * 2)

Integrating the uniform Taylor remainder gives a certified enclosure. The polynomial identity is checked algebraically at each numeric use.