Adaptive Bound Verification via Branch-and-Bound #
This file provides adaptive bound verification functions that use the branch-and-bound global optimization algorithm to verify bounds on expressions. Unlike single-shot interval evaluation, these functions automatically subdivide the domain until the bound can be verified or the iteration limit is reached.
Main definitions #
verifyUpperBound- Verify f(x) ≤ bound for all x in box using adaptive subdivisionverifyLowerBound- Verify f(x) ≥ bound for all x in box using adaptive subdivisionverifyUpperBound1- Single-variable versionverifyLowerBound1- Single-variable version
Main theorem boundary #
The correctness theorems in this file are stated over the noncomputable
globalMaximize / globalMinimize specifications. The executable
verifyUpperBound / verifyLowerBound checkers use globalMaximizeCore /
globalMinimizeCore; they are useful adaptive checkers, but should not be read
as having a Boolean soundness theorem until a matching core-algorithm theorem is
added.
verifyUpperBound_correct- Noncomputable upper-bound theoremverifyLowerBound_correct- Noncomputable lower-bound theorem
Usage #
These functions are intended to be used as fallbacks when single-shot interval evaluation fails due to over-approximation. They provide better precision at the cost of increased computation.
-- Single-shot fails on tight bounds, but adaptive succeeds
example : verifyUpperBound1 (Expr.sin (Expr.var 0)) ⟨0, 11/10, by norm_num⟩ (85/100) = true := by
native_decide
Configuration for bound verification #
Configuration for adaptive bound verification
- maxIterations : ℕ
Maximum number of subdivisions
- tolerance : ℚ
Stop when box width is below this threshold
- taylorDepth : ℕ
Taylor depth for interval evaluation
- useMonotonicity : Bool
Use monotonicity-based pruning (symbolic pre-pass for gradient signs)
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
Convert BoundVerifyConfig to GlobalOptConfig
Equations
- cfg.toGlobalOptConfig = { maxIterations := cfg.maxIterations, tolerance := cfg.tolerance, useMonotonicity := cfg.useMonotonicity, taylorDepth := cfg.taylorDepth }
Instances For
Witness/Epsilon-argmax structures #
A witness point for an optimization result
The coordinates of the witness point
- value : Core.IntervalRat
The function value at this point (interval containing true value)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Result of bound verification with witness information
- verified : Bool
Whether the bound was verified
- computedBound : ℚ
The computed bound (lo for min, hi for max)
- witness : WitnessPoint
Approximate argmin/argmax (midpoint of best box)
- epsilon : ℚ
Width of the best box (epsilon for ε-approximate argmin/argmax)
- iterations : ℕ
Number of iterations used
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extract witness point from a box (midpoint of each interval)
Equations
- B.midpoint = List.map (fun (I : LeanCert.Core.IntervalRat) => I.midpoint) B
Instances For
Compute maximum width of a box (the ε in ε-approximate)
Equations
- B.maxWidthQ = List.foldl (fun (acc : ℚ) (I : LeanCert.Core.IntervalRat) => max acc (I.hi - I.lo)) 0 B
Instances For
Evaluate expression at a rational point (using singleton intervals)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Computable bound verification functions #
Verify f(x) ≤ bound for all x in box using adaptive subdivision. Returns true if the maximum of f over the box is ≤ bound.
Equations
- LeanCert.Engine.Optimization.verifyUpperBound e B bound cfg = decide ((LeanCert.Engine.Optimization.globalMaximizeCore e B cfg.toGlobalOptConfig).bound.hi ≤ bound)
Instances For
Verify f(x) ≥ bound for all x in box using adaptive subdivision. Returns true if the minimum of f over the box is ≥ bound.
Equations
- LeanCert.Engine.Optimization.verifyLowerBound e B bound cfg = decide ((LeanCert.Engine.Optimization.globalMinimizeCore e B cfg.toGlobalOptConfig).bound.lo ≥ bound)
Instances For
Verify f(x) < bound for all x in box using adaptive subdivision. Returns true if the maximum of f over the box is < bound.
Equations
- LeanCert.Engine.Optimization.verifyUpperBoundStrict e B bound cfg = decide ((LeanCert.Engine.Optimization.globalMaximizeCore e B cfg.toGlobalOptConfig).bound.hi < bound)
Instances For
Verify f(x) > bound for all x in box using adaptive subdivision. Returns true if the minimum of f over the box is > bound.
Equations
- LeanCert.Engine.Optimization.verifyLowerBoundStrict e B bound cfg = decide ((LeanCert.Engine.Optimization.globalMinimizeCore e B cfg.toGlobalOptConfig).bound.lo > bound)
Instances For
Epsilon-argmax/argmin functions with witness information #
Find the maximum of f over a box, returning result with witness information. The witness is an ε-approximate argmax: a point where f(witness) is within ε of the true maximum, where ε = bestBox.maxWidth.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Find the minimum of f over a box, returning result with witness information. The witness is an ε-approximate argmin: a point where f(witness) is within ε of the true minimum, where ε = bestBox.maxWidth.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Verify f(x) ≤ bound with witness information. Returns the verification result along with an ε-approximate argmax.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Verify f(x) ≥ bound with witness information. Returns the verification result along with an ε-approximate argmin.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Single-variable convenience functions #
Single-variable version of verifyUpperBound
Equations
Instances For
Single-variable version of verifyLowerBound
Equations
Instances For
Single-variable version of verifyUpperBoundStrict
Equations
Instances For
Single-variable version of verifyLowerBoundStrict
Equations
Instances For
Single-variable version of findMaxWithWitness
Equations
Instances For
Single-variable version of findMinWithWitness
Equations
Instances For
Single-variable version of verifyUpperBoundWithWitness
Equations
Instances For
Single-variable version of verifyLowerBoundWithWitness
Equations
Instances For
Correctness theorems (noncomputable proofs) #
These theorems intentionally take premises involving globalMaximize and
globalMinimize, not the executable Boolean checkers above. This keeps the
current trust boundary explicit: the adaptive core is available for search and
candidate checking, while proof-producing users should rely on the theorem
premises below or on a future globalMaximizeCore/globalMinimizeCore
soundness theorem.
Helper: convert single-variable environment to box membership
Helper: if i ≥ 1, then (fun _ => x) i = 0 is vacuously satisfiable for our purposes
Noncomputable upper-bound theorem.
Despite the historical name, this is not a Boolean soundness theorem for
verifyUpperBound; its premise is the semantic bound produced by
globalMaximize.
Noncomputable lower-bound theorem.
Despite the historical name, this is not a Boolean soundness theorem for
verifyLowerBound; its premise is the semantic bound produced by
globalMinimize.
Tactic-facing lemmas for adaptive bound verification #
Tactic-facing lemma: if adaptive verification succeeds, upper bound holds. This is the key lemma that tactics use to close goals. Requires that the expression uses only var 0.
Tactic-facing lemma: if adaptive verification succeeds, lower bound holds. Requires that the expression uses only var 0.
Strict upper bound version
Strict lower bound version
Theorem versions for Set.Icc (for tactic compatibility) #
Adaptive upper bound for Set.Icc membership
Adaptive lower bound for Set.Icc membership
Strict upper bound for Set.Icc
Strict lower bound for Set.Icc