Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Definitions for The statistical strength of nonlocality proofs

Definition
QAlgorithms_Papers_Independent_Intakethird100_P80

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The objects the formalized statements of The statistical strength of nonlocality proofs (arXiv:quant-ph/0307125) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • BellExperiment: PDF pp.4,16: nonempty finite parties, settings, and setting-dependent outcomes.
  • Settings
  • MeasuredOutcomes
  • Potential
  • Table
  • Sigma
  • PiLocal
  • potentialAtSetting: PDF pp.5,16: measuring a setting selects coordinates of ONE potential assignment.
  • localTable: PDF pp.5,16: the measured marginal of a full potential-outcome law.
  • localTensorEffect: PDF p.16: coefficient tensor product of the local measurement effects.
  • QuantumGenerated: PDF pp.4–5,16: a fixed finite quantum realization, with normalized shared density matrix and local POVMs. This witnesses quantum generation; it is never optimized in a strength.
  • MarginalConsistency: PDF pp.5,31: every subset marginal is independent of the other parties' settings. Natural coordinate values allow comparison across dependent outcome alphabets.
  • NonlocalityProof: PDF pp.4–5,16,31: quantum table with its probability and no-signalling invariants exposed. Properness is a separate predicate, so local quantum tables remain admissible.
  • Proper: PDF pp.5,16: no single local potential-outcome law reproduces every setting.
  • uniformSettings: PDF p.8: computed uniform setting weights. All setting alphabets are nonempty.
  • Uncorrelated: PDF pp.5,8: products of normalized local setting laws, including point masses.
  • PositiveCoordinates: PDF pp.12,33: relative simplex interior, not ambient interior.
  • kl: PDF p.6: finite KL in bits with explicit support guard. Zero-Q terms, including 0/0, are zero. Individual signed contributions are summed BEFORE taking the nonnegative part.
  • BellTrial
  • trialJointLaw: PDF pp.5–6: the SAME independently chosen setting law for quantum and local theories.
  • statisticalPayoff: PDF p.12, equation (13): U is defined by JOINT KL; the average identity is a conclusion.
  • lowerValue: PDF p.12, equation (14): infimum over all local theories.
  • uniformStrength: PDF p.8, equation (8).
  • uncorrelatedStrength: PDF p.8, equation (9): supremum over PRODUCT settings followed by infimum over Pi.
  • correlatedStrength: PDF p.8, equation (10): potentially correlated settings.
  • upperValue: PDF pp.13–14: the reverse optimization, kept distinct from the maximin.
  • minimax: PDF pp.13–14: inf-sup, not defined to equal sup-inf.
  • productSettings
  • Saddle: PDF pp.13–14 and proof p.35 (102)–(107): saddle orientation. The printed display on p.13 is already correct, contrary to the supplied plan notes.
  • minimizers: PDF p.14, equations (25)–(26).
  • Equalizer: PDF p.14: constant statisticalPayoff against EVERY potentially correlated setting law.
  • DominatesQuantum: PDF p.12: Q is supported by the measured marginals at every setting.
  • optimizerScore: PDF p.12, equations (15)–(16): zero-Q contributions are zero, even if their denominator vanishes. The optimizer characterization separately requires DominatesQuantum.
  • NontrivialTable: PDF p.12: nontriviality in Theorem 1(3a).
  • TwoByTwo: PDF pp.12,14,31: two parties, two settings each; outcomes remain arbitrary finite sets.
  • binaryScenario: PDF pp.18,21: homogeneous binary experimental scenarios.
  • BellScenario
  • MerminScenario
  • GHZScenario
  • rotatedBellPairLaw: PDF pp.18,21: pair law of the fixed (00+11)/sqrt(2) state at rotation angles A,B.
  • originalBell: PDF p.18, Appendix III-A: Bell's ORIGINAL fixed experiment.
  • optimizedBell: PDF p.20, Table VIII (exact rationals), the optimized Bell experiment.
  • chshTable: PDF pp.6,18,21: exact CHSH probabilities, not the rounded decimal table.
  • chshLocal: PDF p.14, equation (27): the specified eight potential assignments each get mass 1/8.
  • hardyAlpha: PDF p.21: Hardy's exact alpha; radical checked in the PDF.
  • hardyBeta
  • hardyVector: PDF p.21, (38)–(39): T vector; F is its real orthogonal complement.
  • hardy: PDF p.21: Born probabilities for alpha|00> - beta|11>, with the stated local bases.
  • mermin: PDF p.23, Table XXII: Mermin's fixed three-setting experiment.
  • ghzConstrained: PDF pp.17,24, (35) and Table XXVIII: 111,122,212,221 in one-based notation.
  • ghzAllowed: PDF p.24, Table XXVIII: parity is odd at 111 and even at 122,212,221.
  • ghzTable: PDF pp.21,24: exact GHZ conditional law.
  • ghzLocalTable: PDF p.24, Table XXIX: exact best-local conditional table; realization is a conclusion.
  • ghzCorrelatedSettings: PDF p.24: corrected from Table XXVIII and (35). The prose prints 0.125 instead of 0.25 and says even, instead of odd, number of setting-1 measurements.
  • trialMeasure: PDF p.25: one-trial law as a finite atomic measure.
  • iidLaw: PDF p.25: infinite IID law on the product sigma algebra. Under NonlocalityProof and s in Sigma, trialMeasure is a probability measure, so infinitePi's zero fallback is not used.
  • sampleLikelihood: PDF pp.25,29: an n-sample likelihood, including the empty product at n=0.
  • simplexVolume: PDF p.29: intrinsic simplex measure in affine dimension |potential assignments|-1. Hausdorff measure for the coordinate norm differs from affine Lebesgue volume only by a fixed positive factor, absorbed into the normalized density. Ambient volume would be zero.
  • AdmissiblePrior: PDF p.29: the source's continuous density, normalized for intrinsic volume, and bounded strictly away from zero. Integrability is a conclusion below, rather than a default integral.
  • bayesMarginal: PDF p.29, equation (64): actual Bayesian marginal over the same local family.
  • posteriorOdds: PDF p.29, (68): posterior odds with fixed 0<h<1 prior probability of QM.
  • initialTrials: First n trials of an infinite sequence.
  • idealLength: PDF pp.26–27: ideal codelength in bits, infinite at impossible words.
  • IsPrefixCode: Actual binary words form a prefix code on the indicated alphabet/support.
  • shannonBefore: Canonical Shannon ordering: decreasing probability, ties broken by a fixed finite index.
  • shannonCumulative: Left end of the Shannon interval for x in the probability-sorted alphabet.
  • shannonSize: PDF p.31: actual integer Shannon ceiling length; used only at p(x)>0.
  • shannonWord: PDF p.31: explicit Shannon words: the first ceil(-log2 p(x)) binary digits of the cumulative probability in decreasing-probability order. Zero-mass words are excluded from its coding alphabet; singleton support has the empty word.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Ensemble
import Definitions.Def_QAlgorithms_Defs_Information

/-!
Statements from van Dam, Gill and Grunwald, quant-ph/0307125v2.
All new definitions are confined to this paper. Indices are zero based; outcome 1 is T.
Distinct names separate this paper's experimental tables and likelihoods from unrelated
accepted channel/operator definitions. Base-two logs reuse Mathlib Real.logb directly.
The saddle inequalities agree with Definition 4 on PDF p.13 and its proof on p.35.
The plan incorrectly described the displayed minimizer inequality as reversed.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Intakethird100.P80

open scoped BigOperators ENNReal Topology Classical
open MeasureTheory Filter

/-- PDF pp.4,16: nonempty finite parties, settings, and setting-dependent outcomes. -/
structure BellExperiment where
  parties : ℕ
  parties_pos : 0 < parties
  settings : Fin parties → ℕ
  settings_pos : ∀ i, 0 < settings i
  outcomes : (i : Fin parties) → Fin (settings i) → ℕ
  outcomes_pos : ∀ i a, 0 < outcomes i a

abbrev Settings (S : BellExperiment) := (i : Fin S.parties) → Fin (S.settings i)

abbrev MeasuredOutcomes (S : BellExperiment) (s : Settings S) :=
  (i : Fin S.parties) → Fin (S.outcomes i (s i))

abbrev Potential (S : BellExperiment) :=
  (i : Fin S.parties) → (a : Fin (S.settings i)) → Fin (S.outcomes i a)

abbrev Table (S : BellExperiment) := (s : Settings S) → MeasuredOutcomes S s → ℝ

abbrev Sigma (S : BellExperiment) := stdSimplex ℝ (Settings S)

abbrev PiLocal (S : BellExperiment) := stdSimplex ℝ (Potential S)

/-- PDF pp.5,16: measuring a setting selects coordinates of ONE potential assignment. -/
def potentialAtSetting {S : BellExperiment} (v : Potential S) (s : Settings S) : MeasuredOutcomes S s :=
  fun i => v i (s i)

/-- PDF pp.5,16: the measured marginal of a full potential-outcome law. -/
def localTable {S : BellExperiment} (p : Potential S → ℝ) : Table S :=
  fun s x => ∑ v, if potentialAtSetting v s = x then p v else 0

/-- PDF p.16: coefficient tensor product of the local measurement effects. -/
def localTensorEffect {S : BellExperiment} (d : Fin S.parties → ℕ)
    (M : (i : Fin S.parties) → (a : Fin (S.settings i)) →
      Fin (S.outcomes i a) → Matrix (Fin (d i)) (Fin (d i)) ℂ)
    (s : Settings S) (x : MeasuredOutcomes S s) :
    Matrix ((i : Fin S.parties) → Fin (d i)) ((i : Fin S.parties) → Fin (d i)) ℂ :=
  Matrix.of fun u v => ∏ i, M i (s i) (x i) (u i) (v i)

/-- PDF pp.4–5,16: a fixed finite quantum realization, with normalized shared density matrix
and local POVMs. This witnesses quantum generation; it is never optimized in a strength. -/
def QuantumGenerated {S : BellExperiment} (Q : Table S) : Prop :=
  ∃ (d : Fin S.parties → ℕ), (∀ i, 0 < d i) ∧
    ∃ (rho : Matrix ((i : Fin S.parties) → Fin (d i))
        ((i : Fin S.parties) → Fin (d i)) ℂ)
      (M : (i : Fin S.parties) → (a : Fin (S.settings i)) →
        Fin (S.outcomes i a) → Matrix (Fin (d i)) (Fin (d i)) ℂ),
      QAlgorithms.IsDensityMatrix rho ∧ (∀ i a, QAlgorithms.IsPOVM (M i a)) ∧
      ∀ s x, Q s x = QAlgorithms.effectProb (localTensorEffect d M s x) rho

/-- PDF pp.5,31: every subset marginal is independent of the other parties' settings.
Natural coordinate values allow comparison across dependent outcome alphabets. -/
def MarginalConsistency {S : BellExperiment} (Q : Table S) : Prop :=
  ∀ (J : Finset (Fin S.parties)) (s t : Settings S),
    (∀ i ∈ J, s i = t i) → ∀ v : Potential S,
    (∑ x, if ∀ i ∈ J, (x i).val = (v i (s i)).val then Q s x else 0) =
    (∑ x, if ∀ i ∈ J, (x i).val = (v i (t i)).val then Q t x else 0)

/-- PDF pp.4–5,16,31: quantum table with its probability and no-signalling invariants exposed.
Properness is a separate predicate, so local quantum tables remain admissible. -/
def NonlocalityProof {S : BellExperiment} (Q : Table S) : Prop :=
  (∀ s, Q s ∈ stdSimplex ℝ (MeasuredOutcomes S s)) ∧ MarginalConsistency Q ∧ QuantumGenerated Q

/-- PDF pp.5,16: no single local potential-outcome law reproduces every setting. -/
def Proper {S : BellExperiment} (Q : Table S) : Prop :=
  ¬ ∃ p : PiLocal S, localTable p.1 = Q

/-- PDF p.8: computed uniform setting weights. All setting alphabets are nonempty. -/
def uniformSettings (S : BellExperiment) : Settings S → ℝ :=
  fun _ => (Fintype.card (Settings S) : ℝ)⁻¹

/-- PDF pp.5,8: products of normalized local setting laws, including point masses. -/
def Uncorrelated {S : BellExperiment} (s : Settings S → ℝ) : Prop :=
  ∃ p : (i : Fin S.parties) → stdSimplex ℝ (Fin (S.settings i)),
    ∀ a, s a = ∏ i, (p i).1 (a i)

/-- PDF pp.12,33: relative simplex interior, not ambient interior. -/
def PositiveCoordinates {I : Type*} (p : I → ℝ) : Prop := ∀ i, 0 < p i

/-- PDF p.6: finite KL in bits with explicit support guard. Zero-Q terms, including 0/0,
are zero. Individual signed contributions are summed BEFORE taking the nonnegative part. -/
def kl {I : Type*} [Fintype I] (q p : I → ℝ) : ℝ≥0∞ :=
  if ∃ x, 0 < q x ∧ p x = 0 then ⊤ else
    ENNReal.ofReal (∑ x, if q x = 0 then 0 else q x * Real.logb 2 (q x / p x))

abbrev BellTrial (S : BellExperiment) := (s : Settings S) × MeasuredOutcomes S s

/-- PDF pp.5–6: the SAME independently chosen setting law for quantum and local theories. -/
def trialJointLaw {S : BellExperiment} (Q : Table S) (s : Settings S → ℝ) : BellTrial S → ℝ :=
  fun z => s z.1 * Q z.1 z.2

/-- PDF p.12, equation (13): U is defined by JOINT KL; the average identity is a conclusion. -/
def statisticalPayoff {S : BellExperiment} (Q : Table S) (s : Settings S → ℝ)
    (p : Potential S → ℝ) : ℝ≥0∞ := kl (trialJointLaw Q s) (trialJointLaw (localTable p) s)

/-- PDF p.12, equation (14): infimum over all local theories. -/
def lowerValue {S : BellExperiment} (Q : Table S) (s : Settings S → ℝ) : ℝ≥0∞ :=
  ⨅ p : PiLocal S, statisticalPayoff Q s p.1

/-- PDF p.8, equation (8). -/
def uniformStrength {S : BellExperiment} (Q : Table S) : ℝ≥0∞ :=
  lowerValue Q (uniformSettings S)

