Documentation

LeanPool.ComputableReal.SpecialFunctions.Exp

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
      theorem ComputableℝSeq.Exp.List_foldr_eq_finset_sum (x : ) (n : ) :
      List.foldr (fun (n : ) (v : ) => 1 + x * v / (n + 1)) 1 (List.range n) = iFinset.range (n + 1), x ^ i / i.factorial
      theorem ComputableℝSeq.Exp.expLb₀_pos {x : } (n : ) (hx : 0 x) :
      0 < expLb₀ x n
      theorem ComputableℝSeq.Exp.expLb₀_ge_one {x : } (n : ) (hx : 0 x) :
      theorem ComputableℝSeq.Exp.expLb₀_le_exp {x : } (n : ) (hx : 0 x) :
      (expLb₀ x n) Real.exp x
      theorem ComputableℝSeq.Exp.expUb₀_ge_exp (x : ) (n : ) (hx : 0 x) :
      Real.exp x (expUb₀ x n)
      theorem Real.one_plus_pow_lt_exp_mul {x y : } (hx : 0 < x) (hy : 0 < y) :
      (1 + x) ^ y < exp (x * y)
      theorem ComputableℝSeq.Exp.expUb₀_sub_expLb₀ {x : } (n : ) (hx : 0 x) :
      (expUb₀ x n) - (expLb₀ x n) Real.exp x * (Real.exp (2 * x / n.factorial) - 1)

      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
      Instances For

        Unlike expUb₀, which only works for 0 ≤ x, this is valid for all x.

        Equations
        Instances For
          theorem ComputableℝSeq.Exp.expUb_sub_expLb_of_nonneg {x : } (n : ) (hx : 0 x) :
          (expUb x n) - (expLb x n) Real.exp x * (Real.exp (2 * x / n.factorial) - 1)
          theorem ComputableℝSeq.Exp.expUb_sub_expLb_of_neg {x : } (n : ) (hx : x < 0) :
          (expUb x n) - (expLb x n) Real.exp (2 * ↑(-x) / n.factorial) - 1
          theorem ComputableℝSeq.Exp.expUb_lb_err (x : ) (n : ) :
          Real.exp x (expLb x n) + Real.exp |x| * (Real.exp (2 * |x| / n.factorial) - 1) (expUb x n) - Real.exp |x| * (Real.exp (2 * |x| / n.factorial) - 1) Real.exp x

          Definition of exp.

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