Documentation

LeanPool.MovingSofa.Development.IntervalArithmetic.Foundations.Development002

Moving sofa: related mathematical developments #

Automatic Differentiation - Partial Correctness Theorems #

This file proves the correctness of the partial dual evaluator evalDualOption which handles expressions with inv, log, and other domain-restricted functions.

Main theorems #

Design notes #

All theorems are FULLY PROVED with no sorry or axioms. The key insight is that when evalDualOption returns some, the domain constraints (nonzero for inv, positive for log) are satisfied.

Correctness of partial dual evaluator #

theorem LeanCert.Engine.evalDualOption_val_correct (e : Core.Expr) (ρ_real : ℕ → ℝ) (ρ_dual : DualEnv) (D : DualInterval) (hsome : evalDualOption e ρ_dual = some D) (hρ : ∀ (i : ℕ), ρ_real i ∈ (ρ_dual i).val) :
Core.Expr.eval ρ_real e ∈ D.val

The value component of evalDualOption is correct when it returns some. This theorem extends to expressions with inv.

theorem LeanCert.Engine.evalDualOption1_val_correct (e : Core.Expr) (I : Core.IntervalRat) (D : DualInterval) (x : ℝ) (hx : x ∈ I) (hsome : evalDualOption1 e I = some D) :
Core.Expr.eval (fun (x_1 : ℕ) => x) e ∈ D.val

Single-variable version of evalDualOption_val_correct

Helper lemma: evalFunc1 for inv unfolds correctly

Expressions with inv are differentiable when the denominator is nonzero.

theorem LeanCert.Engine.evalDualOption1_correct (e : Core.Expr) (I : Core.IntervalRat) (D : DualInterval) (x : ℝ) (hx : x ∈ I) (hsome : evalDualOption1 e I = some D) :
Core.Expr.eval (fun (x_1 : ℕ) => x) e ∈ D.val ∧ deriv (evalFunc1 e) x ∈ D.der

Combined correctness theorem for evalDualOption1

High-Performance Dyadic Interval Evaluator #

This evaluator replaces Rat with Dyadic to prevent denominator explosion. It is designed for complex expressions where the standard evaluator becomes slow.

Main definitions #

Performance #

In v1.0, every Rat multiplication required GCD normalization. For deep expressions (e.g., Taylor series with 20+ terms, or optimization with 100+ iterations), denominators grow exponentially, causing timeouts.

In v1.1, Dyadic arithmetic uses bit-shifts instead of GCD. With roundOut, we can enforce a maximum precision after each operation, keeping computation bounded regardless of expression depth.

Example #

Consider computing sin(sin(sin(x))) with 15-term Taylor series:

Design notes #

For transcendental functions (sin, cos, exp), we delegate to the existing IntervalRat implementation with Taylor series, then convert the result to IntervalDyadic with outward rounding. This reuses verified code while gaining the performance benefits of Dyadic for polynomial operations.

Configuration #

