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]
Equations
Instances For
@[instance_reducible]
Equations
Instances For
@[instance_reducible]
Equations
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
theorem
LeanCert.Engine.evalFin_differentiable
{n : ℕ}
(e : Core.Expr)
(h : ADSupported e)
:
Differentiable ℝ (evalFin e)
Equations
- LeanCert.Engine.systemEval F x i = LeanCert.Engine.evalFin (F i) x
Instances For
theorem
LeanCert.Engine.systemEval_differentiable
{n : ℕ}
(F : Fin n → Core.Expr)
(h : ∀ (i : Fin n), ADSupported (F i))
:
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)
:
Equations
- LeanCert.Engine.finBoxEnv X i = if h : i < n then X ⟨i, h⟩ else LeanCert.Core.IntervalRat.singleton 0
Instances For
Equations
- LeanCert.Engine.FinBoxMem x X = ∀ (i : Fin n), x i ∈ X i
Instances For
def
LeanCert.Engine.intervalJacobian
{n : ℕ}
(F : Fin n → Core.Expr)
(X : Fin n → Core.IntervalRat)
(cfg : EvalConfig := { })
:
Matrix (Fin n) (Fin n) Core.IntervalRat
Equations
- LeanCert.Engine.intervalJacobian F X cfg i j = LeanCert.Engine.Optimization.derivIntervalCoreN (F i) (LeanCert.Engine.finBoxEnv X) (↑j) cfg
Instances For
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)
:
theorem
LeanCert.Engine.newtonMap_differentiable
{n : ℕ}
(Y : Matrix (Fin n) (Fin n) ℝ)
(F : Fin n → Core.Expr)
(h : ∀ (i : Fin n), ADSupported (F i))
:
Differentiable ℝ (newtonMap Y F)
Equations
- LeanCert.Engine.finBoxSet X = {x : Fin n → ℝ | LeanCert.Engine.FinBoxMem x X}
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)
:
Equations
- LeanCert.Engine.intervalIdentity i j = LeanCert.Core.IntervalRat.singleton (if i = j then 1 else 0)
Instances For
def
LeanCert.Engine.ratMulInterval
{n : ℕ}
(Y : Matrix (Fin n) (Fin n) ℚ)
(J : Matrix (Fin n) (Fin n) Core.IntervalRat)
:
Matrix (Fin n) (Fin n) Core.IntervalRat
Equations
- LeanCert.Engine.ratMulInterval Y J i j = ∑ k : Fin n, LeanCert.Core.IntervalRat.scale (Y i k) (J k j)
Instances For
def
LeanCert.Engine.preconditionedJacobian
{n : ℕ}
(Y : Matrix (Fin n) (Fin n) ℚ)
(J : Matrix (Fin n) (Fin n) Core.IntervalRat)
:
Matrix (Fin n) (Fin n) Core.IntervalRat
Equations
- LeanCert.Engine.preconditionedJacobian Y J i j = (LeanCert.Engine.intervalIdentity i j).sub (LeanCert.Engine.ratMulInterval Y J i j)
Instances For
theorem
LeanCert.Engine.mem_interval_sum
{ι : Type u_1}
[Fintype ι]
(s : Finset ι)
(x : ι → ℝ)
(I : ι → Core.IntervalRat)
(h : ∀ i ∈ s, x i ∈ I i)
:
Instances For
def
LeanCert.Engine.intervalMatrixRowBound
{n : ℕ}
(A : Matrix (Fin n) (Fin n) Core.IntervalRat)
(i : Fin n)
:
Equations
- LeanCert.Engine.intervalMatrixRowBound A i = ∑ j : Fin n, LeanCert.Engine.intervalAbsBound (A i j)
Instances For
Equations
- LeanCert.Engine.intervalMatrixBound A = List.foldl max 0 (List.ofFn fun (i : Fin n) => LeanCert.Engine.intervalMatrixRowBound A i)
Instances For
theorem
LeanCert.Engine.intervalMatrixRowBound_le_bound
{n : ℕ}
(A : Matrix (Fin n) (Fin n) Core.IntervalRat)
(i : Fin n)
:
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)
:
‖fderiv ℝ (newtonMap (Y.map fun (q : ℚ) => ↑q) F) x‖ ≤ ↑(intervalMatrixBound (preconditionedJacobian Y (intervalJacobian F X cfg)))
Equations
- LeanCert.Engine.pointIntervalEnv m i = if h : i < n then LeanCert.Core.IntervalRat.singleton (m ⟨i, h⟩) else LeanCert.Core.IntervalRat.singleton 0
Instances For
def
LeanCert.Engine.pointEvalIntervals
{n : ℕ}
(F : Fin n → Core.Expr)
(m : Fin n → ℚ)
(cfg : EvalConfig := { })
:
Fin n → Core.IntervalRat
Equations
- LeanCert.Engine.pointEvalIntervals F m cfg i = LeanCert.Internal.Rational.evalTotalCore (F i) (LeanCert.Engine.pointIntervalEnv m) cfg
Instances For
def
LeanCert.Engine.intervalRatMatVec
{n : ℕ}
(Y : Matrix (Fin n) (Fin n) ℚ)
(v : Fin n → Core.IntervalRat)
:
Fin n → Core.IntervalRat
Equations
- LeanCert.Engine.intervalRatMatVec Y v i = ∑ j : Fin n, LeanCert.Core.IntervalRat.scale (Y i j) (v j)
Instances For
def
LeanCert.Engine.newtonCenterInterval
{n : ℕ}
(F : Fin n → Core.Expr)
(m : Fin n → ℚ)
(Y : Matrix (Fin n) (Fin n) ℚ)
(cfg : EvalConfig := { })
:
Fin n → Core.IntervalRat
Equations
- LeanCert.Engine.newtonCenterInterval F m Y cfg i = (LeanCert.Core.IntervalRat.singleton (m i)).sub (LeanCert.Engine.intervalRatMatVec Y (LeanCert.Engine.pointEvalIntervals F m cfg) i)
Instances For
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)
:
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)
:
Equations
- LeanCert.Engine.boxRadius X m = List.foldl max 0 (List.ofFn fun (i : Fin n) => LeanCert.Engine.coordinateRadius X m i)
Instances For
theorem
LeanCert.Engine.coordinateRadius_le_boxRadius
{n : ℕ}
(X : Fin n → Core.IntervalRat)
(m : Fin n → ℚ)
(i : Fin n)
:
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 := { })
:
Fin n → Core.IntervalRat
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
theorem
LeanCert.Engine.intervalStrictInside_sound
{I X : Core.IntervalRat}
(h : intervalStrictInside I X = true)
(x : ℝ)
:
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)
:
@[instance_reducible]
instance
LeanCert.Engine.instDecidableCenterInside
{n : ℕ}
(X : Fin n → Core.IntervalRat)
(m : Fin n → ℚ)
:
Decidable (centerInside X m)
Equations
def
LeanCert.Engine.krawczykCheck
{n : ℕ}
(F : Fin n → Core.Expr)
(X : Fin n → Core.IntervalRat)
(cert : KrawczykCert n)
(cfg : EvalConfig := { })
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LeanCert.Engine.SystemZero F x = ∀ (i : Fin n), LeanCert.Engine.evalFin (F i) x = 0
Instances For
theorem
LeanCert.Engine.centerInside_sound
{n : ℕ}
{X : Fin n → Core.IntervalRat}
{m : Fin n → ℚ}
(h : centerInside X m)
:
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)
: