MindFormal v1.0.0One Mind

MindFormal.Tools.A640Standards.MarkError

noncomputable def MindFormal.A640Standards.MarkError.tv {M : Type u_1} [Fintype M] (p q : M → ℝ) :

Total variation of two finite mark laws, with every missing and off-menu label retained. For probabilities this is their event-distance.

Equations
Instances For
    theorem MindFormal.A640Standards.MarkError.tv_nonneg {M : Type u_1} [Fintype M] (p q : M → ℝ) :
    0 ≤ tv p q
    theorem MindFormal.A640Standards.MarkError.tv_symm {M : Type u_1} [Fintype M] (p q : M → ℝ) :
    tv p q = tv q p
    theorem MindFormal.A640Standards.MarkError.tv_triangle {M : Type u_1} [Fintype M] (p q r : M → ℝ) :
    tv p r ≤ tv p q + tv q r

    The triangle inequality retains the event-distance normalization.

    theorem MindFormal.A640Standards.MarkError.expectation {M : Type u_1} [Fintype M] (p q u : M → ℝ) {l r : ℝ} (mass : ∑ m : M, p m = ∑ m : M, q m) (hu : ∀ (m : M), l ≤ u m ∧ u m ≤ r) :

    The oscillation bound: equal-mass finite laws charge payoff range, not absolute payoff size. This is the constant used in RM1.6.

    theorem MindFormal.A640Standards.MarkError.event_mass {M : Type u_1} [Fintype M] (p q : M → ℝ) (S : Finset M) (mass : ∑ m : M, p m = ∑ m : M, q m) :
    |∑ m ∈ S, p m - ∑ m ∈ S, q m| ≤ tv p q

    RM1.6: any specified missing-mark event moves by at most TV. Thus the half-L1 definition above bounds every finite event.

    noncomputable def MindFormal.A640Standards.MarkError.push {M : Type u_1} {C : Type u_2} [Fintype M] (p : M → ℝ) (f : M → C) (c : C) :

    The finite pushforward keeps all labels, including absence.

    Equations
    Instances For
      theorem MindFormal.A640Standards.MarkError.push_mean {M : Type u_1} {C : Type u_2} [Fintype M] [Fintype C] (p : M → ℝ) (f : M → C) (u : C → ℝ) :
      FiniteDecision.mean (push p f) u = FiniteDecision.mean p fun (m : M) => u (f m)
      theorem MindFormal.A640Standards.MarkError.push_contraction {M : Type u_1} {C : Type u_2} [Fintype M] [Fintype C] (p q : M → ℝ) (f : M → C) :
      tv (push p f) (push q f) ≤ tv p q

      Taking a finite marginal does not increase total variation.

      A marginal is a probability because it is computed from the whole finite probability law. No supplied marginal law is needed.

      def MindFormal.A640Standards.MarkError.product {A : Type u_1} {C : Type u_2} [Fintype A] (p : A → C → ℝ) (s : A → C) :

      The finite independent product is computed from its marginals.

      Equations
      Instances For
        theorem MindFormal.A640Standards.MarkError.product_sum {A : Type u_1} {C : Type u_2} [Fintype A] [Fintype C] [DecidableEq A] (p : A → C → ℝ) :
        ∑ s : A → C, product p s = ∏ i : A, ∑ c : C, p i c
        theorem MindFormal.A640Standards.MarkError.product_probability {A : Type u_1} {C : Type u_2} [Fintype A] [Fintype C] (p : A → C → ℝ) (hp : ∀ (i : A), FiniteDecision.Probability (p i)) :

        Computed independent marginals form a probability.

        theorem MindFormal.A640Standards.MarkError.product_update {A : Type u_1} {C : Type u_2} [Fintype A] [Fintype C] [DecidableEq A] (p : A → C → ℝ) (q : C → ℝ) (hp : ∀ (i : A), FiniteDecision.Probability (p i)) (i : A) :
        tv (product (Function.update p i q)) (product p) = tv q (p i)

        Changing one factor has exactly that factor's variation, because all other factors have unit mass. This is the telescoping step in RM1.6.

        theorem MindFormal.A640Standards.MarkError.product_distance {A : Type u_1} {C : Type u_2} [Fintype A] [Fintype C] (p q : A → C → ℝ) (hp : ∀ (i : A), FiniteDecision.Probability (p i)) (hq : ∀ (i : A), FiniteDecision.Probability (q i)) :
        tv (product p) (product q) ≤ ∑ i : A, tv (p i) (q i)

        RM1.6's product bound, proved by changing one marginal at a time.

        theorem MindFormal.A640Standards.MarkError.marginal_product_distance {M : Type u_1} {A : Type u_2} {C : Type u_3} [Fintype M] [Fintype A] [Fintype C] (p q : M → ℝ) (f : M → A → C) (hp : FiniteDecision.Probability p) (hq : FiniteDecision.Probability q) :
        tv (product fun (i : A) => push p fun (m : M) => f m i) (product fun (i : A) => push q fun (m : M) => f m i) ≤ ↑(Fintype.card A) * tv p q

        RM1.6: the product of J actual marginals moves by at most J times the mark-law error, with every label retained in every marginal.

        theorem MindFormal.A640Standards.MarkError.product_defect {M : Type u_1} {A : Type u_2} {C : Type u_3} [Fintype M] [Fintype A] [Fintype C] (p q : M → ℝ) (f : M → A → C) (hp : FiniteDecision.Probability p) (hq : FiniteDecision.Probability q) :
        |tv (push p f) (product fun (i : A) => push p fun (m : M) => f m i) - tv (push q f) (product fun (i : A) => push q fun (m : M) => f m i)| ≤ (↑(Fintype.card A) + 1) * tv p q

        The distance from a joint law to its product marginals changes by at most (J+1) times the original finite mark-law variation.

        theorem MindFormal.A640Standards.MarkError.max_error {D : Type u_1} [Fintype D] [Nonempty D] (u v : D → ℝ) {e : ℝ} (he : ∀ (d : D), |u d - v d| ≤ e) :

        A finite supremum inherits a common bound on its entries.

        def MindFormal.A640Standards.MarkError.regret {M : Type u_1} {D : Type u_2} [Fintype M] [Fintype D] [Nonempty D] (p : M → ℝ) (u : D → M → ℝ) (stay : M → ℝ) :

        Regret against a finite list of deviations, on the stated law. For a player use u(d,s)=U(update s player d) and stay(s)=U(s).

        Equations
        Instances For
          theorem MindFormal.A640Standards.MarkError.joint_regret {M : Type u_1} {D : Type u_2} [Fintype M] [Fintype D] [Nonempty D] (p q : M → ℝ) (u : D → M → ℝ) (stay : M → ℝ) {l r : ℝ} (mass : ∑ m : M, p m = ∑ m : M, q m) (hu : ∀ (d : D) (m : M), l ≤ u d m ∧ u d m ≤ r) (hs : ∀ (m : M), l ≤ stay m ∧ stay m ≤ r) :
          |regret p u stay - regret q u stay| ≤ 2 * (r - l) * tv p q

          RM1.6: a deviation tested directly against the joint law pays twice its payoff range times TV. All payoffs, including any missing-mark extensions, must lie in the declared interval.

          theorem MindFormal.A640Standards.MarkError.product_regret {M : Type u_1} {A : Type u_2} {C : Type u_3} {D : Type u_4} [Fintype M] [Fintype A] [Fintype C] [Fintype D] [Nonempty D] (p q : M → ℝ) (f : M → A → C) (hp : FiniteDecision.Probability p) (hq : FiniteDecision.Probability q) (u : D → (A → C) → ℝ) (stay : (A → C) → ℝ) {l r Δ : ℝ} (hr : l ≤ r) (hΔ : tv p q ≤ Δ) (hu : ∀ (d : D) (s : A → C), l ≤ u d s ∧ u d s ≤ r) (hs : ∀ (s : A → C), l ≤ stay s ∧ stay s ≤ r) :
          |regret (product fun (i : A) => push p fun (m : M) => f m i) u stay - regret (product fun (i : A) => push q fun (m : M) => f m i) u stay| ≤ 2 * ↑(Fintype.card A) * (r - l) * Δ

          RM1.6's unilateral-regret bill under the computed products of J marginals: exactly 2 J range Delta. The assumption Delta bounds the two finite mark laws, not any supplied equilibrium or product law.