Configuration for Dyadic interval evaluation.

  • precision - Minimum exponent for outward rounding. A value of -53 gives IEEE double-like precision (~15 decimal digits). Use -100 for higher precision.
  • taylorDepth - Number of Taylor terms for transcendental functions.
  • precision : ℤ

    Minimum exponent (higher = coarser). -53 ≈ IEEE double precision.

  • taylorDepth : ℕ

    Number of Taylor series terms for transcendental functions

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

        Default configuration with IEEE double-like precision

        Equations

        High-precision configuration for critical calculations

        Equations
        Instances For

          Fast configuration for rapid evaluation (lower precision)

          Equations
          Instances For

            Variable Environment #

            @[reducible, inline]

            Variable assignment as Dyadic intervals

            Equations
            Instances For

              Convert a rational interval environment to Dyadic

              Equations
              Instances For

                Transcendental Function Wrappers #

                sqrt interval: uses conservative bound [0, max(hi, 1)]

                Equations
                Instances For

                  log interval: conservative global bound. For any x > 0, log(x) ∈ (-∞, ∞), but we use a finite interval. For x ∈ [lo, hi] with lo > 0:

                  • log is monotone, so log(x) ∈ [log(lo), log(hi)]
                  • Legacy total-evaluator fallback; strict callers reject this domain
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Real power from a cached logarithm interval.

                    If Real.log x ∈ logBase, this computes an interval for x ^ (p : ℝ) as exp(p * log x) without recomputing log x. This is the hot-path primitive for cached finite sums with many terms of the form x ^ q_k.

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

                      Real power x^p for x > 0 and rational p, computed via exp(p * log(x)).

                      For x ∈ [lo, hi] with lo > 0 and rational exponent p:

                      • x^p = exp(p * log(x))
                      • We compute log(x), multiply by p, then apply exp

                      This is the key operation for BKLNW-style sums where terms are x^(1/k - 1/3).

                      Equations
                      Instances For
                        theorem LeanCert.Engine.mem_rpowFromCachedLogDyadic {x : ℝ} {logBase : Core.IntervalDyadic} (hlog : Real.log x ∈ logBase) (hx_pos : 0 < x) (p : ℚ) (cfg : DyadicConfig) (hprec : cfg.precision ≤ 0 := by norm_num) :
                        x ^ ↑p ∈ rpowFromCachedLogDyadic logBase p cfg

                        Correctness of rpowFromCachedLogDyadic: a cached interval containing Real.log x is enough to enclose x ^ p.

                        theorem LeanCert.Engine.mem_rpowIntervalDyadic {x : ℝ} {base : Core.IntervalDyadic} (hx : x ∈ base) (hpos : base.toIntervalRat.lo > 0) (p : ℚ) (cfg : DyadicConfig) (hprec : cfg.precision ≤ 0 := by norm_num) :
                        x ^ ↑p ∈ rpowIntervalDyadic base p cfg

                        Correctness of rpowIntervalDyadic: if x ∈ base and base.lo > 0, then x^p ∈ result

                        Main Evaluator #

                        High-performance Dyadic interval evaluator.

                        This is the core function for v1.1. It evaluates expressions using Dyadic arithmetic for polynomial operations (add, mul, neg) and delegates to rational Taylor series for transcendentals.

                        Returns an interval guaranteed to contain all possible values of the expression when ExprSupportedCore holds. For other expressions, it computes conservative fallbacks (e.g., inv/log), but the core correctness theorem does not apply.

                        Equations
                        Instances For

                          Correctness #

                          def LeanCert.Engine.envMemDyadic (ρ_real : ℕ → ℝ) (ρ_dyad : IntervalDyadicEnv) :

                          A real environment is contained in a Dyadic interval environment

                          Equations
                          Instances For

                            Domain validity for Dyadic evaluation. This is defined directly in terms of LeanCert.Internal.Dyadic.evalUnchecked to ensure compatibility. For log, we require the argument interval (converted to Rat) to have positive lower bound.

                            Equations
                            Instances For

                              Computable (Bool) domain validity check for Dyadic evaluation.

                              Equations
                              Instances For

                                Static data prepared once for repeated Dyadic evaluation.

                                The context is operation-independent: logarithm, exponential, trigonometric, and inverse-hyperbolic kernels share certified constants and coefficient families without changing the public evaluator configuration.

                                • Precision and rounding settings shared by prepared interval computations.

                                • A precomputed rational enclosure of the natural logarithm of two.

                                • expCoeffs : List ℚ

                                  Precomputed rational coefficients for the exponential Taylor polynomial.

                                • sinCoeffs : List ℚ

                                  Precomputed rational coefficients for the sine Taylor polynomial.

                                • cosCoeffs : List ℚ

                                  Precomputed rational coefficients for the cosine Taylor polynomial.

                                • atanhCoeffs : List ℚ

                                  Precomputed rational coefficients for the inverse hyperbolic tangent expansion.

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

                                    Deterministically prepare all configuration-dependent numerical data.

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

                                      Logarithm kernel using the context's prepared certified constants.

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

                                        Inverse-hyperbolic-tangent kernel using prepared Taylor coefficients.

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

                                          Evaluate an expression and its domain-validity bit in one traversal. The value component is exactly LeanCert.Internal.Dyadic.evalUnchecked; the validity component is exactly checkDomainValidDyadic.

                                          Equations
                                          Instances For
                                            @[irreducible]

                                            Diagnose the first failed Dyadic domain check.

                                            Equations
                                            Instances For

                                              Checked Dyadic evaluator. The finite fallback branches of the legacy total evaluator are never exposed after a failed domain check.

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

                                                Domain validity is trivially true for ADSupported expressions (which exclude log).

                                                theorem LeanCert.Engine.evalIntervalDyadic_correct (e : Core.Expr) (hsupp : ExprSupportedCore e) (ρ_real : ℕ → ℝ) (ρ_dyad : IntervalDyadicEnv) (hρ : envMemDyadic ρ_real ρ_dyad) (cfg : DyadicConfig := { }) (hprec : cfg.precision ≤ 0 := by norm_num) (hdom : evalDomainValidDyadic e ρ_dyad cfg) :

                                                Fundamental correctness theorem for Dyadic evaluation.

                                                This theorem states that for any supported expression and any real values within the input intervals, the result of evaluating the expression is contained in the computed Dyadic interval.

                                                The proof follows the same structure as evalIntervalCore_correct, but with additional steps for handling Dyadic ↔ Rat conversions and rounding. Requires cfg.precision ≤ 0 (the default -53 satisfies this).

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

                                                theorem LeanCert.Engine.evalIntervalDyadic_correct_of_domain (e : Core.Expr) (ρ_real : ℕ → ℝ) (ρ_dyad : IntervalDyadicEnv) (hρ : envMemDyadic ρ_real ρ_dyad) (cfg : DyadicConfig := { }) (hprec : cfg.precision ≤ 0 := by norm_num) (hdom : evalDomainValidDyadic e ρ_dyad cfg) :

                                                Correctness of Dyadic evaluation for every expression whose recursively checked domain conditions hold.

                                                theorem LeanCert.Engine.evalIntervalDyadicChecked_correct (e : Core.Expr) (ρ_real : ℕ → ℝ) (ρ_dyad : IntervalDyadicEnv) (hρ : envMemDyadic ρ_real ρ_dyad) (cfg : DyadicConfig := { }) (hprec : cfg.precision ≤ 0 := by norm_num) (result : Core.IntervalDyadic) (hsuccess : evalIntervalDyadicChecked e ρ_dyad cfg = Except.ok result) :
                                                Core.Expr.eval ρ_real e ∈ result

                                                Successful checked Dyadic evaluation encloses the true value for every expression, provided outward-rounding precision is nonpositive.

                                                Verification Checkers #

                                                Check if expression is bounded above by q

                                                Equations
                                                Instances For

                                                  Check if expression is bounded below by q

                                                  Equations
                                                  Instances For

                                                    Check if expression is bounded in interval [lo, hi]

                                                    Equations
                                                    Instances For

                                                      Domain-aware automatic differentiation with Dyadic intervals #

                                                      This module is the bounded-denominator counterpart of AD.DomainChecked. Polynomial dual arithmetic is performed with Dyadic endpoints and outward rounding after every addition and multiplication. Transcendental values use the same verified rational Taylor kernels as the Dyadic value evaluator and are rounded back to Dyadic endpoints.

                                                      The public entry points are checked: unsupported syntax, invalid reciprocal or logarithm domains, and positive rounding precisions return EvalError rather than a finite interval.

                                                      A value interval and one directional derivative interval, both Dyadic.

                                                      Instances For
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          @[reducible, inline]

                                                          An environment of Dyadic dual intervals.

                                                          Equations
                                                          Instances For

                                                            Enclose a rational constant in a dyadic interval with zero derivative.

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

                                                              An input interval held constant, with singleton zero derivative.

                                                              Equations
                                                              Instances For

                                                                Addition with dyadic interval propagation of values and derivatives.

                                                                Equations
                                                                Instances For

                                                                  Multiplication with dyadic interval propagation of values and derivatives.

                                                                  Equations
                                                                  Instances For

                                                                    Negation with dyadic interval propagation of values and derivatives.

                                                                    Equations
                                                                    Instances For

                                                                      Reciprocal with dyadic interval propagation of values and derivatives.

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

                                                                        Exponential with dyadic interval propagation of values and derivatives.

                                                                        Equations
                                                                        Instances For

                                                                          Sine with dyadic interval propagation of values and derivatives.

                                                                          Equations
                                                                          Instances For

                                                                            Cosine with dyadic interval propagation of values and derivatives.

                                                                            Equations
                                                                            Instances For

                                                                              Natural logarithm with dyadic interval propagation of values and derivatives.

                                                                              Equations
                                                                              Instances For

                                                                                Total computational kernel. Sound public use goes through the checked entry points below.

                                                                                Equations
                                                                                Instances For

                                                                                  Value projection of a Dyadic dual environment.

                                                                                  Equations
                                                                                  Instances For

                                                                                    Box-dependent domain check for the Dyadic AD kernel.

                                                                                    Equations
                                                                                    Instances For

                                                                                      Explain the first failed support or domain check.

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

                                                                                        Checked Dyadic dual evaluation.

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

                                                                                          Checked value-and-derivative evaluation along coordinate idx.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Checked Dyadic derivative enclosure along coordinate idx.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Checked Dyadic derivative enclosure for a single-variable expression.

                                                                                              Equations
                                                                                              Instances For

                                                                                                Convenience boundary for callers whose boxes use rational endpoints.

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

                                                                                                  The value projection of the dual kernel is exactly the ordinary Dyadic value kernel.

                                                                                                  theorem LeanCert.Engine.evalDualDyadicChecked_val_correct (e : Core.Expr) (rhoReal : ℕ → ℝ) (rho : DualDyadicEnv) (cfg : DyadicConfig) (D : DualIntervalDyadic) (hrho : ∀ (i : ℕ), rhoReal i ∈ (rho i).val) (hok : evalDualDyadicChecked e rho cfg = Except.ok D) :
                                                                                                  Core.Expr.eval rhoReal e ∈ D.val

                                                                                                  Golden theorem for successful checked Dyadic dual evaluation.

                                                                                                  theorem LeanCert.Engine.evalWithDerivDyadicChecked_differentiableAt (e : Core.Expr) (rhoReal : ℕ → ℝ) (rho : IntervalDyadicEnv) (idx : ℕ) (cfg : DyadicConfig) (D : DualIntervalDyadic) (x : ℝ) (hx : x ∈ rho idx) (hrho : ∀ (i : ℕ), rhoReal i ∈ rho i) (hok : evalWithDerivDyadicChecked e rho idx cfg = Except.ok D) :
                                                                                                  DifferentiableAt ℝ (e.evalAlong rhoReal idx) x

                                                                                                  Successful checked Dyadic indexed AD proves differentiability throughout the selected input interval.

                                                                                                  theorem LeanCert.Engine.evalWithDerivDyadicChecked_der_correct (e : Core.Expr) (rhoReal : ℕ → ℝ) (rho : IntervalDyadicEnv) (idx : ℕ) (cfg : DyadicConfig) (D : DualIntervalDyadic) (x : ℝ) (hx : x ∈ rho idx) (hrho : ∀ (i : ℕ), rhoReal i ∈ rho i) (hok : evalWithDerivDyadicChecked e rho idx cfg = Except.ok D) :
                                                                                                  deriv (e.evalAlong rhoReal idx) x ∈ D.der

                                                                                                  Golden theorem: successful checked Dyadic indexed AD encloses the true partial derivative.

                                                                                                  theorem LeanCert.Engine.derivIntervalDyadicChecked_correct (e : Core.Expr) (rhoReal : ℕ → ℝ) (rho : IntervalDyadicEnv) (idx : ℕ) (cfg : DyadicConfig) (dI : Core.IntervalDyadic) (x : ℝ) (hx : x ∈ rho idx) (hrho : ∀ (i : ℕ), rhoReal i ∈ rho i) (hok : derivIntervalDyadicChecked e rho idx cfg = Except.ok dI) :
                                                                                                  deriv (e.evalAlong rhoReal idx) x ∈ dI

                                                                                                  Golden theorem for the derivative-only Dyadic API.

                                                                                                  theorem LeanCert.Engine.derivIntervalDyadicCheckedOfRat_correct (e : Core.Expr) (rhoReal : ℕ → ℝ) (rho : IntervalEnv) (idx : ℕ) (cfg : DyadicConfig) (dI : Core.IntervalDyadic) (x : ℝ) (hx : x ∈ rho idx) (hrho : ∀ (i : ℕ), rhoReal i ∈ rho i) (hok : derivIntervalDyadicCheckedOfRat e rho idx cfg = Except.ok dI) :
                                                                                                  deriv (e.evalAlong rhoReal idx) x ∈ dI

                                                                                                  Golden theorem for rational input boxes converted to the Dyadic backend.

                                                                                                  Compute the first n partial derivatives with the checked Dyadic backend.

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

                                                                                                    Rational-input convenience boundary for the first n Dyadic partials.

                                                                                                    Equations
                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                    Instances For
                                                                                                      theorem LeanCert.Engine.gradientIntervalDyadicChecked_correct (e : Core.Expr) (rhoReal : ℕ → ℝ) (rho : IntervalDyadicEnv) (n : ℕ) (cfg : DyadicConfig) (hrho : ∀ (i : ℕ), rhoReal i ∈ rho i) (gradient : List Core.IntervalDyadic) (hok : gradientIntervalDyadicChecked e rho n cfg = Except.ok gradient) :
                                                                                                      List.Forall₂ (fun (i : ℕ) (dI : Core.IntervalDyadic) => deriv (e.evalAlong rhoReal i) (rhoReal i) ∈ dI) (List.range n) gradient

                                                                                                      Golden theorem for the checked Dyadic gradient API.

                                                                                                      theorem LeanCert.Engine.gradientIntervalDyadicCheckedOfRat_correct (e : Core.Expr) (rhoReal : ℕ → ℝ) (rho : IntervalEnv) (n : ℕ) (cfg : DyadicConfig) (hrho : ∀ (i : ℕ), rhoReal i ∈ rho i) (gradient : List Core.IntervalDyadic) (hok : gradientIntervalDyadicCheckedOfRat e rho n cfg = Except.ok gradient) :
                                                                                                      List.Forall₂ (fun (i : ℕ) (dI : Core.IntervalDyadic) => deriv (e.evalAlong rhoReal i) (rhoReal i) ∈ dI) (List.range n) gradient

                                                                                                      Golden theorem for checked Dyadic gradients over rational input boxes.

                                                                                                      Automatic Differentiation via Intervals #

                                                                                                      This module provides forward-mode automatic differentiation using interval arithmetic. We compute both the value and derivative of an expression, with rigorous bounds on both.

                                                                                                      Module Structure #

                                                                                                      Main definitions #

                                                                                                      Main theorems #

                                                                                                      All theorems are FULLY PROVED with no sorry or axioms.

                                                                                                      N-Dimensional Boxes for Global Optimization #

                                                                                                      This file provides the Box type for representing n-dimensional domains as products of intervals, along with helper functions for branch-and-bound optimization.

                                                                                                      Main definitions #

                                                                                                      Design #

                                                                                                      A Box is represented as List IntervalRat, where the i-th element is the interval for the i-th variable. This allows boxes of any dimension.

                                                                                                      For expressions with n variables (var 0 through var n-1), a box should have at least n intervals. The conversion Box.toEnv returns default for out-of-bounds indices.

                                                                                                      Box type and basic operations #

                                                                                                      @[reducible, inline]

                                                                                                      An n-dimensional box as a list of intervals. The i-th element is the interval for variable i.

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        @[reducible, inline]

                                                                                                        A point in ℝⁿ represented as a list of reals

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          @[reducible, inline]

                                                                                                          A rational point in ℚⁿ

                                                                                                          Equations
                                                                                                          Instances For

                                                                                                            Create a one-dimensional box from a single interval.

                                                                                                            Equations
                                                                                                            Instances For

                                                                                                              Convert a box to an interval environment. Returns default for out-of-bounds indices (i.e., the whole real line approximation).

                                                                                                              Equations
                                                                                                              Instances For

                                                                                                                The dimension (number of intervals) of a box

                                                                                                                Equations
                                                                                                                Instances For

                                                                                                                  Check if a point is in a box. A point is in a box if each coordinate is in the corresponding interval.

                                                                                                                  Equations
                                                                                                                  Instances For

                                                                                                                    Membership for a real function (environment) in a box. This is the key notion for correctness: ρ ∈ B means ρ i ∈ B[i] for all i < B.length.

                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      theorem LeanCert.Engine.Optimization.Box.envMem_toEnv (ρ : ℕ → ℝ) (B : Box) (h : envMem ρ B) (hzero : ∀ i ≥ List.length B, ρ i = 0) :

                                                                                                                      envMem implies the general IntervalEnv membership for toEnv NOTE: For indices beyond the box dimension, we use the default interval [0,0]. This means expressions should only use variables 0..B.length-1 for correct results.

                                                                                                                      Width and dimension selection #

                                                                                                                      Find the index of the maximum element in a list (returns 0 for empty list)

                                                                                                                      Equations
                                                                                                                      Instances For

                                                                                                                        Find the dimension with the widest interval (heuristic for splitting). Returns 0 if the box is empty.

                                                                                                                        Equations
                                                                                                                        Instances For

                                                                                                                          Alternative: find widest dimension with explicit fold

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

                                                                                                                            Box splitting #

                                                                                                                            Split a box along a given dimension by bisecting that interval. Returns the original box if the dimension is out of bounds.

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

                                                                                                                              Split along the widest dimension

                                                                                                                              Equations
                                                                                                                              Instances For

                                                                                                                                Splitting preserves the number of box coordinates.

                                                                                                                                theorem LeanCert.Engine.Optimization.Box.envMem_of_envMem_split (B : Box) (d : ℕ) (ρ : ℕ → ℝ) :
                                                                                                                                envMem ρ (B.split d).1 → envMem ρ B

                                                                                                                                The lower child of a split is a semantic sub-box of its parent.

                                                                                                                                The upper child of a split is a semantic sub-box of its parent.

                                                                                                                                Volume and size heuristics #

                                                                                                                                Volume of a box (product of widths). Returns 0 for empty box.

                                                                                                                                Equations
                                                                                                                                Instances For

                                                                                                                                  Maximum width across all dimensions

                                                                                                                                  Equations
                                                                                                                                  Instances For

                                                                                                                                    Check if a box is "small" (max width below threshold)

                                                                                                                                    Equations
                                                                                                                                    Instances For

                                                                                                                                      Box construction helpers #

                                                                                                                                      Create a box from a list of (lo, hi) pairs

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

                                                                                                                                        Create a box from bounds: [lo₀, hi₀] × ... × [loₙ₋₁, hiₙ₋₁]

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

                                                                                                                                          Membership lemmas #

                                                                                                                                          theorem LeanCert.Engine.Optimization.Box.coord_mem_of_mem (p : Point) (B : Box) (h : mem p B) (i : Fin (List.length B)) :
                                                                                                                                          p[↑i] ∈ B[↑i]

                                                                                                                                          If a point is in a box, its i-th coordinate is in the i-th interval

                                                                                                                                          theorem LeanCert.Engine.Optimization.Box.mem_split_cases (B : Box) (d : ℕ) (hd : d < List.length B) (p : Point) (hp : mem p B) :
                                                                                                                                          mem p (B.split d).1 ∨ mem p (B.split d).2

                                                                                                                                          After splitting, any point in the original box is in one of the halves.

                                                                                                                                          theorem LeanCert.Engine.Optimization.Box.envMem_split_cases (B : Box) (d : ℕ) (hd : d < List.length B) (ρ : ℕ → ℝ) (hρ : envMem ρ B) :
                                                                                                                                          envMem ρ (B.split d).1 ∨ envMem ρ (B.split d).2

                                                                                                                                          Environment membership after splitting.

                                                                                                                                          Global Optimization via Branch-and-Bound #

                                                                                                                                          This file implements verified global optimization over intervals using branch-and-bound with interval arithmetic and derivative bounds.

                                                                                                                                          Phase Status #

                                                                                                                                          This module is now largely Phase 1 (verified). The core correctness theorems are fully proved for the ADSupported subset.

                                                                                                                                          Main definitions #

                                                                                                                                          Algorithm #

                                                                                                                                          Branch-and-bound with the following pruning rules:

                                                                                                                                          1. Interval evaluation: If f([a,b]) = [lo, hi], then min f ≥ lo
                                                                                                                                          2. Monotonicity: If f'([a,b]) > 0, f is increasing, so min is at a
                                                                                                                                          3. Subdivision: Split interval and recurse

                                                                                                                                          Optimization result #

                                                                                                                                          Result of an optimization computation

                                                                                                                                          Instances For
                                                                                                                                            noncomputable def LeanCert.Engine.OptResult.merge (r₁ r₂ : OptResult) :

                                                                                                                                            Combine two subinterval bounds, preserving their lower and upper bounds.

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

                                                                                                                                              Minimization #

                                                                                                                                              noncomputable def LeanCert.Engine.derivStrictlyPositive (e : Core.Expr) (I : Core.IntervalRat) (varIdx : ℕ) :

                                                                                                                                              Check if derivative interval is strictly positive

                                                                                                                                              Equations
                                                                                                                                              Instances For
                                                                                                                                                noncomputable def LeanCert.Engine.derivStrictlyNegative (e : Core.Expr) (I : Core.IntervalRat) (varIdx : ℕ) :

                                                                                                                                                Check if derivative interval is strictly negative

                                                                                                                                                Equations
                                                                                                                                                Instances For
                                                                                                                                                  noncomputable def LeanCert.Engine.minimizeInterval (e : Core.Expr) (I : Core.IntervalRat) (varIdx maxDepth : ℕ) :

                                                                                                                                                  Simple branch-and-bound minimization.

                                                                                                                                                  Returns an interval [lo, hi] such that:

                                                                                                                                                  • lo ≤ min_{x ∈ I} f(x)
                                                                                                                                                  • hi ≥ min_{x ∈ I} f(x)
                                                                                                                                                  Equations
                                                                                                                                                  Instances For
                                                                                                                                                    @[irreducible]
                                                                                                                                                    noncomputable def LeanCert.Engine.minimizeInterval.go (e : Core.Expr) (varIdx maxDepth : ℕ) (J : Core.IntervalRat) (depth : ℕ) :

                                                                                                                                                    Recursive interval minimization with a decreasing subdivision budget.

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

                                                                                                                                                      Base case correctness: interval evaluation gives a valid lower bound. This theorem is FULLY PROVED - no sorry, no axioms.

                                                                                                                                                      Derivative bounds and monotonicity #

                                                                                                                                                      For single-variable expressions evaluated with (fun _ => I), derivative is correct. We use evalWithDeriv1 which directly uses varActive for all variables.

                                                                                                                                                      theorem LeanCert.Engine.derivInterval_correct_single (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (x : ℝ) (hx : x ∈ I) :
                                                                                                                                                      deriv (evalFunc1 e) x ∈ derivInterval e (fun (x : ℕ) => I) 0

                                                                                                                                                      Derivative is in derivInterval for expressions that only use var 0. FULLY PROVED - no sorry.

                                                                                                                                                      theorem LeanCert.Engine.deriv_pos_on_interval (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hpos : 0 < (derivInterval e (fun (x : ℕ) => I) 0).lo) (x : ℝ) :
                                                                                                                                                      x ∈ I → 0 < deriv (evalFunc1 e) x

                                                                                                                                                      If the derivative interval is strictly positive, derivative is positive everywhere

                                                                                                                                                      theorem LeanCert.Engine.deriv_neg_on_interval (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hneg : (derivInterval e (fun (x : ℕ) => I) 0).hi < 0) (x : ℝ) :
                                                                                                                                                      x ∈ I → deriv (evalFunc1 e) x < 0

                                                                                                                                                      If the derivative interval is strictly negative, derivative is negative everywhere

                                                                                                                                                      theorem LeanCert.Engine.strictMonoOn_of_deriv_pos_interval (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hpos : 0 < (derivInterval e (fun (x : ℕ) => I) 0).lo) :

                                                                                                                                                      Strictly positive derivative implies strict monotonicity

                                                                                                                                                      theorem LeanCert.Engine.strictAntiOn_of_deriv_neg_interval (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hneg : (derivInterval e (fun (x : ℕ) => I) 0).hi < 0) :

                                                                                                                                                      Strictly negative derivative implies strict antitonicity

                                                                                                                                                      Monotonicity-based bounds #

                                                                                                                                                      theorem LeanCert.Engine.increasing_min_at_left (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hpos : 0 < (derivInterval e (fun (x : ℕ) => I) 0).lo) (x : ℝ) :
                                                                                                                                                      x ∈ I → evalFunc1 e ↑I.lo ≤ evalFunc1 e x

                                                                                                                                                      For increasing functions, minimum is at the left endpoint

                                                                                                                                                      theorem LeanCert.Engine.decreasing_min_at_right (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hneg : (derivInterval e (fun (x : ℕ) => I) 0).hi < 0) (x : ℝ) :
                                                                                                                                                      x ∈ I → evalFunc1 e ↑I.hi ≤ evalFunc1 e x

                                                                                                                                                      For decreasing functions, minimum is at the right endpoint

                                                                                                                                                      theorem LeanCert.Engine.increasing_endpoint_bound (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hpos : 0 < (derivInterval e (fun (x : ℕ) => I) 0).lo) (x : ℝ) :

                                                                                                                                                      Interval at left endpoint gives valid lower bound for increasing functions

                                                                                                                                                      theorem LeanCert.Engine.decreasing_endpoint_bound (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (hneg : (derivInterval e (fun (x : ℕ) => I) 0).hi < 0) (x : ℝ) :

                                                                                                                                                      Interval at right endpoint gives valid lower bound for decreasing functions

                                                                                                                                                      Full optimization correctness #

                                                                                                                                                      theorem LeanCert.Engine.minimizeInterval_go_correct (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (maxDepth depth : ℕ) (J : Core.IntervalRat) (x : ℝ) :
                                                                                                                                                      x ∈ J → ↑(minimizeInterval.go e 0 maxDepth J depth).valueBound.lo ≤ Core.Expr.eval (fun (x_1 : ℕ) => x) e

                                                                                                                                                      Helper lemma for go correctness. FULLY PROVED for varIdx = 0 and UsesOnlyVar0 expressions.

                                                                                                                                                      theorem LeanCert.Engine.minimizeInterval_correct (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (maxDepth : ℕ) (x : ℝ) :
                                                                                                                                                      x ∈ I → ↑(minimizeInterval e I 0 maxDepth).valueBound.lo ≤ Core.Expr.eval (fun (x_1 : ℕ) => x) e

                                                                                                                                                      Correctness: the minimum is in the computed interval. FULLY PROVED for varIdx = 0 and UsesOnlyVar0 expressions.

                                                                                                                                                      Maximization #

                                                                                                                                                      noncomputable def LeanCert.Engine.maximizeInterval (e : Core.Expr) (I : Core.IntervalRat) (varIdx maxDepth : ℕ) :

                                                                                                                                                      Maximize by minimizing the negation

                                                                                                                                                      Equations
                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                      Instances For
                                                                                                                                                        theorem LeanCert.Engine.maximizeInterval_correct (e : Core.Expr) (hsupp : ADSupported e) (hvar0 : UsesOnlyVar0 e) (I : Core.IntervalRat) (maxDepth : ℕ) (x : ℝ) :
                                                                                                                                                        x ∈ I → Core.Expr.eval (fun (x_1 : ℕ) => x) e ≤ ↑(maximizeInterval e I 0 maxDepth).valueBound.hi

                                                                                                                                                        Correctness: the maximum is in the computed interval. FULLY PROVED for varIdx = 0 and UsesOnlyVar0 expressions.

                                                                                                                                                        Bounds checking #

                                                                                                                                                        noncomputable def LeanCert.Engine.checkLowerBound (e : Core.Expr) (I : Core.IntervalRat) (c : ℚ) (varIdx maxDepth : ℕ) :

                                                                                                                                                        Check if f(x) ≥ c for all x in I

                                                                                                                                                        Equations
                                                                                                                                                        Instances For
                                                                                                                                                          noncomputable def LeanCert.Engine.checkUpperBound (e : Core.Expr) (I : Core.IntervalRat) (c : ℚ) (varIdx maxDepth : ℕ) :

                                                                                                                                                          Check if f(x) ≤ c for all x in I

                                                                                                                                                          Equations
                                                                                                                                                          Instances For

                                                                                                                                                            N-Variable Optimization Infrastructure #

                                                                                                                                                            The following section provides generalized optimization infrastructure that works with arbitrary variable indices and multi-variable environments. This allows optimizing along any coordinate while holding other variables fixed.

                                                                                                                                                            Key types:

                                                                                                                                                            The main advantage is that we can now optimize expressions with multiple variables by fixing all but one variable and optimizing along that coordinate.

                                                                                                                                                            N-variable derivative bounds #

                                                                                                                                                            theorem LeanCert.Engine.deriv_pos_on_interval_idx (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (hpos : 0 < (derivInterval e ρ_int idx).lo) (x : ℝ) :
                                                                                                                                                            x ∈ ρ_int idx → 0 < deriv (e.evalAlong ρ_real idx) x

                                                                                                                                                            If the derivative interval along idx is strictly positive, derivative is positive everywhere. Generalized version that works with any variable index and environment.

                                                                                                                                                            theorem LeanCert.Engine.deriv_neg_on_interval_idx (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (hneg : (derivInterval e ρ_int idx).hi < 0) (x : ℝ) :
                                                                                                                                                            x ∈ ρ_int idx → deriv (e.evalAlong ρ_real idx) x < 0

                                                                                                                                                            If the derivative interval along idx is strictly negative, derivative is negative everywhere. Generalized version that works with any variable index and environment.

                                                                                                                                                            theorem LeanCert.Engine.strictMonoOn_of_deriv_pos_interval_idx (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (hpos : 0 < (derivInterval e ρ_int idx).lo) :
                                                                                                                                                            StrictMonoOn (e.evalAlong ρ_real idx) (Set.Icc ↑(ρ_int idx).lo ↑(ρ_int idx).hi)

                                                                                                                                                            Strictly positive derivative along idx implies strict monotonicity. Generalized n-variable version.

                                                                                                                                                            theorem LeanCert.Engine.strictAntiOn_of_deriv_neg_interval_idx (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (hneg : (derivInterval e ρ_int idx).hi < 0) :
                                                                                                                                                            StrictAntiOn (e.evalAlong ρ_real idx) (Set.Icc ↑(ρ_int idx).lo ↑(ρ_int idx).hi)

                                                                                                                                                            Strictly negative derivative along idx implies strict antitonicity. Generalized n-variable version.

                                                                                                                                                            N-variable monotonicity-based bounds #

                                                                                                                                                            theorem LeanCert.Engine.increasing_min_at_left_idx (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (hpos : 0 < (derivInterval e ρ_int idx).lo) (x : ℝ) :
                                                                                                                                                            x ∈ ρ_int idx → e.evalAlong ρ_real idx ↑(ρ_int idx).lo ≤ e.evalAlong ρ_real idx x

                                                                                                                                                            For increasing functions along idx, minimum is at the left endpoint. Generalized n-variable version.

                                                                                                                                                            theorem LeanCert.Engine.decreasing_min_at_right_idx (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (hneg : (derivInterval e ρ_int idx).hi < 0) (x : ℝ) :
                                                                                                                                                            x ∈ ρ_int idx → e.evalAlong ρ_real idx ↑(ρ_int idx).hi ≤ e.evalAlong ρ_real idx x

                                                                                                                                                            For decreasing functions along idx, minimum is at the right endpoint. Generalized n-variable version.

                                                                                                                                                            N-variable minimization algorithm #

                                                                                                                                                            Check if derivative interval along idx is strictly positive

                                                                                                                                                            Equations
                                                                                                                                                            Instances For

                                                                                                                                                              Check if derivative interval along idx is strictly negative

                                                                                                                                                              Equations
                                                                                                                                                              Instances For

                                                                                                                                                                Update an interval environment at a specific index

                                                                                                                                                                Equations
                                                                                                                                                                Instances For
                                                                                                                                                                  noncomputable def LeanCert.Engine.minimizeIntervalIdx (e : Core.Expr) (ρ : IntervalEnv) (idx maxDepth : ℕ) :

                                                                                                                                                                  N-variable branch-and-bound minimization along coordinate idx.

                                                                                                                                                                  Returns an interval [lo, hi] such that for any ρ_real with ρ_real i ∈ ρ i:

                                                                                                                                                                  • lo ≤ min_{t ∈ ρ idx} evalAlong e ρ_real idx t
                                                                                                                                                                  • hi ≥ min_{t ∈ ρ idx} evalAlong e ρ_real idx t
                                                                                                                                                                  Equations
                                                                                                                                                                  Instances For
                                                                                                                                                                    @[irreducible]
                                                                                                                                                                    noncomputable def LeanCert.Engine.minimizeIntervalIdx.go (e : Core.Expr) (ρ : IntervalEnv) (idx maxDepth : ℕ) (J : Core.IntervalRat) (depth : ℕ) :

                                                                                                                                                                    Recursive coordinate minimization with a decreasing subdivision budget.

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

                                                                                                                                                                      N-variable minimization correctness #

                                                                                                                                                                      theorem LeanCert.Engine.minimizeIntervalIdx_base_correct (e : Core.Expr) (hsupp : ADSupported e) (ρ_int : IntervalEnv) (ρ_real : ℕ → ℝ) :
                                                                                                                                                                      (∀ (i : ℕ), ρ_real i ∈ ρ_int i) → ↑(Internal.Rational.evalUnchecked e ρ_int).lo ≤ Core.Expr.eval ρ_real e

                                                                                                                                                                      Base case correctness for n-variable optimization. Interval evaluation gives a valid lower bound.

                                                                                                                                                                      theorem LeanCert.Engine.minimizeIntervalIdx_go_correct (e : Core.Expr) (hsupp : ADSupported e) (ρ_int : IntervalEnv) (idx maxDepth depth : ℕ) (J : Core.IntervalRat) (hJ_sub : ∀ t ∈ J, t ∈ ρ_int idx) (ρ_real : ℕ → ℝ) :
                                                                                                                                                                      (∀ (i : ℕ), ρ_real i ∈ ρ_int i) → ∀ t ∈ J, ↑(minimizeIntervalIdx.go e ρ_int idx maxDepth J depth).valueBound.lo ≤ Core.Expr.eval (ρ_real[idx ↦ t]) e

                                                                                                                                                                      Helper lemma for go correctness in n-variable setting

                                                                                                                                                                      theorem LeanCert.Engine.minimizeIntervalIdx_correct (e : Core.Expr) (hsupp : ADSupported e) (ρ_int : IntervalEnv) (idx maxDepth : ℕ) (ρ_real : ℕ → ℝ) :
                                                                                                                                                                      (∀ (i : ℕ), ρ_real i ∈ ρ_int i) → ∀ t ∈ ρ_int idx, ↑(minimizeIntervalIdx e ρ_int idx maxDepth).valueBound.lo ≤ Core.Expr.eval (ρ_real[idx ↦ t]) e

                                                                                                                                                                      Correctness theorem for n-variable minimization: For any real environment ρ_real satisfying ρ_int, and any t in ρ_int idx, the computed lower bound is valid.

                                                                                                                                                                      FULLY PROVED - no sorry, no axioms.

                                                                                                                                                                      noncomputable def LeanCert.Engine.maximizeIntervalIdx (e : Core.Expr) (ρ : IntervalEnv) (idx maxDepth : ℕ) :

                                                                                                                                                                      N-variable maximization via minimization of negation

                                                                                                                                                                      Equations
                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                      Instances For
                                                                                                                                                                        theorem LeanCert.Engine.maximizeIntervalIdx_correct (e : Core.Expr) (hsupp : ADSupported e) (ρ_int : IntervalEnv) (idx maxDepth : ℕ) (ρ_real : ℕ → ℝ) :
                                                                                                                                                                        (∀ (i : ℕ), ρ_real i ∈ ρ_int i) → ∀ t ∈ ρ_int idx, Core.Expr.eval (ρ_real[idx ↦ t]) e ≤ ↑(maximizeIntervalIdx e ρ_int idx maxDepth).valueBound.hi

                                                                                                                                                                        Correctness theorem for n-variable maximization

                                                                                                                                                                        Gradient Interval Computation for Optimization #

                                                                                                                                                                        This file provides functions to compute interval bounds on the gradient ∇f(B) of an expression over a box B. This is used for monotonicity-based pruning in branch-and-bound global optimization.

                                                                                                                                                                        Main definitions #

                                                                                                                                                                        Design #

                                                                                                                                                                        The gradient is computed by running forward-mode AD (from AD.lean) for each coordinate direction. The result is a list of intervals, one per variable.

                                                                                                                                                                        Monotonicity pruning: If ∂f/∂xᵢ > 0 on the entire box B, then f is minimized when xᵢ = B[i].lo. We can shrink the box in that dimension to a point.

                                                                                                                                                                        Gradient computation #

                                                                                                                                                                        Compute the gradient interval: bounds on each partial derivative over a box. Returns a list of intervals, where the i-th interval contains ∂f/∂xᵢ for all x ∈ B.

                                                                                                                                                                        Equations
                                                                                                                                                                        Instances For

                                                                                                                                                                          Compute gradient for n variables (explicit dimension)

                                                                                                                                                                          Equations
                                                                                                                                                                          Instances For

                                                                                                                                                                            Computable versions #

                                                                                                                                                                            Create dual environment for differentiating with respect to variable idx (computable). Active variable gets der = 1, passive variables get der = 0.

                                                                                                                                                                            Equations
                                                                                                                                                                            Instances For

                                                                                                                                                                              Evaluate with derivative with respect to variable idx (computable version)

                                                                                                                                                                              Equations
                                                                                                                                                                              Instances For

                                                                                                                                                                                Computable derivative interval for multi-variable expressions. Computes the interval containing ∂f/∂xᵢ over the box.

                                                                                                                                                                                Equations
                                                                                                                                                                                Instances For
                                                                                                                                                                                  theorem LeanCert.Engine.Optimization.evalDualTotalCore_der_correct_idx (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (x : ℝ) (hx : x ∈ ρ_int idx) (cfg : EvalConfig) :
                                                                                                                                                                                  deriv (e.evalAlong ρ_real idx) x ∈ (Internal.AD.evalTotalCore e (mkDualEnvCore ρ_int idx) cfg).der

                                                                                                                                                                                  Correctness of the computable derivative evaluator for an arbitrary coordinate of a multivariate expression.

                                                                                                                                                                                  Computable version of gradient interval for Core expressions. This can be used with native_decide for verified optimization.

                                                                                                                                                                                  Equations
                                                                                                                                                                                  Instances For

                                                                                                                                                                                    Compute every partial derivative using the domain-aware checked AD path. Unlike gradientIntervalCore, this rejects unsupported syntax, reciprocal arguments containing zero, and nonpositive logarithm arguments instead of returning a finite interval that could be mistaken for a certificate.

                                                                                                                                                                                    Equations
                                                                                                                                                                                    Instances For
                                                                                                                                                                                      theorem LeanCert.Engine.Optimization.gradientIntervalChecked_correct (e : Core.Expr) (B : Box) (cfg : EvalConfig) (ρReal : ℕ → ℝ) (hρ : Box.envMem ρReal B) (hzero : ∀ i ≥ List.length B, ρReal i = 0) (gradient : List Core.IntervalRat) (hok : gradientIntervalChecked e B cfg = Except.ok gradient) :
                                                                                                                                                                                      List.Forall₂ (fun (i : ℕ) (dI : Core.IntervalRat) => deriv (e.evalAlong ρReal i) (ρReal i) ∈ dI) (List.range (List.length B)) gradient

                                                                                                                                                                                      Golden soundness theorem for a successfully computed checked gradient. The output list is aligned with coordinates 0, …, B.length - 1.

                                                                                                                                                                                      Sign classification #

                                                                                                                                                                                      Classification of an interval's sign

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

                                                                                                                                                                                          Classify the sign of an interval

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

                                                                                                                                                                                            Monotonicity predicates #

                                                                                                                                                                                            Pruning queries #

                                                                                                                                                                                            Can we prune coordinate i to its low endpoint for minimization? True if ∂f/∂xᵢ > 0 on B (f is increasing in xᵢ, so min is at lo).

                                                                                                                                                                                            Equations
                                                                                                                                                                                            Instances For

                                                                                                                                                                                              Can we prune coordinate i to its high endpoint for minimization? True if ∂f/∂xᵢ < 0 on B (f is decreasing in xᵢ, so min is at hi).

                                                                                                                                                                                              Equations
                                                                                                                                                                                              Instances For

                                                                                                                                                                                                Prune a box for minimization by fixing monotonic coordinates. Returns a (potentially smaller) box and a list of fixed coordinates.

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

                                                                                                                                                                                                  Correctness theorems #

                                                                                                                                                                                                  theorem LeanCert.Engine.Optimization.gradientInterval_correct (e : Core.Expr) (hsupp : ADSupported e) (B : Box) (ρ : ℕ → ℝ) (hρ : Box.envMem ρ B) (hzero : ∀ i ≥ List.length B, ρ i = 0) (i : Fin (List.length B)) :
                                                                                                                                                                                                  deriv (e.evalAlong ρ ↑i) (ρ ↑i) ∈ (gradientIntervalN e B (List.length B))[↑i]?.getD default

                                                                                                                                                                                                  The computed gradient interval contains the true partial derivatives. This follows from evalDual_der_correct_idx in AD.lean.

                                                                                                                                                                                                  theorem LeanCert.Engine.Optimization.pruneToLo_preserves_min (e : Core.Expr) (hsupp : ADSupported e) (B : Box) (i : Fin (List.length B)) (hgrad : isStrictlyPositive (derivInterval e B.toEnv ↑i) = true) (ρ : ℕ → ℝ) :
                                                                                                                                                                                                  Box.envMem ρ B → (∀ j ≥ List.length B, ρ j = 0) → ∃ (ρ' : ℕ → ℝ), Box.envMem ρ' B ∧ (∀ j ≥ List.length B, ρ' j = 0) ∧ ρ' ↑i = ↑B[↑i].lo ∧ Core.Expr.eval ρ' e ≤ Core.Expr.eval ρ e

                                                                                                                                                                                                  If we prune a coordinate to lo because ∂f/∂xᵢ > 0, the minimum is preserved. Informal: if f is increasing in xᵢ on B, then min{f(x) : x ∈ B} = min{f(x) : xᵢ = B[i].lo}. NOTE: Requires ρ j = 0 for j ≥ B.length (standard assumption for box membership).

                                                                                                                                                                                                  theorem LeanCert.Engine.Optimization.pruneToHi_preserves_min (e : Core.Expr) (hsupp : ADSupported e) (B : Box) (i : Fin (List.length B)) (hgrad : isStrictlyNegative (derivInterval e B.toEnv ↑i) = true) (ρ : ℕ → ℝ) :
                                                                                                                                                                                                  Box.envMem ρ B → (∀ j ≥ List.length B, ρ j = 0) → ∃ (ρ' : ℕ → ℝ), Box.envMem ρ' B ∧ (∀ j ≥ List.length B, ρ' j = 0) ∧ ρ' ↑i = ↑B[↑i].hi ∧ Core.Expr.eval ρ' e ≤ Core.Expr.eval ρ e

                                                                                                                                                                                                  If we prune a coordinate to hi because ∂f/∂xᵢ < 0, the minimum is preserved. NOTE: Requires ρ j = 0 for j ≥ B.length (standard assumption for box membership).

                                                                                                                                                                                                  Pruned box membership and correctness #

                                                                                                                                                                                                  Helper: membership in the pruned box implies membership in the original box. The pruned box only shrinks coordinates, never expands them.

                                                                                                                                                                                                  The pruned box has the same length as the original box

                                                                                                                                                                                                  theorem LeanCert.Engine.Optimization.increasing_min_at_left_idx_core (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (cfg : EvalConfig) (hpos : 0 < (derivIntervalCoreN e ρ_int idx cfg).lo) (x : ℝ) :
                                                                                                                                                                                                  x ∈ ρ_int idx → e.evalAlong ρ_real idx ↑(ρ_int idx).lo ≤ e.evalAlong ρ_real idx x

                                                                                                                                                                                                  A positive computable derivative enclosure makes the objective increasing along the selected coordinate.

                                                                                                                                                                                                  theorem LeanCert.Engine.Optimization.decreasing_min_at_right_idx_core (e : Core.Expr) (hsupp : ADSupported e) (ρ_real : ℕ → ℝ) (ρ_int : IntervalEnv) (idx : ℕ) (hρ : ∀ (i : ℕ), ρ_real i ∈ ρ_int i) (cfg : EvalConfig) (hneg : (derivIntervalCoreN e ρ_int idx cfg).hi < 0) (x : ℝ) :
                                                                                                                                                                                                  x ∈ ρ_int idx → e.evalAlong ρ_real idx ↑(ρ_int idx).hi ≤ e.evalAlong ρ_real idx x

                                                                                                                                                                                                  A negative computable derivative enclosure makes the objective decreasing along the selected coordinate.

                                                                                                                                                                                                  theorem LeanCert.Engine.Optimization.pruneBoxForMin_correct (e : Core.Expr) (hsupp : ADSupported e) (B : Box) (cfg : EvalConfig := { }) :
                                                                                                                                                                                                  have grad := gradientIntervalCore e B cfg; have B' := (pruneBoxForMin B grad).1; ∀ (ρ : ℕ → ℝ), Box.envMem ρ B → (∀ i ≥ List.length B, ρ i = 0) → ∃ (ρ' : ℕ → ℝ), Box.envMem ρ' B' ∧ (∀ i ≥ List.length B', ρ' i = 0) ∧ Core.Expr.eval ρ' e ≤ Core.Expr.eval ρ e

                                                                                                                                                                                                  Certified roots of differentiable systems #

                                                                                                                                                                                                  This module implements a strong, norm-form Krawczyk test for square systems in LeanCert's ADSupported expression fragment. The center and rational preconditioner are untrusted certificate data; krawczykCheck verifies AD support, center containment, invertibility, a strict infinity-norm contraction bound, and a strict self-map enclosure.

                                                                                                                                                                                                  The golden theorem krawczykCheck_sound turns a successful Boolean check into existence and uniqueness of a real root in the supplied box.

                                                                                                                                                                                                  @[instance_reducible]

                                                                                                                                                                                                  Use the singleton zero interval as the additive identity.

                                                                                                                                                                                                  Equations
                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                    @[instance_reducible]

                                                                                                                                                                                                    Use endpoint-wise interval addition for finite interval sums.

                                                                                                                                                                                                    Equations
                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                      @[instance_reducible]

                                                                                                                                                                                                      Natural scalar multiplication by repeated interval addition.

                                                                                                                                                                                                      Equations
                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                        @[instance_reducible]

                                                                                                                                                                                                        The additive commutative monoid of rational intervals.

                                                                                                                                                                                                        Equations
                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                          noncomputable def LeanCert.Engine.finEnv {n : ℕ} (x : Fin n → ℝ) :
                                                                                                                                                                                                          ℕ → ℝ

                                                                                                                                                                                                          Extend a finite real coordinate vector to an expression environment with zero defaults.

                                                                                                                                                                                                          Equations
                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                            noncomputable def LeanCert.Engine.evalFin {n : ℕ} (e : Core.Expr) (x : Fin n → ℝ) :

                                                                                                                                                                                                            Evaluate an expression in the environment of a finite real coordinate vector.

                                                                                                                                                                                                            Equations
                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                              theorem LeanCert.Engine.finEnv_update {n : ℕ} (x : Fin n → ℝ) (j : Fin n) (t : ℝ) :
                                                                                                                                                                                                              theorem LeanCert.Engine.fderiv_single_eq_deriv_evalAlong {n : ℕ} (e : Core.Expr) (h : ADSupported e) (x : Fin n → ℝ) (j : Fin n) :
                                                                                                                                                                                                              (fderiv ℝ (evalFin e) x) (Pi.single j 1) = deriv (e.evalAlong (finEnv x) ↑j) (x j)
                                                                                                                                                                                                              noncomputable def LeanCert.Engine.systemEval {n : ℕ} (F : Fin n → Core.Expr) (x : Fin n → ℝ) :
                                                                                                                                                                                                              Fin n → ℝ

                                                                                                                                                                                                              Evaluate all coordinate expressions of a finite system.

                                                                                                                                                                                                              Equations
                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                noncomputable def LeanCert.Engine.jacobianAt {n : ℕ} (F : Fin n → Core.Expr) (x : Fin n → ℝ) :
                                                                                                                                                                                                                Matrix (Fin n) (Fin n) ℝ

                                                                                                                                                                                                                The matrix of coordinate partial derivatives of an expression system.

                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                  theorem LeanCert.Engine.jacobianAt_apply {n : ℕ} (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) (x : Fin n → ℝ) (i j : Fin n) :
                                                                                                                                                                                                                  jacobianAt F x i j = deriv ((F i).evalAlong (finEnv x) ↑j) (x j)

                                                                                                                                                                                                                  Extend a finite interval box to the evaluator’s indexed environment.

                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                    def LeanCert.Engine.FinBoxMem {n : ℕ} (x : Fin n → ℝ) (X : Fin n → Core.IntervalRat) :

                                                                                                                                                                                                                    Coordinatewise membership of a real vector in a rational interval box.

                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                      Enclose the Jacobian entries by interval automatic differentiation.

                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                        theorem LeanCert.Engine.finEnv_mem_finBoxEnv {n : ℕ} {x : Fin n → ℝ} {X : Fin n → Core.IntervalRat} (hx : FinBoxMem x X) (i : ℕ) :
                                                                                                                                                                                                                        theorem LeanCert.Engine.jacobianAt_mem_intervalJacobian {n : ℕ} (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) (X : Fin n → Core.IntervalRat) (x : Fin n → ℝ) (hx : FinBoxMem x X) (cfg : EvalConfig) (i j : Fin n) :
                                                                                                                                                                                                                        jacobianAt F x i j ∈ intervalJacobian F X cfg i j
                                                                                                                                                                                                                        noncomputable def LeanCert.Engine.matrixCLM {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) :
                                                                                                                                                                                                                        (Fin n → ℝ) →L[ℝ] Fin n → ℝ

                                                                                                                                                                                                                        Interpret a real matrix as a continuous linear map on finite coordinate vectors.

                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                          noncomputable def LeanCert.Engine.newtonMap {n : ℕ} (Y : Matrix (Fin n) (Fin n) ℝ) (F : Fin n → Core.Expr) (x : Fin n → ℝ) :
                                                                                                                                                                                                                          Fin n → ℝ

                                                                                                                                                                                                                          The preconditioned Newton map x ↦ x - Y (F x).

                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                            theorem LeanCert.Engine.newtonMap_differentiable {n : ℕ} (Y : Matrix (Fin n) (Fin n) ℝ) (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) :
                                                                                                                                                                                                                            theorem LeanCert.Engine.newtonMap_fderiv_matrix {n : ℕ} (Y : Matrix (Fin n) (Fin n) ℝ) (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) (x : Fin n → ℝ) :

                                                                                                                                                                                                                            The set of real vectors lying coordinatewise in the interval box.

                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                              theorem LeanCert.Engine.contraction_unique_fixedPoint_in_finBox {n : ℕ} (X : Fin n → Core.IntervalRat) (m : Fin n → ℝ) (hm : FinBoxMem m X) (g : (Fin n → ℝ) → Fin n → ℝ) (hmap : Set.MapsTo g (finBoxSet X) (finBoxSet X)) (q : ℝ) (hq0 : 0 ≤ q) (hq1 : q < 1) (hdiff : ∀ x ∈ finBoxSet X, DifferentiableAt ℝ g x) (hderiv : ∀ x ∈ finBoxSet X, ‖fderiv ℝ g x‖ ≤ q) :
                                                                                                                                                                                                                              ∃! x : Fin n → ℝ, FinBoxMem x X ∧ g x = x

                                                                                                                                                                                                                              The identity matrix represented by singleton rational intervals.

                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                Multiply a rational matrix by an interval matrix using interval sums.

                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                Instances For

                                                                                                                                                                                                                                  The interval matrix I - Y J enclosing the Newton-map derivative.

                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                    theorem LeanCert.Engine.mem_interval_sum {ι : Type u_1} (s : Finset ι) (x : ι → ℝ) (I : ι → Core.IntervalRat) (h : ∀ i ∈ s, x i ∈ I i) :
                                                                                                                                                                                                                                    ∑ i ∈ s, x i ∈ ∑ i ∈ s, I i
                                                                                                                                                                                                                                    theorem LeanCert.Engine.mem_ratMulInterval {n : ℕ} (Y : Matrix (Fin n) (Fin n) ℚ) (Jreal : Matrix (Fin n) (Fin n) ℝ) (J : Matrix (Fin n) (Fin n) Core.IntervalRat) (hJ : ∀ (i j : Fin n), Jreal i j ∈ J i j) (i j : Fin n) :
                                                                                                                                                                                                                                    ((Y.map fun (q : ℚ) => ↑q) * Jreal) i j ∈ ratMulInterval Y J i j
                                                                                                                                                                                                                                    theorem LeanCert.Engine.mem_preconditionedJacobian {n : ℕ} (Y : Matrix (Fin n) (Fin n) ℚ) (Jreal : Matrix (Fin n) (Fin n) ℝ) (J : Matrix (Fin n) (Fin n) Core.IntervalRat) (hJ : ∀ (i j : Fin n), Jreal i j ∈ J i j) (i j : Fin n) :
                                                                                                                                                                                                                                    (1 - (Y.map fun (q : ℚ) => ↑q) * Jreal) i j ∈ preconditionedJacobian Y J i j

                                                                                                                                                                                                                                    The larger absolute endpoint, bounding absolute values in the interval.

                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                      The sum of absolute interval bounds in a selected matrix row.

                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                      Instances For

                                                                                                                                                                                                                                        The maximum interval row sum, bounding the matrix’s sup-norm operator norm.

                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                          theorem LeanCert.Engine.matrix_norm_le_intervalMatrixBound {n : ℕ} (R : Matrix (Fin n) (Fin n) ℝ) (A : Matrix (Fin n) (Fin n) Core.IntervalRat) (hmem : ∀ (i j : Fin n), R i j ∈ A i j) :
                                                                                                                                                                                                                                          theorem LeanCert.Engine.newtonMap_fderiv_norm_le {n : ℕ} (Y : Matrix (Fin n) (Fin n) ℚ) (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) (X : Fin n → Core.IntervalRat) (x : Fin n → ℝ) (hx : FinBoxMem x X) (cfg : EvalConfig) :

                                                                                                                                                                                                                                          Represent a rational center by singleton intervals in the evaluation environment.

                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                            def LeanCert.Engine.pointEvalIntervals {n : ℕ} (F : Fin n → Core.Expr) (m : Fin n → ℚ) (cfg : EvalConfig := { }) :

                                                                                                                                                                                                                                            Enclose the expression system at a rational center by interval evaluation.

                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                                                              Multiply a rational matrix by an interval vector.

                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                def LeanCert.Engine.newtonCenterInterval {n : ℕ} (F : Fin n → Core.Expr) (m : Fin n → ℚ) (Y : Matrix (Fin n) (Fin n) ℚ) (cfg : EvalConfig := { }) :

                                                                                                                                                                                                                                                An interval enclosure of the preconditioned Newton map at the chosen center.

                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                  theorem LeanCert.Engine.finEnv_ratCast_mem_pointIntervalEnv {n : ℕ} (m : Fin n → ℚ) (i : ℕ) :
                                                                                                                                                                                                                                                  finEnv (fun (j : Fin n) => ↑(m j)) i ∈ pointIntervalEnv m i
                                                                                                                                                                                                                                                  theorem LeanCert.Engine.systemEval_mem_pointEvalIntervals {n : ℕ} (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) (m : Fin n → ℚ) (cfg : EvalConfig) (i : Fin n) :
                                                                                                                                                                                                                                                  systemEval F (fun (j : Fin n) => ↑(m j)) i ∈ pointEvalIntervals F m cfg i
                                                                                                                                                                                                                                                  theorem LeanCert.Engine.newtonMap_center_mem {n : ℕ} (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) (m : Fin n → ℚ) (Y : Matrix (Fin n) (Fin n) ℚ) (cfg : EvalConfig) (i : Fin n) :
                                                                                                                                                                                                                                                  newtonMap (Y.map fun (q : ℚ) => ↑q) F (fun (j : Fin n) => ↑(m j)) i ∈ newtonCenterInterval F m Y cfg i
                                                                                                                                                                                                                                                  def LeanCert.Engine.coordinateRadius {n : ℕ} (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) (i : Fin n) :

                                                                                                                                                                                                                                                  The greater endpoint distance from the center in a selected coordinate.

                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                    def LeanCert.Engine.boxRadius {n : ℕ} (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) :

                                                                                                                                                                                                                                                    The maximum coordinate radius of the box around the chosen center.

                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                      theorem LeanCert.Engine.abs_sub_center_le_coordinateRadius {n : ℕ} {X : Fin n → Core.IntervalRat} {m : Fin n → ℚ} {x : Fin n → ℝ} (hx : FinBoxMem x X) (i : Fin n) :
                                                                                                                                                                                                                                                      |x i - ↑(m i)| ≤ ↑(coordinateRadius X m i)
                                                                                                                                                                                                                                                      theorem LeanCert.Engine.boxRadius_nonneg {n : ℕ} (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) :
                                                                                                                                                                                                                                                      theorem LeanCert.Engine.norm_sub_center_le_boxRadius {n : ℕ} {X : Fin n → Core.IntervalRat} {m : Fin n → ℚ} {x : Fin n → ℝ} (hx : FinBoxMem x X) :
                                                                                                                                                                                                                                                      ‖x - fun (i : Fin n) => ↑(m i)‖ ≤ ↑(boxRadius X m)

                                                                                                                                                                                                                                                      The rational interval with endpoints -d and d.

                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                        def LeanCert.Engine.newtonImageEnclosure {n : ℕ} (F : Fin n → Core.Expr) (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) (Y : Matrix (Fin n) (Fin n) ℚ) (cfg : EvalConfig := { }) :

                                                                                                                                                                                                                                                        Enclose the Newton image using its center value and a uniform derivative bound.

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

                                                                                                                                                                                                                                                          Test whether both endpoints lie strictly inside another interval.

                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                            theorem LeanCert.Engine.newtonMap_mapsTo_of_imageEnclosure {n : ℕ} (F : Fin n → Core.Expr) (h : ∀ (i : Fin n), ADSupported (F i)) (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) (hm : FinBoxMem (fun (i : Fin n) => ↑(m i)) X) (Y : Matrix (Fin n) (Fin n) ℚ) (cfg : EvalConfig) (hencl : ∀ (i : Fin n), intervalStrictInside (newtonImageEnclosure F X m Y cfg i) (X i) = true) :
                                                                                                                                                                                                                                                            Set.MapsTo (newtonMap (Y.map fun (q : ℚ) => ↑q) F) (finBoxSet X) (finBoxSet X)

                                                                                                                                                                                                                                                            Rational center and preconditioner data for a checkable Krawczyk certificate.

                                                                                                                                                                                                                                                            • center : Fin n → ℚ

                                                                                                                                                                                                                                                              The rational center used by the Newton-image enclosure.

                                                                                                                                                                                                                                                            • preconditioner : Matrix (Fin n) (Fin n) ℚ

                                                                                                                                                                                                                                                              The rational matrix used to precondition the equation system.

                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                              def LeanCert.Engine.centerInside {n : ℕ} (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) :

                                                                                                                                                                                                                                                              Coordinatewise containment of the rational center in the interval box.

                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                def LeanCert.Engine.krawczykCheck {n : ℕ} (F : Fin n → Core.Expr) (X : Fin n → Core.IntervalRat) (cert : KrawczykCert n) (cfg : EvalConfig := { }) :

                                                                                                                                                                                                                                                                Check supported derivatives, center containment, invertibility, contraction and self-map bounds.

                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                  def LeanCert.Engine.SystemZero {n : ℕ} (F : Fin n → Core.Expr) (x : Fin n → ℝ) :

                                                                                                                                                                                                                                                                  Every expression in the finite system evaluates to zero at the given point.

                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                    theorem LeanCert.Engine.centerInside_sound {n : ℕ} {X : Fin n → Core.IntervalRat} {m : Fin n → ℚ} (h : centerInside X m) :
                                                                                                                                                                                                                                                                    FinBoxMem (fun (i : Fin n) => ↑(m i)) X
                                                                                                                                                                                                                                                                    theorem LeanCert.Engine.fixedPoint_iff_systemZero {n : ℕ} (F : Fin n → Core.Expr) (Y : Matrix (Fin n) (Fin n) ℚ) (hdet : Y.det ≠ 0) (x : Fin n → ℝ) :
                                                                                                                                                                                                                                                                    newtonMap (Y.map fun (q : ℚ) => ↑q) F x = x ↔ SystemZero F x
                                                                                                                                                                                                                                                                    theorem LeanCert.Engine.krawczykCheck_sound {n : ℕ} (F : Fin n → Core.Expr) (X : Fin n → Core.IntervalRat) (cert : KrawczykCert n) (cfg : EvalConfig) (hcheck : krawczykCheck F X cert cfg = true) :