Documentation

LeanCert.Engine.AD.Computable

Automatic Differentiation - Computable Evaluators #

This file provides computable dual evaluators using Taylor-based approximations for transcendental functions. This enables native_decide for derivative-based bound checking.

Main definitions #

Main theorems #

Computable Dual Evaluation for ExprSupportedCore #

This section provides a fully computable dual evaluator that uses Taylor-based approximations for transcendental functions. This enables native_decide for derivative-based bound checking.

Computable dual for exp using Taylor series (chain rule: d(exp f) = exp(f) * f')

Equations
Instances For

    Computable dual for sin using Taylor series

    Equations
    Instances For

      Computable dual for cos using Taylor series

      Equations
      Instances For

        Computable dual for log using Taylor series via atanh reduction. Chain rule: d(log f) = f' / f

        Equations
        Instances For

          Computable dual for sinh using Taylor series (chain rule: d(sinh f) = cosh(f) * f')

          Equations
          Instances For

            Computable dual for cosh using Taylor series (chain rule: d(cosh f) = sinh(f) * f')

            Equations
            Instances For

              Computable dual for tanh (chain rule: d(tanh f) = sech²(f) * f') Since sech²(x) ∈ (0, 1], we use [0, 1] as a conservative bound.

              Equations
              Instances For

                Computable dual interval evaluator for ExprSupportedCore expressions.

                This uses Taylor series approximations for transcendental functions, making it fully computable and usable with native_decide.

                For expressions outside ExprSupportedCore (inv, log, atanh), use evalDual? for domain-checked evaluation; correctness is not covered here.

                Equations
                Instances For

                  Computable single-variable derivative interval

                  Equations
                  Instances For

                    Domain validity for dual evaluation. This is defined directly in terms of evalDualCore to ensure compatibility. For log, we require the argument interval to have positive lower bound.

                    Equations
                    Instances For
                      theorem LeanCert.Engine.evalDualCore_val_correct (e : Core.Expr) (hsupp : ExprSupportedCore e) (ρ_real : ) (ρ_dual : DualEnv) (cfg : EvalConfig) ( : ∀ (i : ), ρ_real i (ρ_dual i).val) (hdom : evalDomainValidDual e ρ_dual cfg) :
                      Core.Expr.eval ρ_real e (evalDualCore e ρ_dual cfg).val

                      Correctness theorem for computable dual value component.

                      Note: Requires domain validity for log (positive argument interval).

                      For ExprSupported expressions (which exclude log), domain validity is trivially true. This is because ExprSupported has no log constructor.

                      theorem LeanCert.Engine.evalDualCore_der_correct (e : Core.Expr) (hsupp : ExprSupported e) (I : Core.IntervalRat) (x : ) (hx : x I) (cfg : EvalConfig) :

                      Correctness theorem for computable dual derivative component. Uses ExprSupported since derivative correctness requires differentiability.

                      Convenience theorem: derivIntervalCore correctness

                      If derivIntervalCore doesn't contain zero, the derivative is nonzero everywhere on I. This is a key theorem for Newton contraction analysis.

                      If derivIntervalCore.lo > 0, then the derivative is positive everywhere on I.

                      If derivIntervalCore.hi < 0, then the derivative is negative everywhere on I.

                      Strictly positive derivative (via Core bounds) implies strict monotonicity

                      Strictly negative derivative (via Core bounds) implies strict antitonicity