Root Finding: Newton Method #
This file implements the interval Newton method for root finding.
Main definitions #
newtonStepTM- TM-based interval Newton stepnewtonStepSimple- Simple interval Newton step (fallback)newtonStep- Combined Newton step (tries TM first)newtonIntervalGo- Main Newton iteration loopnewtonIntervalTM- Newton interval iteration using TM
Main theorems #
newton_preserves_root- Roots are preserved by Newton refinement (via MVT)newton_step_at_most_one_root- At most one root when Newton step succeeds (via Rolle)newtonIntervalGo_preserves_root- If root exists, noRoot cannot be returned
All Newton theorems for root preservation are FULLY PROVED with no sorry.
Newton step definitions #
One TM-based interval Newton step for e on I w.r.t. variable varIdx.
The Newton operator is: N(I) = c - f(c)/f'(I) where c is the center (midpoint) of I.
We use Taylor model evaluation to get a sharper bound on f(c) than plain interval evaluation, and AD for the derivative interval f'(I).
Returns the intersection I ∩ N(I), or none if:
- The Taylor model build fails (e.g., division by interval containing 0)
- The derivative interval contains 0 (cannot safely divide)
- The intersection is empty
degree is the Taylor model degree (1 is usually enough for Newton).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Simple Newton step using plain interval arithmetic (fallback). Less precise than TM-based but always available.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Combined Newton step: tries TM-based first, falls back to simple. This is the main entry point for the Newton iteration.
Equations
- LeanCert.Engine.newtonStep e I varIdx degree = match LeanCert.Engine.newtonStepTM e I varIdx degree with | some N => some N | none => LeanCert.Engine.newtonStepSimple e I varIdx
Instances For
Main Newton iteration loop. Extracted from newtonIntervalTM for proof purposes.
Equations
- One or more equations did not get rendered due to their size.
- LeanCert.Engine.newtonIntervalGo e varIdx degree J 0 contracted = if contracted = true then (J, LeanCert.Engine.RootStatus.uniqueRoot) else (J, LeanCert.Engine.checkRootStatus e J)
Instances For
Interval Newton iteration using TM-based steps.
If Newton step contracts (result ⊂ input), we have uniqueness.
Parameters:
e: the expression representing the functionI: initial interval to search for rootvarIdx: variable index (typically 0 for single-variable)maxIter: maximum number of Newton iterationsdegree: Taylor model degree (default 1, higher for more precision)
Equations
- LeanCert.Engine.newtonIntervalTM e I varIdx maxIter degree = LeanCert.Engine.newtonIntervalGo e varIdx degree I maxIter false
Instances For
Original Newton iteration (for backwards compatibility). Now uses TM-based implementation with degree 1.
Equations
- LeanCert.Engine.newtonInterval e I varIdx maxIter = LeanCert.Engine.newtonIntervalTM e I varIdx maxIter
Instances For
Auxiliary lemmas for Newton proofs #
The derivative of evalFunc1 at any point in I is contained in derivInterval. This bridges our AD derivative bounds to actual derivatives. Requires UsesOnlyVar0, which we'll assume for root finding on single-variable expressions.
Mean Value Theorem application: for differentiable f, f(x) - f(c) = f'(ξ)(x - c) for some ξ between c and x.
Abstract Newton preservation lemma: if x is a root in I, and we compute N = I ∩ (c - fc/dI) where fc contains f(c) and dI contains f'(I), then x ∈ N.
This captures the mathematical essence without dealing with the monadic structure of newtonStepTM/newtonStepSimple.
If a root exists in I and Newton step produces N, then the root is in N. This is the key soundness property: Newton refinement preserves roots.
Requires UsesOnlyVar0 e to connect our AD derivative bounds to actual derivatives.
This is a reasonable assumption for root finding on single-variable expressions.
At most one root when Newton step succeeds (regardless of contraction).
If a Newton step succeeds (returns some N), then the derivative interval excludes zero. By MVT, this means f is strictly monotonic on I, hence at most one root.
This lemma is independent of existence - it just proves uniqueness given any two roots.
Helper lemmas for Newton contraction existence proof #
Structure extracted from a contracting Newton step. When newtonStepSimple contracts, we can extract bounds on the quotient Q = fc/dI.
- c : ℚ
- fc : Core.IntervalRat
- dI : Core.IntervalRat
- Q : Core.IntervalRat
- hdI_nonzero : ¬self.dI.containsZero
Instances For
When Newton contracts strictly, the Newton bounds dominate the intersection. That is, N.lo = c - Q.hi (not I.lo) and N.hi = c - Q.lo (not I.hi).
Extract the Newton step structure from newtonStepSimple. This lemma isolates the definitional unfolding of newtonStepSimple.
Extract structure from newtonStepTM. This extracts the TM and proves the key structural facts.
Key correctness lemma: for TM Newton step, f(c) ∈ the TM-computed fc interval. This is what allows us to use the generic contraction contradiction lemmas.