MindFormal v1.0.0One Mind

MindFormal.Tools.PieceCertificate

02.20: one piece of a certificate for a differential equation whose field is a vector of expressions in the state and some parameters. On [0,h] the approximate path and the parameters are polynomials with rational coefficients. The checker computes, by rational arithmetic only, a box holding every state within r of the path and every parameter within η of its polynomial; each field coordinate's Lipschitz constant on that box; and the defect at the M+1 points of a uniform grid, with the change between neighboring points bounded by the polynomials' slopes and curvatures. Its soundness theorem gives the two hypotheses of the enclosure theorem on the piece: the defect is at most ε at every time, and the field is K-Lipschitz on the tube of width r. No mind.

def MindFormal.listMax {α : Type u_1} (L : List α) (f : α → ℚ) :

02.20: the largest value of f over a list, and at least zero.

Equations
Instances For
    theorem MindFormal.le_listMax {α : Type u_1} {L : List α} {f : α → ℚ} {a : α} (ha : a ∈ L) :
    f a ≤ listMax L f
    theorem MindFormal.listMax_nonneg {α : Type u_1} (L : List α) (f : α → ℚ) :
    0 ≤ listMax L f
    structure MindFormal.PieceData (S P : Type u) :

    02.20: the data of one piece: its length h, the tube's width r, the parameters' tolerance η, the claimed Lipschitz constant K and defect bound ε, the grid's number of cells M, and the path's and parameters' polynomials in the time since the piece began.

    Instances For
      def MindFormal.PieceData.travel {S P : Type u} (d : PieceData S P) (cs : List ℚ) :

      02.20: how far a polynomial can move over [0,h].

      Equations
      Instances For
        def MindFormal.PieceData.box {S P : Type u} (d : PieceData S P) :
        S ⊕ P → ℚ × ℚ

        02.20: the box: each state variable within its path's travel plus r of the path's start, each parameter within its travel plus η of its start.

        Equations
        Instances For
          def MindFormal.PieceData.env {S P : Type u} (d : PieceData S P) (x : ℚ) :
          S ⊕ P → ℚ

          02.20: the variables' values at a rational time of the piece.

          Equations
          Instances For
            def MindFormal.PieceData.defect {S P : Type u} (d : PieceData S P) (F : S → RExpr (S ⊕ P)) (c : S) (x : ℚ) :

            02.20: the defect of field coordinate c at a rational time: the path's derivative minus the field at the path and the parameters.

            Equations
            Instances For
              def MindFormal.PieceData.slope {S P : Type u} (d : PieceData S P) (Svars : List S) (Pvars : List P) :

              02.20: a bound on every variable's speed over the piece.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def MindFormal.PieceData.curve {S P : Type u} (d : PieceData S P) (Svars : List S) :

                02.20: a bound on every path coordinate's curvature over the piece.

                Equations
                Instances For
                  def MindFormal.PieceData.check {S P : Type u} (d : PieceData S P) (Svars : List S) (Pvars : List P) (F : S → RExpr (S ⊕ P)) :

                  02.20: THE PIECE CHECKER, by rational arithmetic only. Each field coordinate is defined on the box with Lipschitz constant at most K; at each grid cell [x_j, x_{j+1}] the mean of the two end defects plus half the cell's possible change, plus K·η for the parameters' tolerance, is at most ε.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def MindFormal.PieceData.pathR {S P : Type u} (d : PieceData S P) (x : ℝ) :
                    S → ℝ

                    02.20: the path read in the reals at local time x.

                    Equations
                    Instances For
                      noncomputable def MindFormal.PieceData.velR {S P : Type u} (d : PieceData S P) (x : ℝ) :
                      S → ℝ

                      02.20: the path's derivative at local time x.

                      Equations
                      Instances For
                        noncomputable def MindFormal.PieceData.paramR {S P : Type u} (d : PieceData S P) (x : ℝ) :
                        P → ℝ

                        02.20: the parameters' polynomials at local time x.

                        Equations
                        Instances For
                          noncomputable def MindFormal.fieldR {S P : Type u} (F : S → RExpr (S ⊕ P)) (π : P → ℝ) (z : S → ℝ) :
                          S → ℝ

                          02.20: the field read in the reals, at parameters π and state z.

                          Equations
                          Instances For
                            theorem MindFormal.PieceData.inBox {S P : Type u} (d : PieceData S P) {x : ℝ} (hx : x ∈ Set.Icc 0 ↑d.h) (z : S → ℝ) (π : P → ℝ) (hz : ∀ (v : S), |z v - d.pathR x v| ≤ ↑d.r) (hπ : ∀ (v : P), |π v - d.paramR x v| ≤ ↑d.η) :

                            02.20: at every time of the piece, a state within r of the path and parameters within η of theirs lie in the box.

                            theorem MindFormal.PieceData.check_sound {S P : Type u} (d : PieceData S P) [Fintype S] {Svars : List S} {Pvars : List P} {F : S → RExpr (S ⊕ P)} (hS : ∀ (v : S), v ∈ Svars) (hP : ∀ (v : P), v ∈ Pvars) (hc : d.check Svars Pvars F = true) :
                            (∀ x ∈ Set.Icc 0 ↑d.h, ∀ (π : P → ℝ), (∀ (v : P), |π v - d.paramR x v| ≤ ↑d.η) → ‖d.velR x - fieldR F π (d.pathR x)‖ ≤ ↑d.ε) ∧ ∀ x ∈ Set.Icc 0 ↑d.h, ∀ (π : P → ℝ), (∀ (v : P), |π v - d.paramR x v| ≤ ↑d.η) → LipschitzOnWith (↑d.K).toNNReal (fieldR F π) {z : S → ℝ | ‖z - d.pathR x‖ ≤ ↑d.r}

                            02.20: soundness of the piece checker. If it passes (with lists that name every state variable and every parameter), then at every time x of the piece and for parameters π within η of their polynomials: the path's defect against the field is at most ε, and the field is K-Lipschitz on the tube of width r around the path.