/-- PDF p.8, equation (9): supremum over PRODUCT settings followed by infimum over Pi. -/
def uncorrelatedStrength {S : BellExperiment} (Q : Table S) : ℝ≥0∞ :=
  ⨆ s : {s : Sigma S // Uncorrelated s.1}, lowerValue Q s.1.1

/-- PDF p.8, equation (10): potentially correlated settings. -/
def correlatedStrength {S : BellExperiment} (Q : Table S) : ℝ≥0∞ :=
  ⨆ s : Sigma S, lowerValue Q s.1

/-- PDF pp.13–14: the reverse optimization, kept distinct from the maximin. -/
def upperValue {S : BellExperiment} (Q : Table S) (A : Set (Settings S → ℝ))
    (p : Potential S → ℝ) : ℝ≥0∞ := ⨆ s : A, statisticalPayoff Q s.1 p

/-- PDF pp.13–14: inf-sup, not defined to equal sup-inf. -/
def minimax {S : BellExperiment} (Q : Table S) (A : Set (Settings S → ℝ)) : ℝ≥0∞ :=
  ⨅ p : PiLocal S, upperValue Q A p.1

def productSettings (S : BellExperiment) : Set (Settings S → ℝ) :=
  {s | s ∈ stdSimplex ℝ (Settings S) ∧ Uncorrelated s}

/-- PDF pp.13–14 and proof p.35 (102)–(107): saddle orientation.
The printed display on p.13 is already correct, contrary to the supplied plan notes. -/
def Saddle {S : BellExperiment} (Q : Table S) (A : Set (Settings S → ℝ))
    (s : Settings S → ℝ) (p : Potential S → ℝ) : Prop :=
  s ∈ A ∧ p ∈ stdSimplex ℝ (Potential S) ∧
    (∀ t ∈ A, statisticalPayoff Q t p ≤ statisticalPayoff Q s p) ∧
    (∀ r ∈ stdSimplex ℝ (Potential S), statisticalPayoff Q s p ≤ statisticalPayoff Q s r)

/-- PDF p.14, equations (25)–(26). -/
def minimizers {S : BellExperiment} (Q : Table S) (A : Set (Settings S → ℝ)) :
    Set (Potential S → ℝ) :=
  {p | p ∈ stdSimplex ℝ (Potential S) ∧ upperValue Q A p = minimax Q A}

/-- PDF p.14: constant statisticalPayoff against EVERY potentially correlated setting law. -/
def Equalizer {S : BellExperiment} (Q : Table S) (p : Potential S → ℝ) : Prop :=
  ∃ K : ℝ≥0∞, ∀ s : Sigma S, statisticalPayoff Q s.1 p = K

/-- PDF p.12: Q is supported by the measured marginals at every setting. -/
def DominatesQuantum {S : BellExperiment} (Q : Table S) (p : Potential S → ℝ) : Prop :=
  ∀ s x, 0 < Q s x → 0 < localTable p s x

/-- PDF p.12, equations (15)–(16): zero-Q contributions are zero, even if their denominator
vanishes. The optimizer characterization separately requires DominatesQuantum. -/
def optimizerScore {S : BellExperiment} (Q : Table S) (s : Settings S → ℝ)
    (p : Potential S → ℝ) (v : Potential S) : ℝ :=
  ∑ a, if Q a (potentialAtSetting v a) = 0 then 0 else
    s a * Q a (potentialAtSetting v a) / localTable p a (potentialAtSetting v a)

/-- PDF p.12: nontriviality in Theorem 1(3a). -/
def NontrivialTable {S : BellExperiment} (Q : Table S) : Prop :=
  ∃ a x, 0 < Q a x ∧ Q a x < 1

/-- PDF pp.12,14,31: two parties, two settings each; outcomes remain arbitrary finite sets. -/
def TwoByTwo (S : BellExperiment) : Prop := S.parties = 2 ∧ ∀ i, S.settings i = 2

/-- PDF pp.18,21: homogeneous binary experimental scenarios. -/
abbrev binaryScenario (k m : ℕ) (hk : 0 < k) (hm : 0 < m) : BellExperiment where
  parties := k
  parties_pos := hk
  settings := fun _ => m
  settings_pos := fun _ => hm
  outcomes := fun _ _ => 2
  outcomes_pos := fun _ _ => by decide

abbrev BellScenario := binaryScenario 2 2 (by decide) (by decide)

abbrev MerminScenario := binaryScenario 2 3 (by decide) (by decide)

abbrev GHZScenario := binaryScenario 3 2 (by decide) (by decide)

/-- PDF pp.18,21: pair law of the fixed (00+11)/sqrt(2) state at rotation angles A,B. -/
def rotatedBellPairLaw (A B : ℝ) (x y : Fin 2) : ℝ :=
  if x = y then (Real.cos (A - B)) ^ 2 / 2 else (Real.sin (A - B)) ^ 2 / 2

/-- PDF p.18, Appendix III-A: Bell's ORIGINAL fixed experiment. -/
def originalBell : Table BellScenario := fun s x =>
  rotatedBellPairLaw (if s 0 = 0 then 0 else Real.pi / 8)
    (if s 1 = 0 then Real.pi / 8 else Real.pi / 4) (x 0) (x 1)

/-- PDF p.20, Table VIII (exact rationals), the optimized Bell experiment. -/
def optimizedBell : Table BellScenario := fun s x =>
  if s 0 = 0 ∧ s 1 = 0 then (if x 0 = x 1 then 1 / 2 else 0)
  else if s 0 = 0 ∧ s 1 = 1 then (if x 0 = x 1 then 1 / 8 else 3 / 8)
  else (if x 0 = x 1 then 3 / 8 else 1 / 8)

/-- PDF pp.6,18,21: exact CHSH probabilities, not the rounded decimal table. -/
def chshTable : Table BellScenario := fun s x =>
  if (x 0 ≠ x 1) ↔ (s 0 = 1 ∧ s 1 = 1)
  then 1 / 4 + Real.sqrt 2 / 8 else 1 / 4 - Real.sqrt 2 / 8

/-- PDF p.14, equation (27): the specified eight potential assignments each get mass 1/8. -/
def chshLocal : Potential BellScenario → ℝ := fun v =>
  if (v 0 0, v 0 1, v 1 0, v 1 1) ∈
      ({(0,0,0,0), (1,1,1,1), (0,0,0,1), (1,1,1,0),
        (0,0,1,0), (1,1,0,1), (1,0,0,1), (0,1,1,0)} :
        Finset (Fin 2 × Fin 2 × Fin 2 × Fin 2))
  then 1 / 8 else 0

/-- PDF p.21: Hardy's exact alpha; radical checked in the PDF. -/
def hardyAlpha : ℝ := Real.sqrt (2 + 2 * Real.sqrt (-13 + 6 * Real.sqrt 5)) / 2

def hardyBeta : ℝ := Real.sqrt (1 - hardyAlpha ^ 2)

/-- PDF p.21, (38)–(39): T vector; F is its real orthogonal complement. -/
def hardyVector (a x j : Fin 2) : ℝ :=
  let u := if a = 0 then Real.sqrt (hardyBeta / (hardyAlpha + hardyBeta))
    else -Real.sqrt (hardyBeta ^ 3 / (hardyAlpha ^ 3 + hardyBeta ^ 3))
  let v := if a = 0 then Real.sqrt (hardyAlpha / (hardyAlpha + hardyBeta))
    else Real.sqrt (hardyAlpha ^ 3 / (hardyAlpha ^ 3 + hardyBeta ^ 3))
  if x = 1 then (if j = 0 then u else v) else (if j = 0 then -v else u)

/-- PDF p.21: Born probabilities for alpha|00> - beta|11>, with the stated local bases. -/
def hardy : Table BellScenario := fun s x =>
  (hardyAlpha * hardyVector (s 0) (x 0) 0 * hardyVector (s 1) (x 1) 0 -
    hardyBeta * hardyVector (s 0) (x 0) 1 * hardyVector (s 1) (x 1) 1) ^ 2

/-- PDF p.23, Table XXII: Mermin's fixed three-setting experiment. -/
def mermin : Table MerminScenario := fun s x =>
  if s 0 = s 1 then (if x 0 = x 1 then 1 / 2 else 0)
  else (if x 0 = x 1 then 1 / 8 else 3 / 8)

/-- PDF pp.17,24, (35) and Table XXVIII: 111,122,212,221 in one-based notation. -/
def ghzConstrained (s : Settings GHZScenario) : Prop :=
  (s 0).val + (s 1).val + (s 2).val = 0 ∨
    (s 0).val + (s 1).val + (s 2).val = 2

/-- PDF p.24, Table XXVIII: parity is odd at 111 and even at 122,212,221. -/
def ghzAllowed (s : Settings GHZScenario) (x : MeasuredOutcomes GHZScenario s) : Prop :=
  ((x 0).val + (x 1).val + (x 2).val) % 2 =
    if s 0 = 0 ∧ s 1 = 0 ∧ s 2 = 0 then 1 else 0

/-- PDF pp.21,24: exact GHZ conditional law. -/
def ghzTable : Table GHZScenario := fun s x =>
  if ghzConstrained s then (if ghzAllowed s x then 1 / 4 else 0) else 1 / 8

/-- PDF p.24, Table XXIX: exact best-local conditional table; realization is a conclusion. -/
def ghzLocalTable : Table GHZScenario := fun s x =>
  if ghzConstrained s then (if ghzAllowed s x then 3 / 16 else 1 / 16) else 1 / 8

/-- PDF p.24: corrected from Table XXVIII and (35). The prose prints 0.125 instead of 0.25
and says even, instead of odd, number of setting-1 measurements. -/
def ghzCorrelatedSettings : Settings GHZScenario → ℝ := fun s =>
  if ghzConstrained s then 1 / 4 else 0

section ProbabilityCoding

/-- Finite trial alphabet carries the discrete sigma algebra. -/
instance trialMeasurableSpace (S : BellExperiment) : MeasurableSpace (BellTrial S) := ⊤

/-- PDF p.25: one-trial law as a finite atomic measure. -/
def trialMeasure {S : BellExperiment} (Q : Table S) (s : Settings S → ℝ) : Measure (BellTrial S) :=
  ∑ z, ENNReal.ofReal (trialJointLaw Q s z) • Measure.dirac z

/-- PDF p.25: infinite IID law on the product sigma algebra. Under NonlocalityProof and
s in Sigma, trialMeasure is a probability measure, so infinitePi's zero fallback is not used. -/
def iidLaw {S : BellExperiment} (Q : Table S) (s : Settings S → ℝ) : Measure (ℕ → BellTrial S) :=
  Measure.infinitePi (fun _ : ℕ => trialMeasure Q s)

/-- PDF pp.25,29: an n-sample likelihood, including the empty product at n=0. -/
def sampleLikelihood {Z : Type*} (p : Z → ℝ) {n : ℕ} (z : Fin n → Z) : ℝ := ∏ i, p (z i)

/-- PDF p.29: intrinsic simplex measure in affine dimension |potential assignments|-1.
Hausdorff measure for the coordinate norm differs from affine Lebesgue volume only by a
fixed positive factor, absorbed into the normalized density. Ambient volume would be zero. -/
def simplexVolume (S : BellExperiment) : Measure (Potential S → ℝ) :=
  (Measure.hausdorffMeasure ((Fintype.card (Potential S) - 1 : ℕ) : ℝ)).restrict
    (stdSimplex ℝ (Potential S))

/-- PDF p.29: the source's continuous density, normalized for intrinsic volume, and bounded
strictly away from zero. Integrability is a conclusion below, rather than a default integral. -/
def AdmissiblePrior {S : BellExperiment} (w : (Potential S → ℝ) → ℝ) : Prop :=
  ContinuousOn w (stdSimplex ℝ (Potential S)) ∧
  (∃ c : ℝ, 0 < c ∧ ∀ p ∈ stdSimplex ℝ (Potential S), c < w p) ∧
  (∫ p, w p ∂simplexVolume S) = 1

/-- PDF p.29, equation (64): actual Bayesian marginal over the same local family. -/
def bayesMarginal {S : BellExperiment} (s : Settings S → ℝ)
    (w : (Potential S → ℝ) → ℝ) {n : ℕ} (z : Fin n → BellTrial S) : ℝ :=
  ∫ p, w p * sampleLikelihood (trialJointLaw (localTable p) s) z ∂simplexVolume S

/-- PDF p.29, (68): posterior odds with fixed 0<h<1 prior probability of QM. -/
def posteriorOdds {S : BellExperiment} (Q : Table S) (s : Settings S → ℝ)
    (w : (Potential S → ℝ) → ℝ) (h : ℝ) {n : ℕ} (z : Fin n → BellTrial S) : ℝ :=
  (h / (1 - h)) * sampleLikelihood (trialJointLaw Q s) z / bayesMarginal s w z

/-- First n trials of an infinite sequence. -/
def initialTrials {Z : Type*} (z : ℕ → Z) (n : ℕ) : Fin n → Z := fun i => z i.val

/-- PDF pp.26–27: ideal codelength in bits, infinite at impossible words. -/
def idealLength {Z : Type*} (p : Z → ℝ) {n : ℕ} (z : Fin n → Z) : ℝ≥0∞ :=
  if sampleLikelihood p z = 0 then ⊤ else ENNReal.ofReal (-Real.logb 2 (sampleLikelihood p z))

/-- Actual binary words form a prefix code on the indicated alphabet/support. -/
def IsPrefixCode {Z : Type*} (C : Z → List Bool) : Prop :=
  ∀ x y, (C x).IsPrefix (C y) → x = y

/-- Canonical Shannon ordering: decreasing probability, ties broken by a fixed finite index. -/
def shannonBefore {Z : Type*} [Fintype Z] (p : Z → ℝ) (x y : Z) : Prop :=
  p y < p x ∨ (p x = p y ∧ (Fintype.equivFin Z x).val < (Fintype.equivFin Z y).val)

/-- Left end of the Shannon interval for x in the probability-sorted alphabet. -/
def shannonCumulative {Z : Type*} [Fintype Z] (p : Z → ℝ) (x : Z) : ℝ :=
  ∑ y, if shannonBefore p y x then p y else 0

/-- PDF p.31: actual integer Shannon ceiling length; used only at p(x)>0. -/
def shannonSize {Z : Type*} (p : Z → ℝ) (x : Z) : ℕ := ⌈-Real.logb 2 (p x)⌉₊

/-- PDF p.31: explicit Shannon words: the first ceil(-log2 p(x)) binary digits of the
cumulative probability in decreasing-probability order. Zero-mass words are excluded from
its coding alphabet; singleton support has the empty word. -/
def shannonWord {Z : Type*} [Fintype Z] (p : Z → ℝ) (x : Z) : List Bool :=
  List.ofFn fun j : Fin (shannonSize p x) =>
    decide ((⌊(2 : ℝ) ^ (j.val + 1) * shannonCumulative p x⌋₊) % 2 = 1)

end ProbabilityCoding

section DefinitionSanity

example : (0 : Fin BellScenario.parties).val = 0 := rfl

example {S : BellExperiment} (v : Potential S) (s : Settings S) (i : Fin S.parties) :
    potentialAtSetting v s i = v i (s i) := rfl

example {I : Type*} [Fintype I] (p : I → ℝ) : kl (fun _ => 0) p = 0 := by
  simp [kl]

example : kl (fun _ : Unit => (1 : ℝ)) (fun _ => 0) = ⊤ := by
  simp [kl]

example {Z : Type*} (p : Z → ℝ) (z : Fin 0 → Z) : sampleLikelihood p z = 1 := by
  simp [sampleLikelihood]

example {Z : Type*} [Fintype Z] (p : Z → ℝ) (x : Z) :
    (shannonWord p x).length = shannonSize p x := by
  simp [shannonWord]

example : ghzConstrained (fun _ => 0) := by
  exact Or.inl rfl

end DefinitionSanity

end QAlgorithms.Papers.Independent.Intakethird100.P80
Source
The statistical strength of nonlocality proofs, arXiv:quant-ph/0307125v2, https://arxiv.org/abs/quant-ph/0307125v2
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

QAlgorithms.Papers.Independent.Intakethird100.P80.AdmissiblePrior

For every Bell experiment SSS with a positive number kkk of parties, positive setting counts mim_imi​, and positive outcome counts oiao_{ia}oia​, let V=∏i∏a=0mi−1{0,…,oia−1}V=\prod_i\prod_{a=0}^{m_i-1}\{0,\ldots,o_{ia}-1\}V=∏i​∏a=0mi​−1​{0,…,oia​−1}, let ΔV\Delta_VΔV​ be the probability simplex on VVV, and let ν\nuν be the (∣V∣−1)(|V|-1)(∣V∣−1)-dimensional Hausdorff measure on RV\mathbb R^VRV restricted to ΔV\Delta_VΔV​. For every function w:RV→Rw:\mathbb R^V\to\mathbb Rw:RV→R, this predicate means that www is continuous on ΔV\Delta_VΔV​, that there exists a real constant c>0c>0c>0 such that c<w(p)c<w(p)c<w(p) for every p∈ΔVp\in\Delta_Vp∈ΔV​, and that

∫RVw(p) dν(p)=1.\int_{\mathbb R^V}w(p)\,d\nu(p)=1.∫RV​w(p)dν(p)=1.

The lower bound is strict, and the continuity and lower-bound conditions impose no requirements outside the simplex.

QAlgorithms.Papers.Independent.Intakethird100.P80.BellExperiment

A Bell experiment consists of a natural number n>0n>0n>0 of parties; a natural number mi>0m_i>0mi​>0 of settings for each party i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1}; and a natural number ri,a>0r_{i,a}>0ri,a​>0 of outcomes for each party iii and each setting a∈{0,…,mi−1}a\in\{0,\ldots,m_i-1\}a∈{0,…,mi​−1}. The data include proofs of all these positivity conditions. Outcome counts may depend on both the party and its setting.

