MindFormal v1.0.0One Mind

MindFormal.Tools.SecurityGrid.Enumeration

@[reducible, inline]

Count vectors for m+1 actions and denominator Q, including the last remainder coordinate. Every coordinate is nonnegative by its type.

Equations
Instances For
    @[instance_reducible]
    noncomputable instance MindFormal.Security.gridFintype (m Q : ℕ) :
    Equations

    SD29's candidate count, including the one-action case.

    noncomputable def MindFormal.Security.gridMixture {m Q : ℕ} (g : Grid m Q) :
    Fin (m + 1) → ℝ
    Equations
    Instances For
      noncomputable def MindFormal.Security.roundedCounts {m : ℕ} (Q : ℕ) (p : Fin (m + 1) → ℝ) :
      Fin (m + 1) → ℕ
      Equations
      Instances For
        theorem MindFormal.Security.floor_sum_le {m Q : ℕ} (p : Fin (m + 1) → ℝ) (hp : FiniteDecision.Probability p) :
        ∑ i : Fin m, ⌊↑Q * p i.castSucc⌋₊ ≤ Q
        noncomputable def MindFormal.Security.roundedGrid {m : ℕ} (Q : ℕ) (p : Fin (m + 1) → ℝ) (hp : FiniteDecision.Probability p) :
        Grid m Q
        Equations
        Instances For
          theorem MindFormal.Security.rounding_tv {m Q : ℕ} (p : Fin (m + 1) → ℝ) (hp : FiniteDecision.Probability p) (hQ : 1 ≤ Q) :
          tv (gridMixture (roundedGrid Q p hp)) p ≤ ↑m / ↑Q

          SD29's prescribed rounding: round down the first m coordinates, give all remaining mass to the last, and pay TV at most m/Q.

          theorem MindFormal.Security.enumeration_exists {m Q : ℕ} {B : Type u_1} [Fintype B] [Nonempty B] (pay : Fin (m + 1) → B → ℝ) :
          ∃ (g : Grid m Q), ∀ (h : Grid m Q), worst pay (gridMixture h) ≤ worst pay (gridMixture g)
          noncomputable def MindFormal.Security.enumerated {m Q : ℕ} {B : Type u_1} [Fintype B] [Nonempty B] (pay : Fin (m + 1) → B → ℝ) :
          Grid m Q

          The output of finite enumeration retaining the largest column minimum, with any fixed resolution of ties. Not a native controller.

          Equations
          Instances For
            theorem MindFormal.Security.enumeration_security {m Q : ℕ} {B : Type u_1} [Fintype B] [Nonempty B] (pay : Fin (m + 1) → B → ℝ) (hQ : 1 ≤ Q) (R : ℝ) (hR : 0 ≤ R) (oscillation : ∀ (b : B) (a c : Fin (m + 1)), |pay a b - pay c b| ≤ R) :
            value pay - R * (↑m / ↑Q) ≤ worst pay (gridMixture (enumerated pay))

            SD29: the enumerated winner loses at most R*m/Q on the supplied exact table. Real tables satisfy the same bound; rational tables permit exact finite arithmetic in a separately constructed implementation.

            theorem MindFormal.Security.grid_security {m Q : ℕ} {B : Type u_1} [Fintype B] [Nonempty B] (pay : Fin (m + 1) → B → ℝ) (hQ : 1 ≤ Q) (R : ℝ) (hR : 0 ≤ R) (oscillation : ∀ (b : B) (a c : Fin (m + 1)), |pay a b - pay c b| ≤ R) :
            Fintype.card (Grid m Q) = (Q + m).choose m ∧ (∀ (p : Fin (m + 1) → ℝ) (hp : FiniteDecision.Probability p), FiniteDecision.Probability (gridMixture (roundedGrid Q p hp)) ∧ tv (gridMixture (roundedGrid Q p hp)) p ≤ ↑m / ↑Q) ∧ FiniteDecision.Probability (gridMixture (enumerated pay)) ∧ (∀ (g : Grid m Q), worst pay (gridMixture g) ≤ worst pay (gridMixture (enumerated pay))) ∧ value pay - R * (↑m / ↑Q) ≤ worst pay (gridMixture (enumerated pay))

            The entire SD29 finite mathematical test: exact candidate count, the prescribed TV rounding for every distribution, a normalized grid winner that dominates all candidates, and its security-defect bound.