Float-Guided Global Optimization #
This file provides "oracle-guided" global optimization that uses fast floating-point heuristics to initialize the rigorous branch-and-bound algorithm with tight bounds.
Algorithm Overview #
The key insight: finding a good upper bound early allows aggressive pruning.
Heuristic Phase: Use Monte Carlo sampling with hardware floats to find a candidate point x_guess that likely minimizes f.
Certification Phase: Convert x_guess to a tiny rational interval and rigorously evaluate f(x_guess) using interval arithmetic to get a certified upper bound U.
Pruning Phase: Initialize branch-and-bound with upper bound U. Any box B with lower bound L > U is immediately pruned.
Performance Impact #
For typical optimization problems, this approach can prune 90%+ of the search space on the first iteration, dramatically reducing total computation.
Main definitions #
certifyCandidate- Convert a float candidate to a certified upper boundglobalMinimizeGuided- Guided minimization using float heuristicsglobalMaximizeGuided- Guided maximization using float heuristics
Design notes #
The float results are NEVER trusted directly. They only guide where to look. All bounds returned are rigorously computed using interval arithmetic.
Configuration for guided optimization #
Extended configuration for guided optimization
- taylorDepth : ℕ
- heuristicSamples : ℕ
Number of Monte Carlo samples for heuristic search
- seed : ℕ
Random seed for reproducibility
- useGridSearch : Bool
Use grid search in addition to Monte Carlo (good for low dimensions)
- gridPointsPerDim : ℕ
Grid points per dimension (only if useGridSearch = true and dim ≤ 3)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Float to Rational conversion #
Convert a Float to a rational approximation. Returns a rational that is close to the float value. Note: This is approximate; the certified interval evaluation handles precision.
Equations
Instances For
Convert a float environment to a rational point interval environment. Each float coordinate becomes a small interval around the rational approximation. Uses a fixed width of 1/1000000 for simplicity.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert a float environment to interval environment within box bounds. Clamps coordinates to stay within the box.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Candidate certification #
Certify a float candidate by evaluating it rigorously. Returns an interval containing the true function value at (or near) the candidate.
Equations
- LeanCert.Engine.Optimization.certifyCandidate e B pt cfg = LeanCert.Engine.evalIntervalCore e (LeanCert.Engine.Optimization.floatEnvToRatEnvClamped pt B) { taylorDepth := cfg.taylorDepth }
Instances For
Certify with division support.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Guided optimization #
Global minimization with Float guidance.
Algorithm:
- Evaluate the whole box to get initial bounds
- Use Monte Carlo (and optionally grid search) to find a good candidate
- Certify the candidate to get a rigorous upper bound
- Initialize branch-and-bound with this upper bound for early pruning
Equations
- One or more equations did not get rendered due to their size.
Instances For
Global minimization with Float guidance and division support.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Global maximization with Float guidance.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Global maximization with Float guidance and division support.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convenience API #
Quick guided minimization with sensible defaults
Equations
- LeanCert.Engine.Optimization.minimize e B maxIters tolerance = LeanCert.Engine.Optimization.globalMinimizeGuided e B { maxIterations := maxIters, tolerance := tolerance }
Instances For
Quick guided maximization with sensible defaults
Equations
- LeanCert.Engine.Optimization.maximize e B maxIters tolerance = LeanCert.Engine.Optimization.globalMaximizeGuided e B { maxIterations := maxIters, tolerance := tolerance }
Instances For
Result inspection #
Get the certified minimum interval from a result.
Note: Returns none if lo > hi (should not happen for valid results).
Equations
Instances For
Check if the optimization has converged (gap is small)