QAlgorithms.Papers.Independent.Intakethird100.P80.BellScenario

This denotes the Bell experiment with exactly two parties, indexed by {0,1}\{0,1\}{0,1}, exactly two settings at each party, indexed by {0,1}\{0,1\}{0,1}, and exactly two outcomes at every setting, indexed by {0,1}\{0,1\}{0,1}. All required positivity conditions are supplied by the inequality 0<20<20<2.

QAlgorithms.Papers.Independent.Intakethird100.P80.BellTrial

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts oi,ao_{i,a}oi,a​, this is the type of pairs (a,x)(a,x)(a,x), where a=(ai)ia=(a_i)_ia=(ai​)i​ is a joint setting with 0≤ai<mi0\leq a_i<m_i0≤ai​<mi​, and x=(xi)ix=(x_i)_ix=(xi​)i​ is a joint outcome satisfying 0≤xi<oi,ai0\leq x_i<o_{i,a_i}0≤xi​<oi,ai​​ for every party. The allowed outcome tuples therefore depend on the chosen setting tuple. This type is finite and nonempty.

QAlgorithms.Papers.Independent.Intakethird100.P80.DominatesQuantum

Let SSS consist of a positive finite number of parties, positive finite setting counts, and positive finite outcome counts at every local setting. Let A\mathcal AA be the joint settings, Xa\mathcal X_aXa​ the joint outcomes at aaa, and V\mathcal VV the assignments specifying an outcome for every local setting of every party; write v(a)v(a)v(a) for the outcome selected at aaa. For any real table Q(a,x)Q(a,x)Q(a,x) and any real function p:V→Rp:\mathcal V\to\mathbb Rp:V→R, the domination predicate is

∀a∈A ∀x∈Xa,Q(a,x)>0 ⟹ ∑v∈Vv(a)=xp(v)>0.\forall a\in\mathcal A\ \forall x\in\mathcal X_a,\qquad Q(a,x)>0\ \Longrightarrow\ \sum_{\substack{v\in\mathcal V\\v(a)=x}}p(v)>0.∀a∈A ∀x∈Xa​,Q(a,x)>0 ⟹ v∈Vv(a)=x​∑​p(v)>0.

No positivity or normalization assumption is imposed on QQQ or ppp, and no condition is imposed at entries where Q(a,x)≤0Q(a,x)\le0Q(a,x)≤0. In particular, the predicate holds vacuously if QQQ has no positive entries.

QAlgorithms.Papers.Independent.Intakethird100.P80.Equalizer

Let SSS specify a positive finite number of parties, positive finite setting counts, and positive finite outcome counts for each local setting. Write A\mathcal AA for the joint settings, Xa\mathcal X_aXa​ for the joint outcomes at aaa, and V\mathcal VV for potential assignments of outcomes to every local setting, with v(a)v(a)v(a) the selected outcome. For any real table Q(a,x)Q(a,x)Q(a,x) and any real function p:V→Rp:\mathcal V\to\mathbb Rp:V→R, the equalizer predicate means that there exists K∈[0,∞]K\in[0,\infty]K∈[0,∞] such that

DQ,s(p)=Kfor every s:A→R satisfying s≥0 and ∑as(a)=1.D_{Q,s}(p)=K \quad\text{for every }s:\mathcal A\to\mathbb R \text{ satisfying }s\ge0\text{ and }\sum_as(a)=1.DQ,s​(p)=Kfor every s:A→R satisfying s≥0 and a∑​s(a)=1.

Here Lp(a,x)=∑v: v(a)=xp(v)L_p(a,x)=\sum_{v:\,v(a)=x}p(v)Lp​(a,x)=∑v:v(a)=x​p(v). With q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x) and r(a,x)=s(a)Lp(a,x)r(a,x)=s(a)L_p(a,x)r(a,x)=s(a)Lp​(a,x), the payoff is +∞+\infty+∞ if some trial has q>0q>0q>0 and r=0r=0r=0; otherwise it is the nonnegative truncation of ∑a,xq(a,x)log⁡2(q(a,x)/r(a,x))\sum_{a,x}q(a,x)\log_2(q(a,x)/r(a,x))∑a,x​q(a,x)log2​(q(a,x)/r(a,x)), with zero terms when q=0q=0q=0. Division by zero is zero, and the total real logarithm is zero at zero and uses absolute values at negative arguments. The constant KKK may be infinite. No positivity or normalization is required of QQQ or ppp, and the universal quantifier includes setting distributions with zero coordinates.

QAlgorithms.Papers.Independent.Intakethird100.P80.GHZScenario

This denotes the Bell experiment with exactly three parties, indexed by {0,1,2}\{0,1,2\}{0,1,2}, exactly two settings at each party, indexed by {0,1}\{0,1\}{0,1}, and exactly two outcomes at every setting, indexed by {0,1}\{0,1\}{0,1}. The required positivity conditions are supplied by 0<30<30<3 for the party count and 0<20<20<2 for the setting and outcome counts.

QAlgorithms.Papers.Independent.Intakethird100.P80.IsPrefixCode

For any type ZZZ and any assignment CCC of a finite Boolean word to each element of ZZZ, the predicate IsPrefixCode⁡(C)\operatorname{IsPrefixCode}(C)IsPrefixCode(C) means that, for every x,y∈Zx,y\in Zx,y∈Z, if C(x)C(x)C(x) is a prefix of C(y)C(y)C(y), including the possibility that the two words are equal, then x=yx=yx=y. This includes injectivity of CCC. The condition is vacuous when ZZZ is empty and permits the empty word when ZZZ has only one element.

QAlgorithms.Papers.Independent.Intakethird100.P80.MarginalConsistency

For any Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, and any real table Q(s,x)Q(s,x)Q(s,x) on its setting and outcome tuples, this property requires the following: for every subset J⊆{0,…,n−1}J\subseteq\{0,\ldots,n-1\}J⊆{0,…,n−1}, every two setting tuples s,ts,ts,t satisfying si=tis_i=t_isi​=ti​ for every i∈Ji\in Ji∈J, and every potential assignment vvv specifying a permitted outcome vi,av_{i,a}vi,a​ for every party and setting,

∑x: ∀i, 0≤xi<ri,si∀i∈J, xi=vi,siQ(s,x)=∑x: ∀i, 0≤xi<ri,ti∀i∈J, xi=vi,tiQ(t,x).\sum_{\substack{x:\ \forall i,\ 0\le x_i<r_{i,s_i}\\ \forall i\in J,\ x_i=v_{i,s_i}}}Q(s,x) = \sum_{\substack{x:\ \forall i,\ 0\le x_i<r_{i,t_i}\\ \forall i\in J,\ x_i=v_{i,t_i}}}Q(t,x).x: ∀i, 0≤xi​<ri,si​​∀i∈J, xi​=vi,si​​​∑​Q(s,x)=x: ∀i, 0≤xi​<ri,ti​​∀i∈J, xi​=vi,ti​​​∑​Q(t,x).

The coordinate equalities compare the underlying integer outcome labels. The subset JJJ may be empty, in which case the requirement equates the total sums at any two settings. No nonnegativity or normalization of QQQ is assumed by this property.

QAlgorithms.Papers.Independent.Intakethird100.P80.MeasuredOutcomes

For a Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, and for any setting tuple sss with 0≤si<mi0\le s_i<m_i0≤si​<mi​, the measured outcomes at sss are all functions xxx assigning to every party iii an outcome xi∈{0,…,ri,si−1}x_i\in\{0,\ldots,r_{i,s_i}-1\}xi​∈{0,…,ri,si​​−1}. The permitted outcome range for each party uses that party’s chosen setting.

QAlgorithms.Papers.Independent.Intakethird100.P80.MerminScenario

This denotes the Bell experiment with exactly two parties, indexed by {0,1}\{0,1\}{0,1}, exactly three settings at each party, indexed by {0,1,2}\{0,1,2\}{0,1,2}, and exactly two outcomes at every setting, indexed by {0,1}\{0,1\}{0,1}. The required positivity conditions are supplied by 0<20<20<2 for the party and outcome counts and 0<30<30<3 for the setting counts.

QAlgorithms.Papers.Independent.Intakethird100.P80.NonlocalityProof

For a Bell experiment SSS, let k>0k>0k>0 be its number of parties, let mi>0m_i>0mi​>0 be the number of settings for party iii, and let oi,a>0o_{i,a}>0oi,a​>0 be its number of outcomes at setting aaa. Write A=∏i=0k−1{0,…,mi−1}A=\prod_{i=0}^{k-1}\{0,\ldots,m_i-1\}A=∏i=0k−1​{0,…,mi​−1} for the joint settings, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1} for the outcomes at a∈Aa\in Aa∈A, and V=∏i∏b=0mi−1{0,…,oi,b−1}V=\prod_i\prod_{b=0}^{m_i-1}\{0,\ldots,o_{i,b}-1\}V=∏i​∏b=0mi​−1​{0,…,oi,b​−1} for the assignments of an outcome to every party and setting. For any real table Q(a,x)Q(a,x)Q(a,x), the predicate holds precisely when all three following conditions hold: each Q(a,x)Q(a,x)Q(a,x) is nonnegative and ∑x∈XaQ(a,x)=1\sum_{x\in X_a}Q(a,x)=1∑x∈Xa​​Q(a,x)=1; for every subset JJJ of parties, every a,b∈Aa,b\in Aa,b∈A agreeing on JJJ, and every v∈Vv\in Vv∈V, ∑x∈Xa: ∀i∈J, xi=vi,aiQ(a,x)=∑y∈Xb: ∀i∈J, yi=vi,biQ(b,y)\sum_{x\in X_a:\,\forall i\in J,\ x_i=v_{i,a_i}}Q(a,x)=\sum_{y\in X_b:\,\forall i\in J,\ y_i=v_{i,b_i}}Q(b,y)∑x∈Xa​:∀i∈J, xi​=vi,ai​​​Q(a,x)=∑y∈Xb​:∀i∈J, yi​=vi,bi​​​Q(b,y); and there exist positive integers did_idi​, a positive semidefinite complex matrix ρ\rhoρ indexed by D=∏i{0,…,di−1}D=\prod_i\{0,\ldots,d_i-1\}D=∏i​{0,…,di​−1} with trace 111, and positive semidefinite matrices Mi,b,cM_{i,b,c}Mi,b,c​ of size di×did_i\times d_idi​×di​, with ∑c=0oi,b−1Mi,b,c=Idi\sum_{c=0}^{o_{i,b}-1}M_{i,b,c}=I_{d_i}∑c=0oi,b​−1​Mi,b,c​=Idi​​ for every i,bi,bi,b, such that Q(a,x)=Re⁡tr⁡(Ea,xρ)Q(a,x)=\operatorname{Re}\operatorname{tr}(E_{a,x}\rho)Q(a,x)=Retr(Ea,x​ρ) for every a,xa,xa,x, where Ea,x(u,w)=∏iMi,ai,xi(ui,wi)E_{a,x}(u,w)=\prod_i M_{i,a_i,x_i}(u_i,w_i)Ea,x​(u,w)=∏i​Mi,ai​,xi​​(ui​,wi​). The marginal condition includes the empty subset JJJ.

QAlgorithms.Papers.Independent.Intakethird100.P80.NontrivialTable

For a Bell experiment SSS with a positive finite number of parties, positive finite setting counts, and positive finite outcome counts for every local setting, and an arbitrary real table QQQ assigning Q(a,x)Q(a,x)Q(a,x) to each joint setting aaa and each compatible joint outcome xxx, the nontrivial-table predicate means

