MindFormal v1.0.0One Mind

MindFormal.Run.RationalEnclosure

02.20: the general builder's certificate for a mind given as rational data. One piece of the certificate for each piece of the schedule: a polynomial approximate path, the tube's width, the claimed defect bound, Lipschitz constant, start distance and tube radius. The checker runs the piece checker on the drift's expressions, bounds Grönwall's factor by a rational upper bound for the exponential, and checks the start, the physical path, the room and the carry between pieces, all by rational arithmetic. A certificate that checks gives every hypothesis of the enclosure theorem, so any verified reference of a drift the data represents, with the data's start, its focus and its input within the tolerance, lies within each piece's radius of the approximate path.

def MindFormal.RationalMind.pieceAt {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (k : ℕ) :

02.20: the schedule's piece k (a zero piece past the end).

Equations
Instances For
    def MindFormal.RationalMind.breaks {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (k : ℕ) :

    02.20: the time at which the schedule's piece k begins.

    Equations
    Instances For
      theorem MindFormal.RationalMind.breaks_zero {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :
      D.breaks 0 = 0
      theorem MindFormal.RationalMind.breaks_succ {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) {k : ℕ} (hk : k < D.schedule.length) :
      D.breaks (k + 1) = D.breaks k + (D.pieceAt k).dur
      structure MindFormal.RationalMind.CertPiece (N n : ℕ) (T Λ : Type) :

      02.20: one piece of a certificate: the approximate path's polynomials in the time since the piece began, the tube's width r, the claimed defect bound ε, Lipschitz constant K, tube radius ρ and distance δ at the piece's start, and the grid's number of cells M.

      Instances For
        structure MindFormal.RationalMind.Certificate (N n : ℕ) (T Λ : Type) :

        02.20: a certificate: the input tolerance η and one piece for each piece of the schedule.

        Instances For
          def MindFormal.RationalMind.Certificate.at {N n : ℕ} {T Λ : Type} (C : Certificate N n T Λ) (k : ℕ) :
          CertPiece N n T Λ

          02.20: the certificate's piece k (a zero piece past the end).

          Equations
          Instances For
            def MindFormal.RationalMind.floored {N n : ℕ} {T Λ : Type} :
            CoordinateIndex (Fin N) n T Λ → Bool

            02.20: the coordinates the floor acts on: activities and traces.

            Equations
            Instances For
              def MindFormal.RationalMind.pieceData {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) :
              PieceData (CoordinateIndex (Fin N) n T Λ) (Fin N ⊕ Fin N)

              02.20: the piece checker's data for piece k: the schedule's duration, input and focus, and the certificate's path, width, tolerance, constants and grid.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def MindFormal.RationalMind.pieceCheck {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) :

                02.20: the checks on piece k: the piece checker on the drift's expressions; K > 0 with Kh ≤ 1 and the Grönwall bound with the exponential's rational upper bound at most ρ; ρ below the width; the path's activities and traces nonnegative over the piece; and, before the last piece, ρ plus the jump to the next piece's path at most the next δ.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def MindFormal.RationalMind.check {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) :

                  02.20: THE CERTIFICATE CHECKER, by rational arithmetic only: one certificate piece for each schedule piece, a nonnegative tolerance, the data's start within δ₀ of the first piece's path, and every piece's checks.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def MindFormal.RationalMind.approx {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) (t : ℝ) :
                    MindState (Fin N) n T Λ

                    02.20: the approximate path of piece k at real time t.

                    Equations
                    Instances For
                      noncomputable def MindFormal.RationalMind.approxVel {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) (t : ℝ) :
                      MindState (Fin N) n T Λ

                      02.20: its derivative.

                      Equations
                      Instances For
                        def MindFormal.RationalMind.Represents {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (d : MindDriftData (Fin N) n T Λ) :

                        02.20: rational data represent a drift when, on every state with nonnegative traces, each coordinate of the drift is its expression read at the input, focus and state.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem MindFormal.RationalMind.represents_drift {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) :
                          D.Represents (D.drift hD)

                          02.20: admissible data represent their own drift.

                          theorem MindFormal.RationalMind.approx_hasDerivAt {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) (t : ℝ) :
                          HasDerivAt (D.approx C k) (D.approxVel C k t) t
                          theorem MindFormal.RationalMind.approx_continuous {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) :
                          theorem MindFormal.RationalMind.pieceCheck_spec {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) {C : Certificate N n T Λ} {k : ℕ} (h : D.pieceCheck C k = true) :
                          (D.pieceData C k).check D.stateVars paramVars D.driftE = true ∧ 0 < (C.at k).K ∧ (C.at k).K * (D.pieceAt k).dur ≤ 1 ∧ 0 ≤ (C.at k).δ ∧ (C.at k).δ * expUpper ((C.at k).K * (D.pieceAt k).dur) + (C.at k).ε / (C.at k).K * (expUpper ((C.at k).K * (D.pieceAt k).dur) - 1) ≤ (C.at k).ρ ∧ (C.at k).ρ < (C.at k).r ∧ (∀ v ∈ D.stateVars, floored v = true → pabs (pderiv ((C.at k).path v)) (D.pieceAt k).dur * (D.pieceAt k).dur ≤ qeval ((C.at k).path v) 0) ∧ (k + 1 < D.schedule.length → (C.at k).ρ ≤ (C.at (k + 1)).δ ∧ ∀ v ∈ D.stateVars, (C.at k).ρ + |qeval ((C.at k).path v) (D.pieceAt k).dur - qeval ((C.at (k + 1)).path v) 0| ≤ (C.at (k + 1)).δ)

                          02.20: what a passing piece check gives.

                          theorem MindFormal.RationalMind.pieceData_h {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) :
                          (D.pieceData C k).h = (D.pieceAt k).dur
                          structure MindFormal.RationalMind.Certified {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (C : Certificate N n T Λ) {d : MindDriftData (Fin N) n T Λ} {H : NNReal} (R : LearningReference d H) :

                          02.20: what a certificate needs of a reference. The data are admissible and represent the drift d, whose coefficients are physical C1; the certificate checks; R is a verified reference of d on [0,H] with H at least the schedule's length, starting at the data's start, with the schedule's focus on each piece, and an input continuous on each piece and within the certificate's tolerance η of the schedule's input.

                          Instances For
                            theorem MindFormal.RationalMind.certificate_enclosure {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] {C : Certificate N n T Λ} {d : MindDriftData (Fin N) n T Λ} {H : NNReal} {R : LearningReference d H} (hR : D.Certified C R) (k : ℕ) :
                            k < D.schedule.length → ∀ t ∈ Set.Icc ↑(D.breaks k) ↑(D.breaks (k + 1)), ‖(ContinuousMap.IccExtend ⋯ R.path) t - D.approx C k t‖ ≤ ↑(C.at k).ρ

                            02.20: THE THEOREM FROM A CHECKED CERTIFICATE TO THE TUBE. If the certificate checks and the reference meets Certified (admissible data representing its drift, the data's start, the schedule's focus, its input within η of the schedule's), then on each piece k, at every time t of [τ_k, τ_{k+1}], the reference is within the certificate's radius ρ_k of the approximate path.

                            def MindFormal.RationalMind.lowerAt {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) (v : CoordinateIndex (Fin N) n T Λ) :

                            02.20: the lowest value piece k's path reaches over the piece, less the radius.

                            Equations
                            Instances For
                              def MindFormal.RationalMind.upperAt {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) (v : CoordinateIndex (Fin N) n T Λ) :

                              02.20: the highest value piece k's path reaches over the piece, plus the radius.

                              Equations
                              Instances For
                                def MindFormal.RationalMind.normAt {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (C : Certificate N n T Λ) (k : ℕ) :

                                02.20: a bound on the state's norm over piece k, from the lowest and highest values.

                                Equations
                                Instances For
                                  theorem MindFormal.RationalMind.exists_piece {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) {t : ℝ} (ht : t ∈ Set.Icc 0 ↑(D.breaks D.schedule.length)) (hm : 0 < D.schedule.length) :
                                  ∃ k < D.schedule.length, t ∈ Set.Icc ↑(D.breaks k) ↑(D.breaks (k + 1))

                                  02.20: every time of [0, τ_m] lies in some piece.

                                  theorem MindFormal.RationalMind.certificate_margins {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] {C : Certificate N n T Λ} {d : MindDriftData (Fin N) n T Λ} {H : NNReal} {R : LearningReference d H} (hR : D.Certified C R) (k : ℕ) :
                                  k < D.schedule.length → (∀ t ∈ Set.Icc ↑(D.breaks k) ↑(D.breaks (k + 1)), ∀ (v : CoordinateIndex (Fin N) n T Λ), ↑(D.lowerAt C k v) ≤ (ContinuousMap.IccExtend ⋯ R.path) t v ∧ (ContinuousMap.IccExtend ⋯ R.path) t v ≤ ↑(D.upperAt C k v)) ∧ (∀ t ∈ Set.Icc ↑(D.breaks k) ↑(D.breaks (k + 1)), ‖(ContinuousMap.IccExtend ⋯ R.path) t‖ ≤ ↑(D.normAt C k)) ∧ ∀ (v : CoordinateIndex (Fin N) n T Λ), |(ContinuousMap.IccExtend ⋯ R.path) (↑(D.breaks (k + 1))) v - ↑(qeval ((C.at k).path v) (D.pieceAt k).dur)| ≤ ↑(C.at k).ρ

                                  02.20: THE RANGE MARGINS. Under Certified, on each piece every coordinate of the reference lies between the piece's lowest and highest values, and the reference's norm is at most normAt; at the piece's end each coordinate is within ρ_k of the path's end value.

                                  The data's own reference: the schedule read as an input and a focus, and the reference built from the data alone.

                                  noncomputable def MindFormal.RationalMind.schedRead {N : ℕ} (f : SchedulePiece N → ℝ → Fin N → ℝ) :
                                  List (SchedulePiece N) → ℝ → ℝ → Fin N → ℝ

                                  02.20: the schedule read at time t from a start time a: piece p's value f p (t − a) before a + p.dur, then the rest of the schedule; zero past its end.

                                  Equations
                                  Instances For
                                    noncomputable def MindFormal.RationalMind.inputRead {N : ℕ} (p : SchedulePiece N) (x : ℝ) :
                                    Fin N → ℝ

                                    02.20: the schedule's input: each piece's polynomials.

                                    Equations
                                    Instances For
                                      noncomputable def MindFormal.RationalMind.focusRead {N : ℕ} (p : SchedulePiece N) :
                                      ℝ → Fin N → ℝ

                                      02.20: the schedule's focus: each piece's constant.

                                      Equations
                                      Instances For
                                        theorem MindFormal.RationalMind.schedRead_measurable {N : ℕ} (f : SchedulePiece N → ℝ → Fin N → ℝ) (hf : ∀ (p : SchedulePiece N), Continuous (f p)) (L : List (SchedulePiece N)) (a : ℝ) :
                                        theorem MindFormal.RationalMind.schedRead_cases {N : ℕ} (f : SchedulePiece N → ℝ → Fin N → ℝ) (L : List (SchedulePiece N)) {a t : ℝ} (hat : a ≤ t) :
                                        schedRead f L a t = 0 ∨ ∃ p ∈ L, ∃ (x : ℝ), 0 ≤ x ∧ x < ↑p.dur ∧ schedRead f L a t = f p x
                                        theorem MindFormal.RationalMind.schedRead_piece {N : ℕ} (f : SchedulePiece N → ℝ → Fin N → ℝ) (L : List (SchedulePiece N)) (hL : ∀ p ∈ L, 0 < p.dur) {k : ℕ} (hk : k < L.length) {a t : ℝ} (ht : t ∈ Set.Ico (a + (List.map (fun (p : SchedulePiece N) => ↑p.dur) (List.take k L)).sum) (a + (List.map (fun (p : SchedulePiece N) => ↑p.dur) (List.take (k + 1) L)).sum)) :
                                        schedRead f L a t = f L[k] (t - (a + (List.map (fun (p : SchedulePiece N) => ↑p.dur) (List.take k L)).sum))
                                        theorem MindFormal.RationalMind.physicalRegular {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) :

                                        02.20: admissible data have physical C1 coefficients.

                                        theorem MindFormal.RationalMind.breaks_cast {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (k : ℕ) :
                                        ↑(D.breaks k) = (List.map (fun (p : SchedulePiece N) => ↑p.dur) (List.take k D.schedule)).sum
                                        def MindFormal.RationalMind.horizon {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (hW : D.WellPosed) :

                                        02.20: the horizon of well-posed data: the schedule's total duration.

                                        Equations
                                        Instances For

                                          02.20: a bound on one piece's input.

                                          Equations
                                          Instances For
                                            def MindFormal.RationalMind.inputBound {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :

                                            02.20: a bound on the schedule's input.

                                            Equations
                                            Instances For
                                              theorem MindFormal.RationalMind.schedRead_focus_binary {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (hW : D.WellPosed) {t : ℝ} (ht : 0 ≤ t) (i : Fin N) :
                                              noncomputable def MindFormal.RationalMind.reference {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (hW : D.WellPosed) :

                                              02.20: THE DATA'S OWN REFERENCE: the unique physical solution, on the schedule's horizon, of the admitted drift of the data from their start, under the schedule's input and focus, with no noise. Nothing but the data and their admission and well-posedness is used.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem MindFormal.RationalMind.schedRead_on_piece {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (f : SchedulePiece N → ℝ → Fin N → ℝ) (hW : D.WellPosed) {k : ℕ} (hk : k < D.schedule.length) {t : ℝ} (ht : t ∈ Set.Ico ↑(D.breaks k) ↑(D.breaks (k + 1))) :
                                                schedRead f D.schedule 0 t = f (D.pieceAt k) (t - ↑(D.breaks k))
                                                theorem MindFormal.RationalMind.reference_enclosure {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (hW : D.WellPosed) {C : Certificate N n T Λ} (hC : D.check C = true) (k : ℕ) :
                                                k < D.schedule.length → ∀ t ∈ Set.Icc ↑(D.breaks k) ↑(D.breaks (k + 1)), ‖(ContinuousMap.IccExtend ⋯ (D.reference hD hW).path) t - D.approx C k t‖ ≤ ↑(C.at k).ρ

                                                02.20: THE DATA'S OWN REFERENCE LIES IN THE TUBE. For admissible, well-posed data and a certificate that checks, the data's own reference is within ρ_k of the approximate path on each piece k.