Documentation

LeanCert.Engine.RootFinding.Krawczyk

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
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def LeanCert.Engine.finEnv {n : ℕ} (x : Fin n → ℝ) :
      ℕ → ℝ
      Equations
      Instances For
        noncomputable def LeanCert.Engine.evalFin {n : ℕ} (e : Core.Expr) (x : Fin n → ℝ) :
        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 → ℝ
          Equations
          Instances For
            noncomputable def LeanCert.Engine.jacobianAt {n : ℕ} (F : Fin n → Core.Expr) (x : Fin n → ℝ) :
            Matrix (Fin n) (Fin n) ℝ
            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)
              def LeanCert.Engine.FinBoxMem {n : ℕ} (x : Fin n → ℝ) (X : Fin n → Core.IntervalRat) :
              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 → ℝ
                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 → ℝ
                  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 → ℝ) :
                    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
                    Equations
                    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) :
                      ∑ 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
                      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) :
                      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) :
                      Equations
                      Instances For
                        def LeanCert.Engine.boxRadius {n : ℕ} (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) :
                        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)
                          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 := { }) :
                            Equations
                            • One or more equations did not get rendered due to their size.
                            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)
                              Instances For
                                def LeanCert.Engine.centerInside {n : ℕ} (X : Fin n → Core.IntervalRat) (m : Fin n → ℚ) :
                                Equations
                                Instances For
                                  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
                                    def LeanCert.Engine.SystemZero {n : ℕ} (F : Fin n → Core.Expr) (x : Fin n → ℝ) :
                                    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) :