∃a ∃x,0<Q(a,x)<1.\exists a\ \exists x,\qquad 0<Q(a,x)<1.∃a ∃x,0<Q(a,x)<1.

It requires only one entry strictly between zero and one; no positivity, normalization, or other restriction is imposed on the remaining entries.

QAlgorithms.Papers.Independent.Intakethird100.P80.PiLocal

For a Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, ΠLocal(S)\Pi_{\mathrm{Local}}(S)ΠLocal​(S) is the standard real simplex on the finite set of potential assignments vvv, where vi,a∈{0,…,ri,a−1}v_{i,a}\in\{0,\ldots,r_{i,a}-1\}vi,a​∈{0,…,ri,a​−1} for every party and setting. Its elements are real-valued functions ppp on these assignments satisfying p(v)≥0p(v)\ge0p(v)≥0 for every vvv and ∑vp(v)=1\sum_vp(v)=1∑v​p(v)=1; coordinates may be zero.

QAlgorithms.Papers.Independent.Intakethird100.P80.PositiveCoordinates

For any type III and any function p:I→Rp:I\to\mathbb Rp:I→R, this predicate says that p(i)>0p(i)>0p(i)>0 for every i∈Ii\in Ii∈I. There is no finiteness or normalization assumption; when III is empty, the condition holds vacuously.

QAlgorithms.Papers.Independent.Intakethird100.P80.Potential

For a Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, a potential assignment is a function vvv specifying an outcome vi,a∈{0,…,ri,a−1}v_{i,a}\in\{0,\ldots,r_{i,a}-1\}vi,a​∈{0,…,ri,a​−1} for every party i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1} and every one of its settings a∈{0,…,mi−1}a\in\{0,\ldots,m_i-1\}a∈{0,…,mi​−1}. It specifies outcomes for all settings simultaneously.

QAlgorithms.Papers.Independent.Intakethird100.P80.Proper

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts oi,ao_{i,a}oi,a​, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, and V=∏i∏b=0mi−1{0,…,oi,b−1}V=\prod_i\prod_{b=0}^{m_i-1}\{0,\ldots,o_{i,b}-1\}V=∏i​∏b=0mi​−1​{0,…,oi,b​−1}. For any real table Q(a,x)Q(a,x)Q(a,x), this predicate says that there is no function p:V→Rp:V\to\mathbb Rp:V→R satisfying p(v)≥0p(v)\geq0p(v)≥0 for every vvv, ∑v∈Vp(v)=1\sum_{v\in V}p(v)=1∑v∈V​p(v)=1, and Q(a,x)=∑v∈V: ∀i, vi,ai=xip(v)Q(a,x)=\sum_{v\in V:\,\forall i,\ v_{i,a_i}=x_i}p(v)Q(a,x)=∑v∈V:∀i, vi,ai​​=xi​​p(v) for every a∈Aa\in Aa∈A and x∈Xax\in X_ax∈Xa​. No nonnegativity or normalization assumption on QQQ is imposed.

QAlgorithms.Papers.Independent.Intakethird100.P80.QuantumGenerated

For any Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, and any real table Q(s,x)Q(s,x)Q(s,x) on its setting and outcome tuples, this property means that there exist natural numbers di>0d_i>0di​>0, a complex matrix ρ\rhoρ indexed by ∏i{0,…,di−1}\prod_i\{0,\ldots,d_i-1\}∏i​{0,…,di​−1}, and complex di×did_i\times d_idi​×di​ matrices Mi,a,bM_{i,a,b}Mi,a,b​ for every party iii, setting aaa, and permitted outcome bbb, such that ρ\rhoρ is positive semidefinite with tr⁡(ρ)=1\operatorname{tr}(\rho)=1tr(ρ)=1, every Mi,a,bM_{i,a,b}Mi,a,b​ is positive semidefinite, and ∑b=0ri,a−1Mi,a,b=Idi\sum_{b=0}^{r_{i,a}-1}M_{i,a,b}=I_{d_i}∑b=0ri,a​−1​Mi,a,b​=Idi​​ for every i,ai,ai,a. For all setting tuples sss and permitted outcome tuples xxx, these data must satisfy

Q(s,x)=Re⁡tr⁡(Es,xρ),Es,x(u,v)=∏i=0n−1Mi,si,xi(ui,vi).Q(s,x)=\operatorname{Re}\operatorname{tr}(E_{s,x}\rho), \qquad E_{s,x}(u,v)=\prod_{i=0}^{n-1}M_{i,s_i,x_i}(u_i,v_i).Q(s,x)=Retr(Es,x​ρ),Es,x​(u,v)=i=0∏n−1​Mi,si​,xi​​(ui​,vi​).

QAlgorithms.Papers.Independent.Intakethird100.P80.Saddle

Let SSS specify a positive finite number of parties, positive finite setting counts, and positive finite outcome counts at every local setting. Write A\mathcal AA for the joint settings, Xa\mathcal X_aXa​ for their joint outcomes, and V\mathcal VV for the assignments of outcomes to every local setting, with v(a)v(a)v(a) the selected outcome. Given any real table Q(a,x)Q(a,x)Q(a,x), set A⊆(A→R)A\subseteq(\mathcal A\to\mathbb R)A⊆(A→R), and functions s:A→Rs:\mathcal A\to\mathbb Rs:A→R and p:V→Rp:\mathcal V\to\mathbb Rp:V→R, the saddle predicate means precisely

s∈A,p≥0,∑vp(v)=1,∀t∈A, DQ,t(p)≤DQ,s(p),∀r≥0 with ∑vr(v)=1, DQ,s(p)≤DQ,s(r).s\in A,\qquad p\ge0,\qquad \sum_vp(v)=1,\qquad \forall t\in A,\ D_{Q,t}(p)\le D_{Q,s}(p),\qquad \forall r\ge0\text{ with }\sum_vr(v)=1,\ D_{Q,s}(p)\le D_{Q,s}(r).s∈A,p≥0,v∑​p(v)=1,∀t∈A, DQ,t​(p)≤DQ,s​(p),∀r≥0 with v∑​r(v)=1, DQ,s​(p)≤DQ,s​(r).

For any setting function uuu and potential function hhh, put Lh(a,x)=∑v: v(a)=xh(v)L_h(a,x)=\sum_{v:\,v(a)=x}h(v)Lh​(a,x)=∑v:v(a)=x​h(v), q(a,x)=u(a)Q(a,x)q(a,x)=u(a)Q(a,x)q(a,x)=u(a)Q(a,x), and ℓ(a,x)=u(a)Lh(a,x)\ell(a,x)=u(a)L_h(a,x)ℓ(a,x)=u(a)Lh​(a,x). The payoff DQ,u(h)D_{Q,u}(h)DQ,u​(h) is +∞+\infty+∞ if some trial satisfies q>0q>0q>0 and ℓ=0\ell=0ℓ=0; otherwise it is the nonnegative truncation of ∑a,xq(a,x)log⁡2(q(a,x)/ℓ(a,x))\sum_{a,x}q(a,x)\log_2(q(a,x)/\ell(a,x))∑a,x​q(a,x)log2​(q(a,x)/ℓ(a,x)), with each term defined as zero when q(a,x)=0q(a,x)=0q(a,x)=0. Division by zero is zero, and the total real logarithm is zero at zero and uses absolute values at negative arguments. The inequalities are non-strict inequalities of extended nonnegative reals, so infinite payoffs are allowed. No positivity or normalization is imposed on QQQ or on members of AAA; if AAA is empty, no pair satisfies this predicate.

QAlgorithms.Papers.Independent.Intakethird100.P80.Settings

For a Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, its set of settings consists of all functions sss assigning to every party i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1} a setting si∈{0,…,mi−1}s_i\in\{0,\ldots,m_i-1\}si​∈{0,…,mi​−1}. Thus a setting is a simultaneous choice of one setting for each party.

QAlgorithms.Papers.Independent.Intakethird100.P80.Sigma

For a Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, Σ(S)\Sigma(S)Σ(S) is the standard real simplex on the finite set of setting tuples: its elements are functions σ\sigmaσ assigning a real number to every tuple sss with 0≤si<mi0\le s_i<m_i0≤si​<mi​, subject to σ(s)≥0\sigma(s)\ge0σ(s)≥0 for every sss and ∑sσ(s)=1\sum_s\sigma(s)=1∑s​σ(s)=1. Coordinates may be zero.

QAlgorithms.Papers.Independent.Intakethird100.P80.Table

For a Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, a table is an arbitrary real-valued function Q(s,x)Q(s,x)Q(s,x), defined for every setting tuple sss satisfying 0≤si<mi0\le s_i<m_i0≤si​<mi​ and every outcome tuple xxx satisfying 0≤xi<ri,si0\le x_i<r_{i,s_i}0≤xi​<ri,si​​. This definition imposes no nonnegativity, normalization, or consistency conditions on those real values.

QAlgorithms.Papers.Independent.Intakethird100.P80.TwoByTwo

For a Bell experiment SSS, which already specifies a positive number of parties, a positive number of settings per party, and a positive number of outcomes at each local setting, the two-by-two predicate means that there are exactly two parties and that each party has exactly two settings:

S.parties=2and∀i∈{0,…,S.parties−1}, S.settings(i)=2.S.\mathrm{parties}=2 \quad\text{and}\quad \forall i\in\{0,\ldots,S.\mathrm{parties}-1\},\ S.\mathrm{settings}(i)=2.S.parties=2and∀i∈{0,…,S.parties−1}, S.settings(i)=2.

It places no further restriction on the positive outcome counts.

QAlgorithms.Papers.Independent.Intakethird100.P80.Uncorrelated

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts at every party and setting, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}. For an arbitrary function s:A→Rs:A\to\mathbb Rs:A→R, this predicate says that there exist functions pi:{0,…,mi−1}→Rp_i:\{0,\ldots,m_i-1\}\to\mathbb Rpi​:{0,…,mi​−1}→R, one for each party, such that pi(b)≥0p_i(b)\geq0pi​(b)≥0, ∑b=0mi−1pi(b)=1\sum_{b=0}^{m_i-1}p_i(b)=1∑b=0mi​−1​pi​(b)=1, and s(a)=∏ipi(ai)s(a)=\prod_i p_i(a_i)s(a)=∏i​pi​(ai​) for every a∈Aa\in Aa∈A. The coordinates of the pip_ipi​, and consequently some coordinates of sss, may be zero.

QAlgorithms.Papers.Independent.Intakethird100.P80.bayesMarginal

For every Bell experiment SSS with a positive number kkk of parties, positive setting counts mim_imi​, and positive outcome counts oiao_{ia}oia​, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, Z=∐a∈AXaZ=\coprod_{a\in A}X_aZ=∐a∈A​Xa​, and V=∏i∏a=0mi−1{0,…,oia−1}V=\prod_i\prod_{a=0}^{m_i-1}\{0,\ldots,o_{ia}-1\}V=∏i​∏a=0mi​−1​{0,…,oia​−1}. Let ν\nuν be the (∣V∣−1)(|V|-1)(∣V∣−1)-dimensional Hausdorff measure on RV\mathbb R^VRV restricted to the probability simplex ΔV\Delta_VΔV​. For every real-valued function sss on AAA, every function w:RV→Rw:\mathbb R^V\to\mathbb Rw:RV→R, every natural number nnn, and every sample z:{0,…,n−1}→Zz:\{0,\ldots,n-1\}\to Zz:{0,…,n−1}→Z, write zj=(aj,xj)z_j=(a_j,x_j)zj​=(aj​,xj​) and define Lp(a,x)=∑v: ∀i, vi,ai=xip(v)L_p(a,x)=\sum_{v:\,\forall i,\ v_{i,a_i}=x_i}p(v)Lp​(a,x)=∑v:∀i, vi,ai​​=xi​​p(v). This definition assigns the real integral

B(s,w,z)=∫RVw(p)∏j=0n−1(s(aj)Lp(aj,xj)) dν(p).B(s,w,z)=\int_{\mathbb R^V} w(p)\prod_{j=0}^{n-1}\bigl(s(a_j)L_p(a_j,x_j)\bigr)\,d\nu(p).B(s,w,z)=∫RV​w(p)j=0∏n−1​(s(aj​)Lp​(aj​,xj​))dν(p).

No probability, admissibility, or integrability hypotheses are supplied for sss or www; the integral uses the total real-valued integral convention, which returns 000 for a nonintegrable integrand. For n=0n=0n=0, the product is 111, so the value is ∫w dν\int w\,d\nu∫wdν.

QAlgorithms.Papers.Independent.Intakethird100.P80.binaryScenario

For every pair of natural numbers k,mk,mk,m, together with hypotheses 0<k0<k0<k and 0<m0<m0<m, this defines a Bell experiment with exactly kkk parties indexed by {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1}, exactly mmm settings at each party indexed by {0,…,m−1}\{0,\ldots,m-1\}{0,…,m−1}, and exactly two outcomes, indexed by {0,1}\{0,1\}{0,1}, at every setting of every party. The supplied inequalities establish positivity of the party and setting counts, and the outcome count is positive because it is 222; the cases k=0k=0k=0 and m=0m=0m=0 cannot satisfy the required hypotheses.

QAlgorithms.Papers.Independent.Intakethird100.P80.chshLocal

For every assignment vvv specifying a binary outcome vi,a∈{0,1}v_{i,a}\in\{0,1\}vi,a​∈{0,1} for each party i∈{0,1}i\in\{0,1\}i∈{0,1} and each setting a∈{0,1}a\in\{0,1\}a∈{0,1}, this defines a real-valued function equal to 1/81/81/8 when

(v0,0,v0,1,v1,0,v1,1)∈{(0,0,0,0),(1,1,1,1),(0,0,0,1),(1,1,1,0),(0,0,1,0),(1,1,0,1),(1,0,0,1),(0,1,1,0)},(v_{0,0},v_{0,1},v_{1,0},v_{1,1}) \in \{(0,0,0,0),(1,1,1,1),(0,0,0,1),(1,1,1,0), (0,0,1,0),(1,1,0,1),(1,0,0,1),(0,1,1,0)\},(v0,0​,v0,1​,v1,0​,v1,1​)∈{(0,0,0,0),(1,1,1,1),(0,0,0,1),(1,1,1,0),(0,0,1,0),(1,1,0,1),(1,0,0,1),(0,1,1,0)},

and equal to 000 for every other assignment.

QAlgorithms.Papers.Independent.Intakethird100.P80.chshTable

