Verified rational bounds for the exponential #
Rational lower and upper bounds for Real.exp are built from truncated Taylor series
(expLb/expUb), shown to converge, and packaged into a ComputableℝSeq.exp. This yields
IsComputable instances for Real.exp, Real.sinh, Real.cosh, and Real.tanh. The bound
functions are executable; the packaged sequence mentions Real.exp itself as its reference
value, so exp and the instances are noncomputable Lean terms.
A valid lower bound when 0 ≤ x. Forms a CauSeq that converges to Real.exp x from below.
Functions by dividing n by a constant k so that it's in the range [0,1], taking n terms
of the Taylor expansion (which is an under-approximation), and then raising it to k again.
Equations
Instances For
A valid upper bound when 0 ≤ x. CauSeq that converges to Real.exp x from above.
Equations
Instances For
This proves that the gap between expLb₀ and expUb₀ shrinks at least as
fast as exp x * (exp (2x/n!) - 1). This is then used to prove that they are
cauchy sequences in n, i.e. taking sufficiently large n makes this go to zero.
Unlike expLb₀, which only works for 0 ≤ x, this is valid for all x.
Equations
- ComputableℝSeq.Exp.expLb x = if 0 ≤ x then ComputableℝSeq.Exp.expLb₀ x else fun (n : ℕ) => (ComputableℝSeq.Exp.expUb₀ (-x) n)⁻¹
Instances For
Unlike expUb₀, which only works for 0 ≤ x, this is valid for all x.
Equations
- ComputableℝSeq.Exp.expUb x = if 0 ≤ x then ComputableℝSeq.Exp.expUb₀ x else fun (n : ℕ) => (ComputableℝSeq.Exp.expLb₀ (-x) n)⁻¹
Instances For
Definition of exp.
Equations
- One or more equations did not get rendered due to their size.