Documentation

LeanCert.Engine.TaylorModel.Hyperbolic

Taylor Models - Hyperbolic Functions #

This file contains Taylor polynomial definitions and remainder bounds for hyperbolic functions (sinh, cosh, tanh, atan, atanh, asinh), along with function-level Taylor models and their correctness proofs.

Main definitions #

sinh Taylor polynomial #

Taylor polynomial coefficients for sinh at center c = 0: sinh(x) = x + x³/3! + x⁵/5! + ...

Equations
Instances For

    Remainder bound for sinh: |sinh(x) - T_n(x)| ≤ cosh(r) * |x|^{n+1} / (n+1)! where r = max(|lo|, |hi|). We use cosh(r) ≤ exp(r) ≤ 3^(⌈r⌉+1).

    Equations
    Instances For

      Remainder bound for sinh is nonnegative

      cosh Taylor polynomial #

      Taylor polynomial coefficients for cosh at center c = 0: cosh(x) = 1 + x²/2! + x⁴/4! + ...

      Equations
      Instances For

        Remainder bound for cosh: |cosh(x) - T_n(x)| ≤ cosh(r) * |x|^{n+1} / (n+1)! where r = max(|lo|, |hi|). We use cosh(r) ≤ exp(r) ≤ 3^(⌈r⌉+1).

        Equations
        Instances For

          Remainder bound for cosh is nonnegative

          atan Taylor polynomial #

          atan(x) = x - x³/3 + x⁵/5 - x⁷/7 + ... = ∑_{k=0}^∞ (-1)^k x^{2k+1} / (2k+1)

          Converges for |x| ≤ 1 (inclusive at endpoints by Abel's theorem).

          Taylor polynomial coefficients for atan at center 0

          Equations
          Instances For

            Remainder bound for atan

            Equations
            Instances For

              Remainder bound for atan is nonnegative

              atanh Taylor polynomial #

              atanh(x) = x + x³/3 + x⁵/5 + ... = ∑_{k=0}^∞ x^{2k+1} / (2k+1)

              Converges for |x| < 1.

              Taylor polynomial coefficients for atanh at center 0

              Equations
              Instances For

                Remainder bound for atanh

                Equations
                Instances For

                  Remainder bound for atanh is nonnegative

                  asinh Taylor polynomial #

                  Taylor polynomial coefficients for asinh at center 0

                  Equations
                  Instances For

                    Supremum of the n-th derivative of arsinh over the interval hull of domain and 0.

                    Equations
                    Instances For

                      Remainder bound for asinh

                      Equations
                      Instances For

                        Remainder bound for asinh is nonnegative

                        Function-level Taylor models #

                        Taylor model for sinh z on domain J, centered at 0, degree n.

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

                          Taylor model for cosh z on domain J, centered at 0, degree n.

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

                            Function-level Taylor model for tanh at center 0. Uses tanh = sinh / cosh with the fact that cosh(x) ≥ 1 > 0 for all x.

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

                              Taylor model for atan z on domain J, centered at 0, degree n. Valid for |z| ≤ 1.

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

                                Taylor model for atanh z on domain J, centered at 0, degree n. Valid for |z| < 1.

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

                                  Taylor model for asinh z on domain J, centered at 0, degree n.

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

                                    Helper lemmas #

                                    Helper lemmas for iterated derivatives #

                                    iteratedDeriv for sinh and cosh at 0, proved together. sinh: even n → 0, odd n → 1 cosh: even n → 1, odd n → 0

                                    arsinh series helpers #

                                    The sinhTaylorCoeffs match the Mathlib Taylor coefficients for sinh at 0

                                    The coshTaylorCoeffs match the Mathlib Taylor coefficients for cosh at 0

                                    Polynomial evaluation lemmas #

                                    sinhTaylorPoly evaluates to the standard Taylor sum for sinh at 0.

                                    coshTaylorPoly evaluates to the standard Taylor sum for cosh at 0.

                                    atanh correctness helper #

                                    theorem LeanCert.Engine.TaylorModel.Real.atanh_hasSum {x : } (hx : |x| < 1) :
                                    HasSum (fun (k : ) => x ^ (2 * k + 1) / (2 * k + 1)) (Core.Real.atanh x)

                                    The atanh series representation: atanh(x) = Σ x^(2k+1)/(2k+1) for |x| < 1. Derived from Mathlib's hasSum_log_sub_log_of_abs_lt_one.

                                    atanhTaylorPoly evaluates to the standard sum.

                                    theorem LeanCert.Engine.TaylorModel.atanh_series_remainder_bound {z : } (hz : |z| < 1) (n : ) :
                                    |Core.Real.atanh z - kFinset.range (n + 1), (atanhTaylorCoeffs n k) * z ^ k| |z| ^ (n + 1) / (1 - z ^ 2)

                                    Remainder bound for the atanh series: for |z| < 1, the tail after degree n is bounded. Uses the geometric series bound on the tail.

                                    Proof sketch:

                                    1. atanh(z) = Σ_{k=0}^∞ z^(2k+1)/(2k+1) by Real.atanh_hasSum
                                    2. The polynomial computes partial sum of odd terms up to degree n
                                    3. Remainder = tail = Σ_{k: 2k+1 > n} z^(2k+1)/(2k+1)
                                    4. |tail| ≤ Σ_{k: 2k+1 > n} |z|^(2k+1) ≤ |z|^(n+1)/(1-z²) by geometric series

                                    Correctness theorems #

                                    theorem LeanCert.Engine.TaylorModel.tmAtanh_correct (J : Core.IntervalRat) (n : ) (hJ_radius : max |J.lo| |J.hi| 99 / 100) (z : ) :
                                    z J|z| < 1Core.Real.atanh z (tmAtanh J n).evalSet z

                                    atanh z ∈ (tmAtanh J n).evalSet z for all z in J with |z| < 1. Precondition: The domain radius must be ≤ 99/100.

                                    sinh z ∈ (tmSinh J n).evalSet z for all z in J. Uses taylor_remainder_bound with f = Real.sinh.

                                    cosh z ∈ (tmCosh J n).evalSet z for all z in J.

                                    asinh correctness infrastructure #

                                    The n-th derivative of arsinh at 0 follows the pattern:

                                    • For even n: 0
                                    • For odd n = 2k+1: (2k)! * Ring.choose (-1/2) k

                                    This matches the coefficients in asinhTaylorCoeffs times n!.

                                    Note: This is proved using the known series expansion of arsinh, which satisfies arsinh(x) = Σ_{k=0}^∞ a_k x^(2k+1) where a_k = Ring.choose (-1/2) k / (2k+1).

                                    The asinhTaylorCoeffs match the Mathlib Taylor coefficients for arsinh at 0

                                    asinhTaylorPoly evaluates to the standard Taylor sum for arsinh at 0.

                                    theorem LeanCert.Engine.TaylorModel.arsinh_deriv_bound (domain : Core.IntervalRat) (n : ) (x : ) :
                                    x Set.Icc (min (↑domain.lo) 0) (max (↑domain.hi) 0)iteratedDeriv n Real.arsinh x asinhDerivSup domain n

                                    Bound on the n-th derivative of arsinh on the interval hull of domain and 0.

                                    arsinh z ∈ (tmAsinh J n).evalSet z for all z in J. Uses taylor_remainder_bound with f = Real.arsinh, M = asinhDerivSup J (n+1).