For two parties indexed by 0,10,10,1, each with settings and outcomes in {0,1}\{0,1\}{0,1}, this defines a real-valued table for every setting pair s=(s0,s1)s=(s_0,s_1)s=(s0​,s1​) and outcome pair x=(x0,x1)x=(x_0,x_1)x=(x0​,x1​) by

Q(s,x)={14+28,(x0≠x1) ⟺ (s0=s1=1),14−28,otherwise.Q(s,x)= \begin{cases} \frac14+\frac{\sqrt2}{8}, & (x_0\ne x_1)\ \Longleftrightarrow\ (s_0=s_1=1),\\ \frac14-\frac{\sqrt2}{8},&\text{otherwise}. \end{cases}Q(s,x)={41​+82​​,41​−82​​,​(x0​=x1​) ⟺ (s0​=s1​=1),otherwise.​

QAlgorithms.Papers.Independent.Intakethird100.P80.correlatedStrength

Let SSS specify k>0k>0k>0 parties, a positive number of settings for each party, and a positive number of outcomes for each local setting. Write A\mathcal AA for the set of joint settings, Xa\mathcal X_aXa​ for the joint outcomes at setting aaa, and V\mathcal VV for the potential assignments that specify an outcome for every local setting of every party; write v(a)v(a)v(a) for the joint outcome selected from vvv at aaa. For an arbitrary real table Q(a,x)Q(a,x)Q(a,x), the correlated strength is

sup⁡s:A→Rs≥0, ∑as(a)=1 inf⁡p:V→Rp≥0, ∑vp(v)=1DQ,s(p) ∈[0,∞].\sup_{\substack{s:\mathcal A\to\mathbb R\\s\ge0,\ \sum_a s(a)=1}} \ \inf_{\substack{p:\mathcal V\to\mathbb R\\p\ge0,\ \sum_v p(v)=1}} D_{Q,s}(p)\ \in[0,\infty].s:A→Rs≥0, ∑a​s(a)=1​sup​ p:V→Rp≥0, ∑v​p(v)=1​inf​DQ,s​(p) ∈[0,∞].

Here Lp(a,x)=∑v: v(a)=xp(v)L_p(a,x)=\sum_{v:\,v(a)=x}p(v)Lp​(a,x)=∑v:v(a)=x​p(v), and DQ,s(p)D_{Q,s}(p)DQ,s​(p) is +∞+\infty+∞ if some (a,x)(a,x)(a,x) satisfies s(a)Q(a,x)>0s(a)Q(a,x)>0s(a)Q(a,x)>0 and s(a)Lp(a,x)=0s(a)L_p(a,x)=0s(a)Lp​(a,x)=0; otherwise it is

max⁡ ⁣{0, ∑a∈A∑x∈Xa{0,s(a)Q(a,x)=0,s(a)Q(a,x)log⁡2 ⁣s(a)Q(a,x)s(a)Lp(a,x),s(a)Q(a,x)≠0.}.\max\!\left\{0,\ \sum_{a\in\mathcal A}\sum_{x\in\mathcal X_a} \begin{cases} 0,&s(a)Q(a,x)=0,\\ s(a)Q(a,x)\log_2\!\dfrac{s(a)Q(a,x)}{s(a)L_p(a,x)},&s(a)Q(a,x)\ne0. \end{cases}\right\}.max⎩⎨⎧​0, a∈A∑​x∈Xa​∑​⎩⎨⎧​0,s(a)Q(a,x)log2​s(a)Lp​(a,x)s(a)Q(a,x)​,​s(a)Q(a,x)=0,s(a)Q(a,x)=0.​⎭⎬⎫​.

The maximum is regarded as an extended nonnegative real. Division by zero is defined as zero, and the total real logarithm satisfies log⁡20=0\log_2 0=0log2​0=0 and log⁡2u=log⁡2∣u∣\log_2 u=\log_2|u|log2​u=log2​∣u∣ for u<0u<0u<0. No positivity or normalization hypothesis is imposed on QQQ, and neither extremum is asserted to be attained.

QAlgorithms.Papers.Independent.Intakethird100.P80.ghzAllowed

For three parties indexed by 0,1,20,1,20,1,2, each with settings and outcomes in {0,1}\{0,1\}{0,1}, this defines a predicate on every setting triple s=(s0,s1,s2)s=(s_0,s_1,s_2)s=(s0​,s1​,s2​) and outcome triple x=(x0,x1,x2)x=(x_0,x_1,x_2)x=(x0​,x1​,x2​) by

(x0+x1+x2) mod 2={1,s0=s1=s2=0,0,otherwise.(x_0+x_1+x_2)\bmod 2= \begin{cases} 1,&s_0=s_1=s_2=0,\\ 0,&\text{otherwise}. \end{cases}(x0​+x1​+x2​)mod2={1,0,​s0​=s1​=s2​=0,otherwise.​

Thus the required outcome parity is odd at the all-zero setting and even at every other setting, including settings whose sum is 111 or 333.

QAlgorithms.Papers.Independent.Intakethird100.P80.ghzConstrained

For three parties indexed by 0,1,20,1,20,1,2, each with settings in {0,1}\{0,1\}{0,1}, this defines a predicate on every setting triple s=(s0,s1,s2)s=(s_0,s_1,s_2)s=(s0​,s1​,s2​): it holds exactly when the ordinary integer sum s0+s1+s2s_0+s_1+s_2s0​+s1​+s2​ equals 000 or 222.

QAlgorithms.Papers.Independent.Intakethird100.P80.ghzCorrelatedSettings

For three parties indexed by 0,1,20,1,20,1,2, each with settings in {0,1}\{0,1\}{0,1}, this defines a real-valued function on every setting triple s=(s0,s1,s2)s=(s_0,s_1,s_2)s=(s0​,s1​,s2​), equal to 1/41/41/4 when s0+s1+s2s_0+s_1+s_2s0​+s1​+s2​ is 000 or 222, and equal to 000 when that sum is 111 or 333.

QAlgorithms.Papers.Independent.Intakethird100.P80.ghzLocalTable

For three parties indexed by 0,1,20,1,20,1,2, each with settings and outcomes in {0,1}\{0,1\}{0,1}, this defines a real-valued table for every setting triple sss and outcome triple xxx. Write r=s0+s1+s2r=s_0+s_1+s_2r=s0​+s1​+s2​ and e=(x0+x1+x2) mod 2e=(x_0+x_1+x_2)\bmod 2e=(x0​+x1​+x2​)mod2; then

Q(s,x)={316,(r=0 and e=1) or (r=2 and e=0),116,(r=0 and e=0) or (r=2 and e=1),18,r=1 or r=3.Q(s,x)= \begin{cases} \frac{3}{16},&(r=0\text{ and }e=1)\text{ or }(r=2\text{ and }e=0),\\ \frac{1}{16},&(r=0\text{ and }e=0)\text{ or }(r=2\text{ and }e=1),\\ \frac18,&r=1\text{ or }r=3. \end{cases}Q(s,x)=⎩⎨⎧​163​,161​,81​,​(r=0 and e=1) or (r=2 and e=0),(r=0 and e=0) or (r=2 and e=1),r=1 or r=3.​

QAlgorithms.Papers.Independent.Intakethird100.P80.ghzTable

For three parties indexed by 0,1,20,1,20,1,2, each with settings and outcomes in {0,1}\{0,1\}{0,1}, this defines a real-valued table for every setting triple sss and outcome triple xxx. Write r=s0+s1+s2r=s_0+s_1+s_2r=s0​+s1​+s2​ and e=(x0+x1+x2) mod 2e=(x_0+x_1+x_2)\bmod 2e=(x0​+x1​+x2​)mod2; then

Q(s,x)={14,(r=0 and e=1) or (r=2 and e=0),0,(r=0 and e=0) or (r=2 and e=1),18,r=1 or r=3.Q(s,x)= \begin{cases} \frac14,&(r=0\text{ and }e=1)\text{ or }(r=2\text{ and }e=0),\\ 0,&(r=0\text{ and }e=0)\text{ or }(r=2\text{ and }e=1),\\ \frac18,&r=1\text{ or }r=3. \end{cases}Q(s,x)=⎩⎨⎧​41​,0,81​,​(r=0 and e=1) or (r=2 and e=0),(r=0 and e=0) or (r=2 and e=1),r=1 or r=3.​

QAlgorithms.Papers.Independent.Intakethird100.P80.hardy

For two parties indexed by 0,10,10,1, each with settings and outcomes in {0,1}\{0,1\}{0,1}, this defines a real-valued table for every setting pair s=(s0,s1)s=(s_0,s_1)s=(s0​,s1​) and outcome pair x=(x0,x1)x=(x_0,x_1)x=(x0​,x1​) as follows: let α=2+2−13+65/2\alpha=\sqrt{2+2\sqrt{-13+6\sqrt5}}/2α=2+2−13+65​​​/2, β=1−α2\beta=\sqrt{1-\alpha^2}β=1−α2​, and

(u0,v0)=(βα+β,αα+β),(u1,v1)=(−β3α3+β3,α3α3+β3).(u_0,v_0)= \left(\sqrt{\frac{\beta}{\alpha+\beta}}, \sqrt{\frac{\alpha}{\alpha+\beta}}\right), \qquad (u_1,v_1)= \left(-\sqrt{\frac{\beta^3}{\alpha^3+\beta^3}}, \sqrt{\frac{\alpha^3}{\alpha^3+\beta^3}}\right).(u0​,v0​)=(α+ββ​​,α+βα​​),(u1​,v1​)=(−α3+β3β3​​,α3+β3α3​​).

For each a∈{0,1}a\in\{0,1\}a∈{0,1}, set (w(a,1,0),w(a,1,1))=(ua,va)(w(a,1,0),w(a,1,1))=(u_a,v_a)(w(a,1,0),w(a,1,1))=(ua​,va​) and (w(a,0,0),w(a,0,1))=(−va,ua)(w(a,0,0),w(a,0,1))=(-v_a,u_a)(w(a,0,0),w(a,0,1))=(−va​,ua​); then the table is

Q(s,x)=(α w(s0,x0,0)w(s1,x1,0)−β w(s0,x0,1)w(s1,x1,1))2.Q(s,x)= \left( \alpha\,w(s_0,x_0,0)w(s_1,x_1,0) -\beta\,w(s_0,x_0,1)w(s_1,x_1,1) \right)^2.Q(s,x)=(αw(s0​,x0​,0)w(s1​,x1​,0)−βw(s0​,x0​,1)w(s1​,x1​,1))2.

QAlgorithms.Papers.Independent.Intakethird100.P80.hardyAlpha

This defines the real number

α= 2+2−13+65 2.\alpha=\frac{\sqrt{\,2+2\sqrt{-13+6\sqrt5}\,}}{2}.α=22+2−13+65​​​​.

QAlgorithms.Papers.Independent.Intakethird100.P80.hardyBeta

This defines the real number

β=1−α2,α= 2+2−13+65 2.\beta=\sqrt{1-\alpha^2}, \qquad \alpha=\frac{\sqrt{\,2+2\sqrt{-13+6\sqrt5}\,}}{2}.β=1−α2​,α=22+2−13+65​​​​.

QAlgorithms.Papers.Independent.Intakethird100.P80.hardyVector

For every a,x,j∈{0,1}a,x,j\in\{0,1\}a,x,j∈{0,1}, this defines a real number w(a,x,j)w(a,x,j)w(a,x,j) as follows: put α=2+2−13+65/2\alpha=\sqrt{2+2\sqrt{-13+6\sqrt5}}/2α=2+2−13+65​​​/2 and β=1−α2\beta=\sqrt{1-\alpha^2}β=1−α2​, and define

ua={βα+β,a=0,−β3α3+β3,a=1,va={αα+β,a=0,α3α3+β3,a=1.u_a= \begin{cases} \sqrt{\frac{\beta}{\alpha+\beta}},&a=0,\\ -\sqrt{\frac{\beta^3}{\alpha^3+\beta^3}},&a=1, \end{cases} \qquad v_a= \begin{cases} \sqrt{\frac{\alpha}{\alpha+\beta}},&a=0,\\ \sqrt{\frac{\alpha^3}{\alpha^3+\beta^3}},&a=1. \end{cases}ua​=⎩⎨⎧​α+ββ​​,−α3+β3β3​​,​a=0,a=1,​va​=⎩⎨⎧​α+βα​​,α3+β3α3​​,​a=0,a=1.​

The values for both coordinate indices are specified by

(w(a,1,0),w(a,1,1))=(ua,va),(w(a,0,0),w(a,0,1))=(−va,ua).\bigl(w(a,1,0),w(a,1,1)\bigr)=(u_a,v_a), \qquad \bigl(w(a,0,0),w(a,0,1)\bigr)=(-v_a,u_a).(w(a,1,0),w(a,1,1))=(ua​,va​),(w(a,0,0),w(a,0,1))=(−va​,ua​).

QAlgorithms.Papers.Independent.Intakethird100.P80.idealLength

For any type ZZZ, any real-valued function p:Z→Rp:Z\to\mathbb Rp:Z→R, any natural number nnn, and any sample z:{0,…,n−1}→Zz:\{0,\ldots,n-1\}\to Zz:{0,…,n−1}→Z, put Lp(z)=∏i=0n−1p(z(i))L_p(z)=\prod_{i=0}^{n-1}p(z(i))Lp​(z)=∏i=0n−1​p(z(i)). The extended nonnegative real number called the ideal length is

idealLength⁡(p,z)={+∞,Lp(z)=0,max⁡{0,−log⁡2Lp(z)},Lp(z)≠0.\operatorname{idealLength}(p,z)= \begin{cases} +\infty,&L_p(z)=0,\\ \max\{0,-\log_2 L_p(z)\},&L_p(z)\ne0. \end{cases}idealLength(p,z)={+∞,max{0,−log2​Lp​(z)},​Lp​(z)=0,Lp​(z)=0.​

Here the finite value is embedded in [0,+∞][0,+\infty][0,+∞], and the real logarithm is total: for a nonzero negative argument, log⁡2t=log⁡∣t∣/log⁡2\log_2 t=\log|t|/\log2log2​t=log∣t∣/log2. No nonnegativity or normalization assumption is imposed on ppp. When n=0n=0n=0, the empty product is 111, so the ideal length is 000.

QAlgorithms.Papers.Independent.Intakethird100.P80.iidLaw

For every Bell experiment SSS with a positive number kkk of parties, positive setting counts mim_imi​, and positive outcome counts oiao_{ia}oia​, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, and Z=∐a∈AXaZ=\coprod_{a\in A}X_aZ=∐a∈A​Xa​, with every subset of ZZZ measurable. For every real-valued table Q(a,x)Q(a,x)Q(a,x) and real-valued setting function s(a)s(a)s(a), this definition applies the countable infinite-product measure construction to the constant family of measures

μQ,s=∑(a,x)∈Zmax⁡{s(a)Q(a,x),0} δ(a,x),\mu_{Q,s}=\sum_{(a,x)\in Z}\max\{s(a)Q(a,x),0\}\,\delta_{(a,x)},μQ,s​=(a,x)∈Z∑​max{s(a)Q(a,x),0}δ(a,x)​,

producing a measure on sequences ZNZ^{\mathbb N}ZN. No hypothesis requires QQQ, sss, or μQ,s\mu_{Q,s}μQ,s​ to be normalized probability data.

QAlgorithms.Papers.Independent.Intakethird100.P80.initialTrials

For any type ZZZ, any sequence z:N→Zz:\mathbb N\to Zz:N→Z, and any natural number nnn, initialTrials⁡(z,n)\operatorname{initialTrials}(z,n)initialTrials(z,n) is the function on {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1} given by i↦z(i)i\mapsto z(i)i↦z(i). Thus it records the first nnn entries, starting at index 000; when n=0n=0n=0, it is the unique function from the empty set to ZZZ.

QAlgorithms.Papers.Independent.Intakethird100.P80.kl

For any finite type III, equipped with a finite enumeration, and arbitrary functions q,p:I→Rq,p:I\to\mathbb Rq,p:I→R, this definition gives a value in [0,∞][0,\infty][0,∞]: it is +∞+\infty+∞ if there exists x∈Ix\in Ix∈I with q(x)>0q(x)>0q(x)>0 and p(x)=0p(x)=0p(x)=0; otherwise it is max⁡{0,∑x∈Ih(x)}\max\{0,\sum_{x\in I}h(x)\}max{0,∑x∈I​h(x)}, regarded as a finite nonnegative extended real, where h(x)=0h(x)=0h(x)=0 when q(x)=0q(x)=0q(x)=0 and h(x)=q(x)log⁡2(q(x)/p(x))h(x)=q(x)\log_2(q(x)/p(x))h(x)=q(x)log2​(q(x)/p(x)) otherwise. Neither function is assumed nonnegative or normalized. Division by zero is defined to be zero, and the real logarithm used here satisfies log⁡2(0)=0\log_2(0)=0log2​(0)=0 and log⁡2(r)=log⁡∣r∣/log⁡2\log_2(r)=\log|r|/\log2log2​(r)=log∣r∣/log2 for r≠0r\ne0r=0. Thus a zero denominator triggers infinity only when the corresponding numerator is strictly positive. For empty III, the value is zero.

QAlgorithms.Papers.Independent.Intakethird100.P80.localTable

For any Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, and any real-valued function ppp on all potential assignments vvv, where 0≤vi,a<ri,a0\le v_{i,a}<r_{i,a}0≤vi,a​<ri,a​, the associated table is defined, for every setting tuple sss and permitted outcome tuple xxx, by

Lp(s,x)=∑v∀i, vi,si=xip(v).L_p(s,x)=\sum_{\substack{v\\ \forall i,\ v_{i,s_i}=x_i}}p(v).Lp​(s,x)=v∀i, vi,si​​=xi​​∑​p(v).

The sum ranges over all potential assignments whose selected outcomes equal xxx at every party. There is no assumption that ppp is nonnegative or sums to one; an empty sum is zero.

QAlgorithms.Papers.Independent.Intakethird100.P80.localTensorEffect

For any Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, choose arbitrary natural numbers did_idi​ and, for every party iii, setting aaa, and outcome b∈{0,…,ri,a−1}b\in\{0,\ldots,r_{i,a}-1\}b∈{0,…,ri,a​−1}, an arbitrary complex di×did_i\times d_idi​×di​ matrix Mi,a,bM_{i,a,b}Mi,a,b​. For any setting tuple sss and permitted outcome tuple xxx, define a complex matrix Es,xE_{s,x}Es,x​ indexed by tuples u,v∈∏i{0,…,di−1}u,v\in\prod_i\{0,\ldots,d_i-1\}u,v∈∏i​{0,…,di​−1} through

Es,x(u,v)=∏i=0n−1Mi,si,xi(ui,vi).E_{s,x}(u,v)=\prod_{i=0}^{n-1}M_{i,s_i,x_i}(u_i,v_i).Es,x​(u,v)=i=0∏n−1​Mi,si​,xi​​(ui​,vi​).

No positivity, normalization, or positive-dimension assumptions are imposed. In particular, if any di=0d_i=0di​=0, the matrix’s indexing set is empty.

QAlgorithms.Papers.Independent.Intakethird100.P80.lowerValue

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts oi,ao_{i,a}oi,a​, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, and V=∏i∏b=0mi−1{0,…,oi,b−1}V=\prod_i\prod_{b=0}^{m_i-1}\{0,\ldots,o_{i,b}-1\}V=∏i​∏b=0mi​−1​{0,…,oi,b​−1}. Given an arbitrary real table Q(a,x)Q(a,x)Q(a,x) and arbitrary s:A→Rs:A\to\mathbb Rs:A→R, this definition is the infimum in [0,∞][0,\infty][0,∞], over all p:V→Rp:V\to\mathbb Rp:V→R with p(v)≥0p(v)\geq0p(v)≥0 and ∑vp(v)=1\sum_vp(v)=1∑v​p(v)=1, of the following quantity: set qa,x=s(a)Q(a,x)q_{a,x}=s(a)Q(a,x)qa,x​=s(a)Q(a,x) and ra,x=s(a)∑v: ∀i, vi,ai=xip(v)r_{a,x}=s(a)\sum_{v:\,\forall i,\ v_{i,a_i}=x_i}p(v)ra,x​=s(a)∑v:∀i, vi,ai​​=xi​​p(v); the quantity is +∞+\infty+∞ if some qa,x>0q_{a,x}>0qa,x​>0 has ra,x=0r_{a,x}=0ra,x​=0, and otherwise is max⁡{0,∑a,x: qa,x≠0qa,xlog⁡2(qa,x/ra,x)}\max\{0,\sum_{a,x:\,q_{a,x}\ne0}q_{a,x}\log_2(q_{a,x}/r_{a,x})\}max{0,∑a,x:qa,x​=0​qa,x​log2​(qa,x​/ra,x​)}. Division by zero is zero, log⁡2(0)=0\log_2(0)=0log2​(0)=0, and log⁡2(t)=log⁡∣t∣/log⁡2\log_2(t)=\log|t|/\log2log2​(t)=log∣t∣/log2 for t≠0t\ne0t=0. Neither QQQ nor sss is required to be nonnegative or normalized, and no attainment of the infimum is asserted.

QAlgorithms.Papers.Independent.Intakethird100.P80.mermin

For two parties indexed by 0,10,10,1, each with settings in {0,1,2}\{0,1,2\}{0,1,2} and outcomes in {0,1}\{0,1\}{0,1}, this defines a real-valued table for every setting pair s=(s0,s1)s=(s_0,s_1)s=(s0​,s1​) and outcome pair x=(x0,x1)x=(x_0,x_1)x=(x0​,x1​) by

Q(s,x)={12,s0=s1 and x0=x1,0,s0=s1 and x0≠x1,18,s0≠s1 and x0=x1,38,s0≠s1 and x0≠x1.Q(s,x)= \begin{cases} \frac12,&s_0=s_1\text{ and }x_0=x_1,\\ 0,&s_0=s_1\text{ and }x_0\ne x_1,\\ \frac18,&s_0\ne s_1\text{ and }x_0=x_1,\\ \frac38,&s_0\ne s_1\text{ and }x_0\ne x_1. \end{cases}Q(s,x)=⎩⎨⎧​21​,0,81​,83​,​s0​=s1​ and x0​=x1​,s0​=s1​ and x0​=x1​,s0​=s1​ and x0​=x1​,s0​=s1​ and x0​=x1​.​

QAlgorithms.Papers.Independent.Intakethird100.P80.minimax

Let SSS specify a positive finite number of parties, positive finite setting counts, and positive finite outcome counts for every local setting. Write A\mathcal AA for the joint settings, Xa\mathcal X_aXa​ for the outcomes at aaa, and V\mathcal VV for the assignments of outcomes to all local settings; let v(a)v(a)v(a) be the outcome selected at aaa. For any real table Q(a,x)Q(a,x)Q(a,x) and any set A⊆(A→R)A\subseteq(\mathcal A\to\mathbb R)A⊆(A→R), define

minimax⁡(Q,A)=inf⁡p:V→Rp≥0, ∑vp(v)=1 sup⁡s∈ADQ,s(p) ∈[0,∞].\operatorname{minimax}(Q,A)= \inf_{\substack{p:\mathcal V\to\mathbb R\\p\ge0,\ \sum_vp(v)=1}} \ \sup_{s\in A}D_{Q,s}(p)\ \in[0,\infty].minimax(Q,A)=p:V→Rp≥0, ∑v​p(v)=1​inf​ s∈Asup​DQ,s​(p) ∈[0,∞].

Here Lp(a,x)=∑v: v(a)=xp(v)L_p(a,x)=\sum_{v:\,v(a)=x}p(v)Lp​(a,x)=∑v:v(a)=x​p(v). With q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x) and r(a,x)=s(a)Lp(a,x)r(a,x)=s(a)L_p(a,x)r(a,x)=s(a)Lp​(a,x), the payoff is +∞+\infty+∞ if some (a,x)(a,x)(a,x) has q(a,x)>0q(a,x)>0q(a,x)>0 and r(a,x)=0r(a,x)=0r(a,x)=0; otherwise it equals

max⁡ ⁣{0, ∑a,x{0,q(a,x)=0,q(a,x)log⁡2 ⁣(q(a,x)/r(a,x)),q(a,x)≠0.}.\max\!\left\{0,\ \sum_{a,x} \begin{cases} 0,&q(a,x)=0,\\ q(a,x)\log_2\!\bigl(q(a,x)/r(a,x)\bigr),&q(a,x)\ne0. \end{cases}\right\}.max{0, a,x∑​{0,q(a,x)log2​(q(a,x)/r(a,x)),​q(a,x)=0,q(a,x)=0.​}.

Division by zero is zero, and the total real logarithm is zero at zero and equals the logarithm of the absolute value at negative arguments. No normalization or positivity is required of QQQ or of the functions in AAA. The set AAA may be empty, giving minimax value zero; attainment of the infimum or supremum is not part of the definition.

QAlgorithms.Papers.Independent.Intakethird100.P80.minimizers

Let SSS consist of a positive finite number of parties, each with positive finite setting counts and positive finite outcome counts at each setting. Let A\mathcal AA denote the joint settings, Xa\mathcal X_aXa​ their joint outcomes, and V\mathcal VV the assignments of outcomes to all local settings, with v(a)v(a)v(a) the selected outcome. For any real table Q(a,x)Q(a,x)Q(a,x) and set A⊆(A→R)A\subseteq(\mathcal A\to\mathbb R)A⊆(A→R), the minimizers are exactly the functions p:V→Rp:\mathcal V\to\mathbb Rp:V→R satisfying

p≥0,∑vp(v)=1,sup⁡s∈ADQ,s(p)=inf⁡r:V→Rr≥0, ∑vr(v)=1sup⁡s∈ADQ,s(r).p\ge0,\qquad \sum_vp(v)=1,\qquad \sup_{s\in A}D_{Q,s}(p)= \inf_{\substack{r:\mathcal V\to\mathbb R\\r\ge0,\ \sum_vr(v)=1}} \sup_{s\in A}D_{Q,s}(r).p≥0,v∑​p(v)=1,s∈Asup​DQ,s​(p)=r:V→Rr≥0, ∑v​r(v)=1​inf​s∈Asup​DQ,s​(r).

Here Lh(a,x)=∑v: v(a)=xh(v)L_h(a,x)=\sum_{v:\,v(a)=x}h(v)Lh​(a,x)=∑v:v(a)=x​h(v); for q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x) and ℓ(a,x)=s(a)Lh(a,x)\ell(a,x)=s(a)L_h(a,x)ℓ(a,x)=s(a)Lh​(a,x), DQ,s(h)D_{Q,s}(h)DQ,s​(h) is +∞+\infty+∞ if some trial has q>0q>0q>0 and ℓ=0\ell=0ℓ=0, and otherwise is the nonnegative truncation of ∑a,xq(a,x)log⁡2(q(a,x)/ℓ(a,x))\sum_{a,x}q(a,x)\log_2(q(a,x)/\ell(a,x))∑a,x​q(a,x)log2​(q(a,x)/ℓ(a,x)), with a zero term whenever q(a,x)=0q(a,x)=0q(a,x)=0. Division by zero is zero, and the total real logarithm is zero at zero and uses absolute values at negative arguments. Neither QQQ nor the elements of AAA are required to be probability distributions. The definition does not assert existence or uniqueness of a minimizer; equality at +∞+\infty+∞ is permitted. If AAA is empty, every probability distribution on V\mathcal VV belongs to this set.

QAlgorithms.Papers.Independent.Intakethird100.P80.optimizedBell

In the experiment with two parties, two settings per party, and two outcomes per setting, this defines a real table for every setting pair (a,b)∈{0,1}2(a,b)\in\{0,1\}^2(a,b)∈{0,1}2 and outcome pair (x,y)∈{0,1}2(x,y)\in\{0,1\}^2(x,y)∈{0,1}2 by

Q(a,b)(x,y)={12,(a,b)=(0,0) and x=y,0,(a,b)=(0,0) and x≠y,18,(a,b)=(0,1) and x=y,38,(a,b)=(0,1) and x≠y,38,a=1 and x=y,18,a=1 and x≠y.Q_{(a,b)}(x,y)= \begin{cases} \frac12,&(a,b)=(0,0)\ \text{and}\ x=y,\\ 0,&(a,b)=(0,0)\ \text{and}\ x\ne y,\\ \frac18,&(a,b)=(0,1)\ \text{and}\ x=y,\\ \frac38,&(a,b)=(0,1)\ \text{and}\ x\ne y,\\ \frac38,&a=1\ \text{and}\ x=y,\\ \frac18,&a=1\ \text{and}\ x\ne y. \end{cases}Q(a,b)​(x,y)=⎩⎨⎧​21​,0,81​,83​,83​,81​,​(a,b)=(0,0) and x=y,(a,b)=(0,0) and x=y,(a,b)=(0,1) and x=y,(a,b)=(0,1) and x=y,a=1 and x=y,a=1 and x=y.​

Each listed value is assigned to each individual outcome pair satisfying its case.

QAlgorithms.Papers.Independent.Intakethird100.P80.optimizerScore

Let SSS specify a positive finite number of parties, positive finite setting counts, and positive finite outcome counts at each local setting. Write A\mathcal AA for the joint settings, Xa\mathcal X_aXa​ for their joint outcomes, and V\mathcal VV for the assignments of outcomes to every local setting, with v(a)∈Xav(a)\in\mathcal X_av(a)∈Xa​ the outcome selected from vvv. Given any real table Q(a,x)Q(a,x)Q(a,x), any functions s:A→Rs:\mathcal A\to\mathbb Rs:A→R and p:V→Rp:\mathcal V\to\mathbb Rp:V→R, and any v∈Vv\in\mathcal Vv∈V, the optimizer score is the real number

∑a∈A{0,Q(a,v(a))=0,s(a)Q(a,v(a))∑u∈Vu(a)=v(a)p(u),Q(a,v(a))≠0.\sum_{a\in\mathcal A} \begin{cases} 0,&Q(a,v(a))=0,\\[2pt] \dfrac{s(a)Q(a,v(a))} {\displaystyle\sum_{\substack{u\in\mathcal V\\u(a)=v(a)}}p(u)}, &Q(a,v(a))\ne0. \end{cases}a∈A∑​⎩⎨⎧​0,u∈Vu(a)=v(a)​∑​p(u)s(a)Q(a,v(a))​,​Q(a,v(a))=0,Q(a,v(a))=0.​

No probability, normalization, positivity, domination, or optimality assumptions are imposed. The second branch also applies when Q(a,v(a))<0Q(a,v(a))<0Q(a,v(a))<0; if its denominator is zero, that quotient is defined to be zero.

QAlgorithms.Papers.Independent.Intakethird100.P80.originalBell

In the experiment with two parties, two settings per party, and two outcomes per setting, this defines a real table on every setting pair (a,b)∈{0,1}2(a,b)\in\{0,1\}^2(a,b)∈{0,1}2 and outcome pair (x,y)∈{0,1}2(x,y)\in\{0,1\}^2(x,y)∈{0,1}2 by setting α0=0\alpha_0=0α0​=0, α1=π/8\alpha_1=\pi/8α1​=π/8, β0=π/8\beta_0=\pi/8β0​=π/8, and β1=π/4\beta_1=\pi/4β1​=π/4, and then putting

Q(a,b)(x,y)={cos⁡2(αa−βb)2,x=y,sin⁡2(αa−βb)2,x≠y.Q_{(a,b)}(x,y)= \begin{cases} \dfrac{\cos^2(\alpha_a-\beta_b)}{2},&x=y,\\[2pt] \dfrac{\sin^2(\alpha_a-\beta_b)}{2},&x\ne y. \end{cases}Q(a,b)​(x,y)=⎩⎨⎧​2cos2(αa​−βb​)​,2sin2(αa​−βb​)​,​x=y,x=y.​

Each expression specifies the value for an individual outcome pair.

QAlgorithms.Papers.Independent.Intakethird100.P80.posteriorOdds

For every Bell experiment SSS with a positive number kkk of parties, positive setting counts mim_imi​, and positive outcome counts oiao_{ia}oia​, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, Z=∐a∈AXaZ=\coprod_{a\in A}X_aZ=∐a∈A​Xa​, and V=∏i∏a=0mi−1{0,…,oia−1}V=\prod_i\prod_{a=0}^{m_i-1}\{0,\ldots,o_{ia}-1\}V=∏i​∏a=0mi​−1​{0,…,oia​−1}. Let ν\nuν be the (∣V∣−1)(|V|-1)(∣V∣−1)-dimensional Hausdorff measure on RV\mathbb R^VRV restricted to the probability simplex on VVV. For every real-valued table Q(a,x)Q(a,x)Q(a,x), real-valued function sss on AAA, function w:RV→Rw:\mathbb R^V\to\mathbb Rw:RV→R, real number hhh, natural number nnn, and sample z:{0,…,n−1}→Zz:\{0,\ldots,n-1\}\to Zz:{0,…,n−1}→Z, write zj=(aj,xj)z_j=(a_j,x_j)zj​=(aj​,xj​) and set Lp(a,x)=∑v: ∀i, vi,ai=xip(v)L_p(a,x)=\sum_{v:\,\forall i,\ v_{i,a_i}=x_i}p(v)Lp​(a,x)=∑v:∀i, vi,ai​​=xi​​p(v). This definition assigns

h1−h ∏j=0n−1s(aj)Q(aj,xj)∫RVw(p)∏j=0n−1s(aj)Lp(aj,xj) dν(p).\frac{h}{1-h}\, \frac{\displaystyle\prod_{j=0}^{n-1}s(a_j)Q(a_j,x_j)} {\displaystyle\int_{\mathbb R^V} w(p)\prod_{j=0}^{n-1}s(a_j)L_p(a_j,x_j)\,d\nu(p)}.1−hh​∫RV​w(p)j=0∏n−1​s(aj​)Lp​(aj​,xj​)dν(p)j=0∏n−1​s(aj​)Q(aj​,xj​)​.

There are no normalization, admissibility, integrability, or positivity hypotheses, and no restriction 0<h<10<h<10<h<1. The integral is the total real-valued integral, returning 000 for a nonintegrable integrand, and real division by 000 is defined to be 000; consequently the displayed value is 000 if h=1h=1h=1 or if its integral denominator is 000. When n=0n=0n=0, both sample products are 111.

QAlgorithms.Papers.Independent.Intakethird100.P80.potentialAtSetting

For any Bell experiment SSS with n>0n>0n>0 parties, positive setting counts mim_imi​, and positive outcome counts ri,ar_{i,a}ri,a​, any potential assignment vvv specifying vi,a∈{0,…,ri,a−1}v_{i,a}\in\{0,\ldots,r_{i,a}-1\}vi,a​∈{0,…,ri,a​−1} for every party and setting, and any setting tuple sss with 0≤si<mi0\le s_i<m_i0≤si​<mi​, the outcome tuple selected from vvv at sss is defined to have coordinate vi,siv_{i,s_i}vi,si​​ at each party iii. Its iiith coordinate therefore belongs to {0,…,ri,si−1}\{0,\ldots,r_{i,s_i}-1\}{0,…,ri,si​​−1}.

QAlgorithms.Papers.Independent.Intakethird100.P80.productSettings

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts for every local setting, let A=∏i=0k−1{0,…,mi−1}\mathcal A=\prod_{i=0}^{k-1}\{0,\ldots,m_i-1\}A=∏i=0k−1​{0,…,mi​−1}. The set of product settings consists exactly of the functions s:A→Rs:\mathcal A\to\mathbb Rs:A→R such that s(a)≥0s(a)\ge0s(a)≥0 for every aaa, ∑as(a)=1\sum_a s(a)=1∑a​s(a)=1, and there exist functions pi:{0,…,mi−1}→Rp_i:\{0,\ldots,m_i-1\}\to\mathbb Rpi​:{0,…,mi​−1}→R, one for each party, satisfying pi(b)≥0p_i(b)\ge0pi​(b)≥0, ∑bpi(b)=1\sum_b p_i(b)=1∑b​pi​(b)=1, and

s(a)=∏i=0k−1pi(ai)for every a∈A.s(a)=\prod_{i=0}^{k-1}p_i(a_i)\qquad\text{for every }a\in\mathcal A.s(a)=i=0∏k−1​pi​(ai​)for every a∈A.

Zero coordinates and deterministic choices of settings are included; strict positivity is not required.

QAlgorithms.Papers.Independent.Intakethird100.P80.rotatedBellPairLaw

For every pair of real numbers A,BA,BA,B and every pair of outcome labels x,y∈{0,1}x,y\in\{0,1\}x,y∈{0,1}, this defines the real number

rotatedBellPairLaw⁡(A,B,x,y)={cos⁡2(A−B)2,x=y,sin⁡2(A−B)2,x≠y.\operatorname{rotatedBellPairLaw}(A,B,x,y)= \begin{cases} \dfrac{\cos^2(A-B)}{2},&x=y,\\[2pt] \dfrac{\sin^2(A-B)}{2},&x\ne y. \end{cases}rotatedBellPairLaw(A,B,x,y)=⎩⎨⎧​2cos2(A−B)​,2sin2(A−B)​,​x=y,x=y.​

The real parameters A,BA,BA,B are unrestricted, and the displayed value applies to each individual outcome pair.

QAlgorithms.Papers.Independent.Intakethird100.P80.sampleLikelihood

For every type ZZZ, every real-valued function p:Z→Rp:Z\to\mathbb Rp:Z→R, every natural number nnn, and every indexed sample z:{0,…,n−1}→Zz:\{0,\ldots,n-1\}\to Zz:{0,…,n−1}→Z, this definition assigns

sampleLikelihood⁡(p,z)=∏i=0n−1p(zi).\operatorname{sampleLikelihood}(p,z)=\prod_{i=0}^{n-1}p(z_i).sampleLikelihood(p,z)=i=0∏n−1​p(zi​).

The function ppp need not be nonnegative or normalized, ZZZ need not be finite, and repeated sample values are permitted. For n=0n=0n=0, the product is 111, including when ZZZ is empty.

QAlgorithms.Papers.Independent.Intakethird100.P80.shannonBefore

For any type ZZZ equipped with a finite enumeration, any function p:Z→Rp:Z\to\mathbb Rp:Z→R, and any x,y∈Zx,y\in Zx,y∈Z, let e:Z→{0,…,∣Z∣−1}e:Z\to\{0,\ldots,|Z|-1\}e:Z→{0,…,∣Z∣−1} be the bijection supplied by that finite enumeration. The predicate shannonBefore⁡(p,x,y)\operatorname{shannonBefore}(p,x,y)shannonBefore(p,x,y) means

p(y)<p(x)or(p(x)=p(y) and e(x)<e(y)).p(y)<p(x)\quad\text{or}\quad \bigl(p(x)=p(y)\ \text{and}\ e(x)<e(y)\bigr).p(y)<p(x)or(p(x)=p(y) and e(x)<e(y)).

Thus larger values come first, with ties resolved by the supplied enumeration. No sign or normalization condition is imposed on ppp.

QAlgorithms.Papers.Independent.Intakethird100.P80.shannonCumulative

For any type ZZZ equipped with a finite enumeration, any function p:Z→Rp:Z\to\mathbb Rp:Z→R, and any x∈Zx\in Zx∈Z, let e:Z→{0,…,∣Z∣−1}e:Z\to\{0,\ldots,|Z|-1\}e:Z→{0,…,∣Z∣−1} be the bijection supplied by that enumeration. The cumulative value is the real number

shannonCumulative⁡(p,x)=∑y∈Zp(x)<p(y) or (p(y)=p(x) and e(y)<e(x))p(y).\operatorname{shannonCumulative}(p,x) = \sum_{\substack{y\in Z\\ p(x)<p(y)\ \text{or}\ (p(y)=p(x)\ \text{and}\ e(y)<e(x))}} p(y).shannonCumulative(p,x)=y∈Zp(x)<p(y) or (p(y)=p(x) and e(y)<e(x))​∑​p(y).

No nonnegativity or normalization is required, so this sum is not required to lie in [0,1][0,1][0,1].

QAlgorithms.Papers.Independent.Intakethird100.P80.shannonSize

For any type ZZZ, any function p:Z→Rp:Z\to\mathbb Rp:Z→R, and any x∈Zx\in Zx∈Z, the natural number shannonSize⁡(p,x)\operatorname{shannonSize}(p,x)shannonSize(p,x) is

⌈−log⁡2(p(x))⌉+,\left\lceil-\log_2(p(x))\right\rceil_+,⌈−log2​(p(x))⌉+​,

where ⌈r⌉+\lceil r\rceil_+⌈r⌉+​ is the least nonnegative integer greater than or equal to rrr, and is 000 when r≤0r\le0r≤0. The logarithm is total, with log⁡20=0\log_2 0=0log2​0=0 and log⁡2t=log⁡∣t∣/log⁡2\log_2 t=\log|t|/\log2log2​t=log∣t∣/log2 for t≠0t\ne0t=0. In particular, the size is 000 when p(x)=0p(x)=0p(x)=0 or ∣p(x)∣≥1|p(x)|\ge1∣p(x)∣≥1; ppp is not assumed to be a probability distribution.

QAlgorithms.Papers.Independent.Intakethird100.P80.shannonWord

For any type ZZZ equipped with a finite enumeration, any function p:Z→Rp:Z\to\mathbb Rp:Z→R, and any x∈Zx\in Zx∈Z, let e:Z→{0,…,∣Z∣−1}e:Z\to\{0,\ldots,|Z|-1\}e:Z→{0,…,∣Z∣−1} be the supplied enumeration and define

ℓ=⌈−log⁡2(p(x))⌉+,c=∑y∈Zp(x)<p(y) or (p(y)=p(x) and e(y)<e(x))p(y).\ell=\left\lceil-\log_2(p(x))\right\rceil_+,\qquad c=\sum_{\substack{y\in Z\\ p(x)<p(y)\ \text{or}\ (p(y)=p(x)\ \text{and}\ e(y)<e(x))}}p(y).ℓ=⌈−log2​(p(x))⌉+​,c=y∈Zp(x)<p(y) or (p(y)=p(x) and e(y)<e(x))​∑​p(y).

Then shannonWord⁡(p,x)\operatorname{shannonWord}(p,x)shannonWord(p,x) is the Boolean word of length ℓ\ellℓ whose entry at each index j=0,…,ℓ−1j=0,\ldots,\ell-1j=0,…,ℓ−1 is true exactly when

⌊2j+1c⌋+ mod 2=1.\left\lfloor 2^{j+1}c\right\rfloor_+\bmod2=1.⌊2j+1c⌋+​mod2=1.

Here ⌊r⌋+\lfloor r\rfloor_+⌊r⌋+​ is the natural-number floor, equal to 000 for negative rrr, and ⌈r⌉+\lceil r\rceil_+⌈r⌉+​ is the natural-number ceiling, equal to 000 for r≤0r\le0r≤0. The total logarithm satisfies log⁡20=0\log_2 0=0log2​0=0 and uses log⁡∣t∣/log⁡2\log|t|/\log2log∣t∣/log2 for nonzero ttt. No probability assumptions are imposed on ppp; when ℓ=0\ell=0ℓ=0, the word is empty.

QAlgorithms.Papers.Independent.Intakethird100.P80.simplexVolume

For every Bell experiment SSS with a positive number kkk of parties, positive setting counts mim_imi​, and positive outcome counts oiao_{ia}oia​, let

V=∏i=0k−1∏a=0mi−1{0,…,oia−1}V=\prod_{i=0}^{k-1}\prod_{a=0}^{m_i-1}\{0,\ldots,o_{ia}-1\}V=i=0∏k−1​a=0∏mi​−1​{0,…,oia​−1}

be the finite, nonempty space of assignments of an outcome to every party’s every setting, and let ΔV={p:V→R: p(v)≥0 for all v, ∑vp(v)=1}\Delta_V=\{p:V\to\mathbb R:\ p(v)\ge0\text{ for all }v,\ \sum_vp(v)=1\}ΔV​={p:V→R: p(v)≥0 for all v, ∑v​p(v)=1}. This definition assigns the measure on RV\mathbb R^VRV obtained by restricting its (∣V∣−1)(|V|-1)(∣V∣−1)-dimensional Hausdorff measure to ΔV\Delta_VΔV​. The dimension is computed by natural-number subtraction before conversion to a real number; here ∣V∣≥1|V|\ge1∣V∣≥1, so it equals the ordinary integer ∣V∣−1|V|-1∣V∣−1, including dimension 000 when VVV is a singleton. No normalization of this restricted measure is included.

QAlgorithms.Papers.Independent.Intakethird100.P80.statisticalPayoff

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts oi,ao_{i,a}oi,a​, put A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, and V=∏i∏b=0mi−1{0,…,oi,b−1}V=\prod_i\prod_{b=0}^{m_i-1}\{0,\ldots,o_{i,b}-1\}V=∏i​∏b=0mi​−1​{0,…,oi,b​−1}. Given arbitrary real functions Q(a,x)Q(a,x)Q(a,x), s(a)s(a)s(a), and p(v)p(v)p(v), define Lp(a,x)=∑v∈V: ∀i, vi,ai=xip(v)L_p(a,x)=\sum_{v\in V:\,\forall i,\ v_{i,a_i}=x_i}p(v)Lp​(a,x)=∑v∈V:∀i, vi,ai​​=xi​​p(v), qa,x=s(a)Q(a,x)q_{a,x}=s(a)Q(a,x)qa,x​=s(a)Q(a,x), and ra,x=s(a)Lp(a,x)r_{a,x}=s(a)L_p(a,x)ra,x​=s(a)Lp​(a,x). The payoff is +∞+\infty+∞ if some trial satisfies qa,x>0q_{a,x}>0qa,x​>0 and ra,x=0r_{a,x}=0ra,x​=0; otherwise it is

max⁡{0, ∑a∈A∑x∈Xa{0,qa,x=0,qa,xlog⁡2(qa,x/ra,x),qa,x≠0},\max\left\{0,\ \sum_{a\in A}\sum_{x\in X_a} \begin{cases} 0,&q_{a,x}=0,\\ q_{a,x}\log_2(q_{a,x}/r_{a,x}),&q_{a,x}\ne0 \end{cases}\right\},max{0, a∈A∑​x∈Xa​∑​{0,qa,x​log2​(qa,x​/ra,x​),​qa,x​=0,qa,x​=0​},

regarded as a value in [0,∞][0,\infty][0,∞]. Here division by zero is zero, log⁡2(0)=0\log_2(0)=0log2​(0)=0, and log⁡2(t)=log⁡∣t∣/log⁡2\log_2(t)=\log|t|/\log2log2​(t)=log∣t∣/log2 for nonzero real ttt. None of Q,s,pQ,s,pQ,s,p is assumed nonnegative or normalized.

QAlgorithms.Papers.Independent.Intakethird100.P80.trialJointLaw

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts oi,ao_{i,a}oi,a​, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1} and Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}. Given any real table Q(a,x)Q(a,x)Q(a,x) for a∈A,x∈Xaa\in A,x\in X_aa∈A,x∈Xa​ and any function s:A→Rs:A\to\mathbb Rs:A→R, this definition assigns the trial (a,x)(a,x)(a,x) the real value s(a)Q(a,x)s(a)Q(a,x)s(a)Q(a,x). No nonnegativity or normalization condition is required of either QQQ or sss.

QAlgorithms.Papers.Independent.Intakethird100.P80.trialMeasurableSpace

For every Bell experiment SSS, consisting of a positive number kkk of parties, a positive number mim_imi​ of settings for each party iii, and a positive number oiao_{ia}oia​ of outcomes for every party iii and its setting aaa, let A=∏i=0k−1{0,…,mi−1}A=\prod_{i=0}^{k-1}\{0,\ldots,m_i-1\}A=∏i=0k−1​{0,…,mi​−1} and Xa=∏i=0k−1{0,…,oi,ai−1}X_a=\prod_{i=0}^{k-1}\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i=0k−1​{0,…,oi,ai​​−1}. A trial is a pair (a,x)(a,x)(a,x) with a∈Aa\in Aa∈A and x∈Xax\in X_ax∈Xa​. This instance equips the finite trial space ∐a∈AXa\coprod_{a\in A}X_a∐a∈A​Xa​ with the measurable structure in which every subset is measurable.

QAlgorithms.Papers.Independent.Intakethird100.P80.trialMeasure

For every Bell experiment SSS with a positive number kkk of parties, positive setting counts mim_imi​, and positive outcome counts oiao_{ia}oia​, write A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, and Z=∐a∈AXaZ=\coprod_{a\in A}X_aZ=∐a∈A​Xa​ for its trial space, equipped with all subsets measurable. For every real-valued table Q(a,x)Q(a,x)Q(a,x) on ZZZ and every real-valued function sss on AAA, this definition assigns the measure

μQ,s=∑(a,x)∈Zmax⁡{s(a)Q(a,x),0} δ(a,x),\mu_{Q,s}=\sum_{(a,x)\in Z}\max\{s(a)Q(a,x),0\}\,\delta_{(a,x)},μQ,s​=(a,x)∈Z∑​max{s(a)Q(a,x),0}δ(a,x)​,

where each coefficient is regarded as an extended nonnegative real number and δ(a,x)\delta_{(a,x)}δ(a,x)​ is the Dirac measure at that trial. There are no nonnegativity or normalization hypotheses on QQQ or sss; negative products receive weight 000, and the resulting measure need not have total mass 111.

QAlgorithms.Papers.Independent.Intakethird100.P80.uncorrelatedStrength

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts oi,ao_{i,a}oi,a​, put A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, and V=∏i∏b=0mi−1{0,…,oi,b−1}V=\prod_i\prod_{b=0}^{m_i-1}\{0,\ldots,o_{i,b}-1\}V=∏i​∏b=0mi​−1​{0,…,oi,b​−1}. For any real table Q(a,x)Q(a,x)Q(a,x), this definition is the supremum in [0,∞][0,\infty][0,∞], over all nonnegative s:A→Rs:A\to\mathbb Rs:A→R with ∑as(a)=1\sum_as(a)=1∑a​s(a)=1 that admit a representation s(a)=∏ipi(ai)s(a)=\prod_i p_i(a_i)s(a)=∏i​pi​(ai​) by nonnegative functions pip_ipi​ satisfying ∑b=0mi−1pi(b)=1\sum_{b=0}^{m_i-1}p_i(b)=1∑b=0mi​−1​pi​(b)=1, of the infimum over all nonnegative p:V→Rp:V\to\mathbb Rp:V→R with ∑vp(v)=1\sum_vp(v)=1∑v​p(v)=1 of the following quantity: set qa,x=s(a)Q(a,x)q_{a,x}=s(a)Q(a,x)qa,x​=s(a)Q(a,x) and ra,x=s(a)∑v: ∀i, vi,ai=xip(v)r_{a,x}=s(a)\sum_{v:\,\forall i,\ v_{i,a_i}=x_i}p(v)ra,x​=s(a)∑v:∀i, vi,ai​​=xi​​p(v); the quantity is +∞+\infty+∞ if some qa,x>0q_{a,x}>0qa,x​>0 has ra,x=0r_{a,x}=0ra,x​=0, and otherwise is max⁡{0,∑a,x: qa,x≠0qa,xlog⁡2(qa,x/ra,x)}\max\{0,\sum_{a,x:\,q_{a,x}\ne0}q_{a,x}\log_2(q_{a,x}/r_{a,x})\}max{0,∑a,x:qa,x​=0​qa,x​log2​(qa,x​/ra,x​)}. Division by zero is zero, log⁡2(0)=0\log_2(0)=0log2​(0)=0, and log⁡2(t)=log⁡∣t∣/log⁡2\log_2(t)=\log|t|/\log2log2​(t)=log∣t∣/log2 for t≠0t\ne0t=0. Zero setting probabilities are allowed and make all corresponding trial summands zero. No nonnegativity or normalization assumption on QQQ, or attainment of either extremum, is included.

QAlgorithms.Papers.Independent.Intakethird100.P80.uniformSettings

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts at each party and setting, let A=∏i=0k−1{0,…,mi−1}A=\prod_{i=0}^{k-1}\{0,\ldots,m_i-1\}A=∏i=0k−1​{0,…,mi​−1}. This function assigns every joint setting a∈Aa\in Aa∈A the real value ∣A∣−1=(∏imi)−1\lvert A\rvert^{-1}=(\prod_i m_i)^{-1}∣A∣−1=(∏i​mi​)−1. The positivity assumptions ensure that AAA is nonempty and this denominator is positive.

QAlgorithms.Papers.Independent.Intakethird100.P80.uniformStrength

For a Bell experiment SSS with k>0k>0k>0 parties, positive setting counts mim_imi​, and positive outcome counts oi,ao_{i,a}oi,a​, let A=∏i{0,…,mi−1}A=\prod_i\{0,\ldots,m_i-1\}A=∏i​{0,…,mi​−1}, Xa=∏i{0,…,oi,ai−1}X_a=\prod_i\{0,\ldots,o_{i,a_i}-1\}Xa​=∏i​{0,…,oi,ai​​−1}, V=∏i∏b=0mi−1{0,…,oi,b−1}V=\prod_i\prod_{b=0}^{m_i-1}\{0,\ldots,o_{i,b}-1\}V=∏i​∏b=0mi​−1​{0,…,oi,b​−1}, and u=∣A∣−1>0u=\lvert A\rvert^{-1}>0u=∣A∣−1>0. For any real table Q(a,x)Q(a,x)Q(a,x), this definition is the infimum in [0,∞][0,\infty][0,∞], over all nonnegative functions p:V→Rp:V\to\mathbb Rp:V→R with ∑vp(v)=1\sum_vp(v)=1∑v​p(v)=1, of the following quantity: set qa,x=uQ(a,x)q_{a,x}=uQ(a,x)qa,x​=uQ(a,x) and ra,x=u∑v: ∀i, vi,ai=xip(v)r_{a,x}=u\sum_{v:\,\forall i,\ v_{i,a_i}=x_i}p(v)ra,x​=u∑v:∀i, vi,ai​​=xi​​p(v); the quantity is +∞+\infty+∞ if some qa,x>0q_{a,x}>0qa,x​>0 has ra,x=0r_{a,x}=0ra,x​=0, and otherwise is max⁡{0,∑a,x: qa,x≠0qa,xlog⁡2(qa,x/ra,x)}\max\{0,\sum_{a,x:\,q_{a,x}\ne0}q_{a,x}\log_2(q_{a,x}/r_{a,x})\}max{0,∑a,x:qa,x​=0​qa,x​log2​(qa,x​/ra,x​)}. Division by zero is zero, log⁡2(0)=0\log_2(0)=0log2​(0)=0, and log⁡2(t)=log⁡∣t∣/log⁡2\log_2(t)=\log|t|/\log2log2​(t)=log∣t∣/log2 for t≠0t\ne0t=0. No nonnegativity or normalization assumption on QQQ, or attainment of the infimum, is included.

QAlgorithms.Papers.Independent.Intakethird100.P80.upperValue

Let SSS consist of a positive finite number of parties, each with a positive finite number of settings and a positive finite number of outcomes at each setting. Let A\mathcal AA be the joint settings, Xa\mathcal X_aXa​ the joint outcomes at aaa, and V\mathcal VV the assignments of outcomes to every local setting, with v(a)v(a)v(a) denoting the outcome selected at aaa. Given any real table Q(a,x)Q(a,x)Q(a,x), any set A⊆(A→R)A\subseteq(\mathcal A\to\mathbb R)A⊆(A→R), and any function p:V→Rp:\mathcal V\to\mathbb Rp:V→R, the upper value is

upperValue⁡(Q,A,p)=sup⁡s∈ADQ,s(p) ∈[0,∞].\operatorname{upperValue}(Q,A,p)=\sup_{s\in A}D_{Q,s}(p)\ \in[0,\infty].upperValue(Q,A,p)=s∈Asup​DQ,s​(p) ∈[0,∞].

To define the payoff, put Lp(a,x)=∑v: v(a)=xp(v)L_p(a,x)=\sum_{v:\,v(a)=x}p(v)Lp​(a,x)=∑v:v(a)=x​p(v), q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x)q(a,x)=s(a)Q(a,x), and r(a,x)=s(a)Lp(a,x)r(a,x)=s(a)L_p(a,x)r(a,x)=s(a)Lp​(a,x). Then DQ,s(p)=+∞D_{Q,s}(p)=+\inftyDQ,s​(p)=+∞ if some trial has q(a,x)>0q(a,x)>0q(a,x)>0 and r(a,x)=0r(a,x)=0r(a,x)=0; otherwise

DQ,s(p)=max⁡ ⁣{0, ∑a,x{0,q(a,x)=0,q(a,x)log⁡2 ⁣(q(a,x)/r(a,x)),q(a,x)≠0.}.D_{Q,s}(p)=\max\!\left\{0,\ \sum_{a,x} \begin{cases} 0,&q(a,x)=0,\\ q(a,x)\log_2\!\bigl(q(a,x)/r(a,x)\bigr),&q(a,x)\ne0. \end{cases}\right\}.DQ,s​(p)=max{0, a,x∑​{0,q(a,x)log2​(q(a,x)/r(a,x)),​q(a,x)=0,q(a,x)=0.​}.

Division by zero is zero; the total real logarithm has value zero at zero and uses the absolute value at negative arguments. There are no probability, positivity, or normalization assumptions on QQQ, ppp, or the members of AAA. In particular, AAA may be empty, in which case the upper value is zero.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me