MindFormal v1.0.0One Mind

MindFormal.Equations.RationalMind

02.12, 02.20: a mind given as finite rational data. The instance's functions are written in one fixed language with rational coefficients: ψ = [z]₊; the drive D(u,q,v) = a·u + b·q; linear residue, presence, delivery (from the primary channels only) and response; the write gain M(z) = m₀ + Σ m·min(z, cap); linear attention and action reads; constant noise of a chosen size e > 0 times a rational loading. With the start and a piecewise schedule of polynomial inputs and binary focus, this is the general builder's data. Admission is decided by finitely many rational inequalities (RationalMind.Admissible, decidable): C1 holds for every function of the language, C2 is a finite check on the loading, C3 holds by the types. The drift is also given as a vector of expressions in the state, input and focus, equal to the admitted drift on every state with nonnegative traces.

02.20: one piece of the schedule: its duration, each content's input as a polynomial in the time since the piece began, and each content's prescribed focus.

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

    02.12, 02.20: a mind given as finite rational data: the lists naming the horizons and trace rates, every constant and every function of the instance in the fixed language, the reads, the noise loading, the start and the schedule.

    Instances For
      structure MindFormal.RationalMind.Admissible {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :

      02.12: admission of rational data, as finitely many rational inequalities: the index lists name each horizon and rate once; the constants have the signs and ranges of §1–§5 (ν, σ > 0, 0 < g < 1, 0 < β < 1, n ≥ 1, η > 0, distinct positive horizons and rates, refractory periods positive, awareness bar nonnegative, primary ⊆ sensed); the functions have their declared monotonicity (a ≥ 0 and b > 0 in the drive, presence and delivery weights nonnegative, gain floor positive and gain weights nonnegative, reads nondecreasing in activity); and C2: each activity and relation loading row and each content-horizon value block is nonzero, each trace row zero.

      Instances For
        @[instance_reducible]
        Equations
        • One or more equations did not get rendered due to their size.
        structure MindFormal.RationalMind.WellPosed {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :

        02.20: the start and the schedule are fit for a reference: a physical start; a nonempty schedule of pieces of positive duration; binary focus; each input's polynomial nonnegative over its piece (its value at the piece's start exceeds its possible travel).

        Instances For
          @[instance_reducible]
          Equations
          • One or more equations did not get rendered due to their size.

          The functions of the language, read in the reals.

          noncomputable def MindFormal.linearForm {ι : Type u_1} [Fintype ι] (c : ι → ℝ) :
          (ι → ℝ) →L[ℝ] ℝ

          02.12: the linear form Σᵢ cᵢ·xᵢ as a continuous linear map.

          Equations
          Instances For
            theorem MindFormal.linearForm_apply {ι : Type u_1} [Fintype ι] (c x : ι → ℝ) :
            (linearForm c) x = ∑ i : ι, c i * x i

            02.12: a locally Lipschitz map of a finite-dimensional space is Lipschitz on every bounded part of any set.

            theorem MindFormal.primitiveGrowth_of_lipschitz {E : Type u_1} {F : Type u_2} [NormedAddCommGroup E] [NormedAddCommGroup F] {f : E → F} {K : NNReal} (hf : LipschitzWith K f) (S : Set E) :

            02.12: a Lipschitz primitive has linear growth on any domain.

            theorem MindFormal.orthant_uniqueDiffOn (Λ : Type u_1) [Finite Λ] :
            UniqueDiffOn ℝ {r : Λ → ℝ | 0 ≤ r}

            02.12: the nonnegative orthant has unique derivatives at each of its points.

            noncomputable def MindFormal.linearRead {n : ℕ} {T : Type u_1} [Fintype T] (a : ℝ) (w : Fin n → T → ℝ) :
            ℝ × (Fin n → T → ℝ) →L[ℝ] ℝ

            02.12: a linear read of activity and value, as a continuous linear map on (x, v).

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem MindFormal.linearRead_apply {n : ℕ} {T : Type u_1} [Fintype T] (a : ℝ) (w : Fin n → T → ℝ) (z : ℝ × (Fin n → T → ℝ)) :
              (linearRead a w) z = a * z.1 + ∑ b : Fin n, ∑ t : T, w b t * z.2 b t
              noncomputable def MindFormal.RationalMind.readMap {n : ℕ} {T : Type} [Fintype T] (a : ℚ) (w : Fin n → T → ℚ) :

              02.12: a read of the language as a continuous function of the read state.

              Equations
              Instances For
                noncomputable def MindFormal.RationalMind.toInstance {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) (e : ℝ) :
                EquationInstance N n T Λ J

                02.12, 02.20: THE ADMITTED INSTANCE OF RATIONAL DATA, with constant noise of size e times the loading.

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

                  02.20: the admitted drift of rational data (it does not depend on the noise's size).

                  Equations
                  Instances For
                    theorem MindFormal.RationalMind.presence_eq {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) (e : ℝ) :
                    (D.toInstance hD e).presence = ⇑(linearForm fun (l : Λ) => ↑(D.presence l))
                    theorem MindFormal.RationalMind.residue_eq {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) (e : ℝ) :
                    (D.toInstance hD e).residue = ⇑(linearForm fun (l : Λ) => ↑(D.residue l))
                    noncomputable def MindFormal.RationalMind.deliveryMap {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :
                    (↥D.primary → ℝ) →L[ℝ] Fin n → ℝ

                    02.12: the delivery as a continuous linear map of the primary inputs.

                    Equations
                    Instances For
                      theorem MindFormal.RationalMind.delivery_eq {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) (e : ℝ) :
                      noncomputable def MindFormal.RationalMind.responseMap {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :
                      (Fin n → ℝ) →L[ℝ] Fin n → ℝ

                      02.12: the response as a continuous linear map.

                      Equations
                      Instances For
                        theorem MindFormal.RationalMind.response_eq {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) (e : ℝ) :
                        noncomputable def MindFormal.RationalMind.restrictMap {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :
                        (Fin N → ℝ) →L[ℝ] ↥D.primary → ℝ

                        02.12: the primary restriction u ↦ u_B as a continuous linear map.

                        Equations
                        Instances For
                          theorem MindFormal.RationalMind.reward_eq {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) :
                          theorem MindFormal.RationalMind.gain_lipschitz {N n : ℕ} {T Λ J : Type} [Fintype T] (D : RationalMind N n T Λ J) :
                          LocallyLipschitz fun (z : T → Fin n → ℝ) => ↑D.gainFloor + ∑ t : T, ∑ b : Fin n, ↑(D.gainWeight t b) * min (z t b) ↑D.gainCap
                          theorem MindFormal.RationalMind.gain_range {N n : ℕ} {T Λ J : Type} [Fintype T] (D : RationalMind N n T Λ J) (hD : D.Admissible) (z : T → Fin n → ℝ) (hz : 0 ≤ z) :
                          ↑D.gainFloor ≤ ↑D.gainFloor + ∑ t : T, ∑ b : Fin n, ↑(D.gainWeight t b) * min (z t b) ↑D.gainCap ∧ ↑D.gainFloor + ∑ t : T, ∑ b : Fin n, ↑(D.gainWeight t b) * min (z t b) ↑D.gainCap ≤ ↑D.gainFloor + ∑ t : T, ∑ b : Fin n, ↑(D.gainWeight t b) * ↑D.gainCap
                          theorem MindFormal.RationalMind.regular {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) :

                          02.12: C1 for the drift's primitives: every function of the language is regular on the physical domains, with the drive, delivery and response of linear growth and the gain bounded.

                          theorem MindFormal.RationalMind.readMap_properties {n : ℕ} {T : Type} [Fintype T] (a : ℚ) (w : Fin n → T → ℚ) (ha : 0 ≤ a) :
                          LipschitzWith (‖linearRead ↑a fun (b : Fin n) (t : T) => ↑(w b t)‖₊ * 1) ⇑(readMap a w) ∧ (∃ (K : ℝ), 0 ≤ K ∧ ∀ (z : NativeReadState n T), |(readMap a w) z| ≤ K * (1 + ‖↑z‖)) ∧ (∀ (v : Fin n → T → ℝ), Monotone fun (x : NNReal) => (readMap a w) ⟨(↑x, v), ⋯⟩) ∧ ReadValueMonotone ⇑(readMap a w)

                          02.12: a read of the language is Lipschitz, of linear growth, nondecreasing in activity when its activity weight is nonnegative, and monotone in each value element.

                          theorem MindFormal.RationalMind.presence_derivative_lipschitz {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) :
                          LipschitzOnBalls (fderivWithin ℝ (D.drift hD).presence {r : Λ → ℝ | 0 ≤ r}) {r : Λ → ℝ | 0 ≤ r}

                          02.12: the presence's derivative on the trace orthant is constant there, so Lipschitz on its bounded parts.

                          theorem MindFormal.RationalMind.admission {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] [Fintype J] (D : RationalMind N n T Λ J) (hD : D.Admissible) {e : ℝ} (he : 0 < e) :

                          02.12, 02.20: THE ADMISSION OF RATIONAL DATA. Every field of InstanceAdmission (C1, C2, C3 and the declared signs and orders) holds for the instance of admissible data with noise of size e > 0. The only hypotheses are the finite rational inequalities of Admissible and e > 0.

                          theorem MindFormal.RationalMind.presenceDerivative_eq {N n : ℕ} {T Λ J : Type} [Fintype T] [Fintype Λ] (D : RationalMind N n T Λ J) (hD : D.Admissible) (r : Λ → ℝ) (hr : 0 ≤ r) (l : Λ) :
                          (D.drift hD).presenceDerivative r l = ↑(D.presence l)

                          02.12: on the physical trace domain the presence derivative is the presence weight.

                          The drift as expressions in the state, input and focus.

                          @[reducible, inline]
                          abbrev MindFormal.RationalMind.Var (N n : ℕ) (T Λ : Type) :

                          02.20: the variables of the drift's expressions: the state's coordinates, then each content's input and each content's focus.

                          Equations
                          Instances For
                            def MindFormal.RationalMind.actE {N n : ℕ} {T Λ : Type} (i : Fin N) :
                            RExpr (Var N n T Λ)

                            02.20: activity x_i.

                            Equations
                            Instances For
                              def MindFormal.RationalMind.relE {N n : ℕ} {T Λ : Type} (i j : Fin N) :
                              RExpr (Var N n T Λ)

                              02.20: relation W_ij.

                              Equations
                              Instances For
                                def MindFormal.RationalMind.valE {N n : ℕ} {T Λ : Type} (i : Fin N) (b : Fin n) (t : T) :
                                RExpr (Var N n T Λ)

                                02.20: value v_i(t)_b.

                                Equations
                                Instances For
                                  def MindFormal.RationalMind.trE {N n : ℕ} {T Λ : Type} (i : Fin N) (l : Λ) :
                                  RExpr (Var N n T Λ)

                                  02.20: trace r_i(l).

                                  Equations
                                  Instances For
                                    def MindFormal.RationalMind.inpE {N n : ℕ} {T Λ : Type} (i : Fin N) :
                                    RExpr (Var N n T Λ)

                                    02.20: input u_i.

                                    Equations
                                    Instances For
                                      def MindFormal.RationalMind.focE {N n : ℕ} {T Λ : Type} (i : Fin N) :
                                      RExpr (Var N n T Λ)

                                      02.20: focus q_i.

                                      Equations
                                      Instances For
                                        def MindFormal.RationalMind.predictionE {N n : ℕ} {T Λ : Type} (i : Fin N) :
                                        RExpr (Var N n T Λ)

                                        02.20: the prediction Σ_l W_il x_l.

                                        Equations
                                        Instances For
                                          def MindFormal.RationalMind.driveE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (i : Fin N) :
                                          RExpr (Var N n T Λ)

                                          02.20: the drive a·u_i + b·q_i.

                                          Equations
                                          Instances For
                                            def MindFormal.RationalMind.residueE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (i : Fin N) :
                                            RExpr (Var N n T Λ)

                                            02.20: the residue Σ_l ϱ_l r_i(l).

                                            Equations
                                            Instances For
                                              def MindFormal.RationalMind.presenceE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (j : Fin N) :
                                              RExpr (Var N n T Λ)

                                              02.20: the presence c(r_j) = Σ_l γ_l r_j(l).

                                              Equations
                                              Instances For
                                                def MindFormal.RationalMind.presenceRateE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (j : Fin N) :
                                                RExpr (Var N n T Λ)

                                                02.20: the presence's rate of change along D4, Σ_l γ_l λ_l (x_j − r_j(l)).

                                                Equations
                                                Instances For
                                                  def MindFormal.RationalMind.transformedE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (i : Fin N) :
                                                  RExpr (Var N n T Λ)

                                                  02.20: the transformed input ψ(I_i) = [D + R + Σ W x]₊.

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

                                                    02.20: the pool σ + Σ_j ψ(I_j).

                                                    Equations
                                                    Instances For
                                                      def MindFormal.RationalMind.targetE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (i : Fin N) :
                                                      RExpr (Var N n T Λ)

                                                      02.20: the normalized target [ψ(I_i)/P − g]₊.

                                                      Equations
                                                      Instances For
                                                        def MindFormal.RationalMind.rewardE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (b : Fin n) :
                                                        RExpr (Var N n T Λ)

                                                        02.20: the delivery from the primary channels, element b.

                                                        Equations
                                                        Instances For
                                                          def MindFormal.RationalMind.residualE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (t : T) (b : Fin n) :
                                                          RExpr (Var N n T Λ)

                                                          02.20: the value surprise δ(t)_b.

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

                                                            02.20: the write gain M(|δ|).

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              def MindFormal.RationalMind.driftE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) :
                                                              CoordinateIndex (Fin N) n T Λ → RExpr (Var N n T Λ)

                                                              02.20: THE DRIFT AS EXPRESSIONS, one per coordinate: II's two writers times the gain, I's relaxation to the normalized target, III's presence-gated response, D4's traces.

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

                                                                02.20: every state coordinate, listed.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For

                                                                  02.20: every input and focus variable, listed.

                                                                  Equations
                                                                  Instances For
                                                                    theorem MindFormal.RationalMind.mem_stateVars {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) (hD : D.Admissible) (c : CoordinateIndex (Fin N) n T Λ) :
                                                                    theorem MindFormal.RationalMind.listSum_finRange {m : ℕ} (f : Fin m → ℝ) :
                                                                    (List.map f (List.finRange m)).sum = ∑ i : Fin m, f i
                                                                    theorem MindFormal.RationalMind.eval_presenceE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (j : Fin N) :
                                                                    theorem MindFormal.RationalMind.eval_residueE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (i : Fin N) :
                                                                    theorem MindFormal.RationalMind.eval_predictionE {N n : ℕ} {T Λ : Type} (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (i : Fin N) :
                                                                    theorem MindFormal.RationalMind.eval_presenceRateE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (hs : ∀ (i : Fin N) (l : Λ), 0 ≤ mindTrace s i l) (j : Fin N) :
                                                                    theorem MindFormal.RationalMind.eval_transformedE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (i : Fin N) :
                                                                    theorem MindFormal.RationalMind.eval_targetE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (i : Fin N) :
                                                                    theorem MindFormal.RationalMind.eval_rewardE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (b : Fin n) :
                                                                    RExpr.eval (Sum.elim s (Sum.elim u q)) (D.rewardE b) = (D.drift hD).reward u b
                                                                    theorem MindFormal.RationalMind.eval_residualE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (hs : ∀ (i : Fin N) (l : Λ), 0 ≤ mindTrace s i l) (t : T) (b : Fin n) :
                                                                    RExpr.eval (Sum.elim s (Sum.elim u q)) (D.residualE t b) = assembledResidual (D.drift hD) u s t b
                                                                    theorem MindFormal.RationalMind.eval_gainE {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (hs : ∀ (i : Fin N) (l : Λ), 0 ≤ mindTrace s i l) :
                                                                    RExpr.eval (Sum.elim s (Sum.elim u q)) D.gainE = (D.drift hD).gain fun (t : T) (b : Fin n) => |assembledResidual (D.drift hD) u s t b|
                                                                    theorem MindFormal.RationalMind.drift_eval {N n : ℕ} {T Λ J : Type} (D : RationalMind N n T Λ J) [Fintype T] [Fintype Λ] (hD : D.Admissible) (u q : Fin N → ℝ) (s : MindState (Fin N) n T Λ) (hs : ∀ (i : Fin N) (l : Λ), 0 ≤ mindTrace s i l) (c : CoordinateIndex (Fin N) n T Λ) :
                                                                    assembledDrift (D.drift hD) u q s c = RExpr.eval (Sum.elim s (Sum.elim u q)) (D.driftE c)

                                                                    02.20: THE REPRESENTATION. On every state whose traces are nonnegative, each coordinate of the admitted drift of rational data equals its expression read at the input, focus and state.