Definitions for Nonlocality free wirings and the distinguishability between Bell boxes
DefinitionQAlgorithms_Papers_Independent_Intakethird100_P29The objects the formalized statements of Nonlocality free wirings and the distinguishability between Bell boxes (arXiv:1611.06932) are stated in. Each was checked against the paper by a blind read-back and a moderator.
BellScenario: PDF p.2, Section II: four independent finite, nonempty alphabets.BellScenario.X: PDF p.2, Section II: finite Alice input alphabet.BellScenario.Y: PDF p.2, Section II: finite Bob input alphabet.BellScenario.A: PDF p.2, Section II: finite Alice output alphabet.BellScenario.B: PDF p.2, Section II: finite Bob output alphabet.Behavior: PDF p.2, (1): raw arrays; validity isIsCorrelation, not implicit.IsNS: PDF p.2, (1),(2): normalized conditional laws satisfying both NS identities.BellOperation: Raw extensions are useful for linearity; WPICC is constrained only on NS.IsLOSR: PDF pp.3–4, (7): two local boxes, with independent shared-variable laws. The accepted interface allows arbitrary discrete seeds; no finite-support premise.GlobalWiring: PDF p.4, (10): arbitrary normalized input/output processing kernels. They may be signaling; in particular the output need not belong to NS.GlobalWiring.apply: PDF p.4, (10): one use of the supplied box, with fixed processing rules.IsGW: Membership as an operation on all arrays; used for the direct LOSR inclusion.UncorrelatedWiring: PDF p.15, (G1): four one-party kernels, without a shared hidden variable.UncorrelatedWiring.apply: PDF p.15, (G1): product input and output kernels act on one supplied box.AfterAlice: PDF p.10, Appendix A: after Alice's preparation outcome is communicated, Bob either waits for his final input or measures now and communicates his outcome. The enclosing function of Alice's outcome makes this decision adaptive.AfterBob: PDF p.10, Appendix A: the symmetric continuation after Bob measures first.Preparation: PDF pp.4,10: deterministic preparation tree. All stochastic choices, including later local random choices, are incorporated in the input-independent shared seed. The initial setting is fixed before the final inputs in each first-measurement branch.responseIndicator: Indicator for a deterministic classical response.aliceContribution: PDF pp.10–11, (A1)–(A4): contribution of a first Alice outcome. Joint probabilities avoid division by the probability of an impossible transcript.bobContribution: PDF pp.10–11: symmetric contribution of a first Bob outcome.Preparation.apply: PDF pp.4,10–11: exact action of the operational preparation tree.Preparation.isPrepared: PDF pp.10–11: a branch in which at least one box is measured during preparation. The no-preparation branch of (A5) is separately one fixed LOSR map.IsWPICC: PDF pp.4,10–11: operational WPICC using the proof convention of (A5). The no-preparation branch is one fixed Eq.(7) LOSR map. The other branch averages adaptive trees in which at least one party measures before final inputs. This keeps Eq.(7)'s separate input/output seeds; it does not silently replace its LOSR class by a convex hull of complete no-preparation strategies. Weight, map, seed law and trees precede every supplied behavior. Only NS inputs are constrained. Locality of the prepared action is a theorem conclusion, not part of this definition.AgreeOnNS: Equality on the common physical domain, not on arbitrary raw extensions.HasGWRestriction: PDF p.6, (19): whether any GW has the same action on every NS behavior.HasLOSRRestriction: Whether any LOSR operation agrees on the whole NS domain.classicalRelativeEntropyNats: PDF p.5, (14): extended finite-alphabet KL, in the displayed orientation. Only the total KL is converted to ENNReal; negative individual summands are retained. A positive numerator over zero gives infinity; zero terms give zero.sb: PDF p.5, (16): maximization over one fixed joint input, for all behaviors.weightedEntropy: PDF p.5, (15): same input law for both compared behaviors. ENNReal's zero times infinity is zero, including unused support-mismatch inputs.snl: PDF p.7, (21): all local comparison boxes, on exactly the same alphabets.localDistance: Inner local minimization in (22); extrema are certified inOptimaAttained.uniformInput: PDF p.7, (22a): uniform joint input distribution. The positive sizes inBellScenarioexclude division by zero.su: PDF p.7, (22a): uniform-input statistical strength.suc: PDF p.7, (22b): max over product laws, outside the local minimum.correlatedInputStrength: PDF p.7, (22c): max over all joint laws, outside the local minimum.OptimaAttained: Explicit meaning of the source's real-valued min/max notation in (21),(22). Every local minimum and both outer maxima are attained. These are conclusions, not hypotheses restricting the behaviors in any headline theorem.Quantity: Families over every finite Bell scenario; only values on NS are relevant.IsNormalizedQuantity: PDF p.6, Definition 5(i), including finite nonnegative real values on NS.IsLOSRMonotone: PDF p.6, Definition 5: LOSR monotonicity includes vanishing on local boxes.IsWPICCMonotone: PDF p.6, Definition 5: WPICC monotonicity, allowing alphabet changes.IsBellMonotone: PDF p.6, Definition 7: monotonicity for both equivalent choices of free class. The numbered Lemma 6 supplies their equivalence, without convexity.singletonScenario: Singleton scenario used only to check nonempty boundary conventions.
import Mathlib
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P47
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P47
/-!
# Nonlocality free wirings and the distinguishability between Bell boxes
arXiv:1611.06932v2. Page numbers below are PDF pages. Paper-local interfaces
use the accepted Advance50.P47 conditional laws and arbitrary-discrete LOSR
interface, and Dependency50.P47.Law for finite input distributions.
All four alphabet sizes are independent and strictly positive.
Repair: BellScenario and BellOperation describe classical conditional arrays,
unlike the accepted quantum communication Scenario and complex-matrix Operation.
responseIndicator is a classical response indicator, not a quantum entropy delta.
classicalRelativeEntropyNats is finite classical KL in nats, unlike the accepted
operator entropies and the classicalKL in bits. correlatedInputStrength is (22c),
not the accepted channel success exponent sc. The accepted HasLocalModel and Law
are used directly. ASSESSMENT.json records each local declaration separately.
Extended KL is retained at support mismatches. The optimized quantities are
extended nonnegative reals; `OptimaAttained` and the monotone predicates assert
finiteness on NS, identifying them with the source's nonnegative real values.
No conversion sends infinity to zero. Attainment is a conclusion, never a premise.
WPICC uses Appendix A's proof convention: the no-preparation branch is one
fixed Eq.(7) LOSR map; the prepared branch is a shared-seed average of single-use
adaptive trees followed by local responses. The second preparation measurement
may depend on the first communicated outcome. Equation (8) is a theorem about
these operations: the prepared action is not assumed local in the definition.
Only the NS restriction has meaning. Class separations compare these restrictions.
The no-preparation convention is recorded explicitly in MODERATION-r1.md.
The two ambiguous Appendix C/F quantitative claims are deferred in HARD.md.
Compilation is pending the separate mechanical handoff.
-/
noncomputable section
open scoped BigOperators ENNReal
namespace QAlgorithms.Papers.Independent.Intakethird100.P29
attribute [local instance] Classical.propDecidable Classical.decEq
open QAlgorithms.Papers.Independent.Advance50.P47
(Box IsCorrelation IsNoSignaling HasLocalModel TwoLocalBoxes losrTransform
correlationMixture)
open QAlgorithms.Papers.Independent.Information100.P56 (IsLaw)
open QAlgorithms.Papers.Independent.Dependency50.P47 (Law)
/-- PDF p.2, Section II: four independent finite, nonempty alphabets. -/
structure BellScenario where
nX : ℕ
nY : ℕ
nA : ℕ
nB : ℕ
xPositive : 0 < nX
yPositive : 0 < nY
aPositive : 0 < nA
bPositive : 0 < nB
/-- PDF p.2, Section II: finite Alice input alphabet. -/
abbrev BellScenario.X (s : BellScenario) := Fin s.nX
/-- PDF p.2, Section II: finite Bob input alphabet. -/
abbrev BellScenario.Y (s : BellScenario) := Fin s.nY
/-- PDF p.2, Section II: finite Alice output alphabet. -/
abbrev BellScenario.A (s : BellScenario) := Fin s.nA
/-- PDF p.2, Section II: finite Bob output alphabet. -/
abbrev BellScenario.B (s : BellScenario) := Fin s.nB
/-- PDF p.2, (1): raw arrays; validity is `IsCorrelation`, not implicit. -/
abbrev Behavior (s : BellScenario) := Box s.X s.Y s.A s.B
/-- PDF p.2, (1),(2): normalized conditional laws satisfying both NS identities. -/
def IsNS {s : BellScenario} (p : Behavior s) : Prop :=
IsCorrelation p ∧ IsNoSignaling p
-- PDF p.2, (4): use the accepted HasLocalModel directly.
/-- Raw extensions are useful for linearity; WPICC is constrained only on NS. -/
abbrev BellOperation (s t : BellScenario) := Behavior s → Behavior t
/-- PDF pp.3–4, (7): two local boxes, with independent shared-variable laws.
The accepted interface allows arbitrary discrete seeds; no finite-support premise. -/
def IsLOSR {s t : BellScenario} (w : BellOperation s t) : Prop :=
∃ (L1 L2 : Type)
(k : TwoLocalBoxes s.X s.Y s.A s.B t.X t.Y t.A t.B L1 L2),
∀ p, w p = losrTransform k p
/-- PDF p.4, (10): arbitrary normalized input/output processing kernels.
They may be signaling; in particular the output need not belong to NS. -/
structure GlobalWiring (s t : BellScenario) where
input : t.X → t.Y → s.X × s.Y → ℝ
output : s.A → s.B → s.X → s.Y → t.X → t.Y → t.A × t.B → ℝ
inputLaw : ∀ chi psi, IsLaw (input chi psi)
outputLaw : ∀ a b x y chi psi, IsLaw (output a b x y chi psi)
/-- PDF p.4, (10): one use of the supplied box, with fixed processing rules. -/
def GlobalWiring.apply {s t : BellScenario} (g : GlobalWiring s t) : BellOperation s t :=
fun p chi psi alpha beta => ∑ a, ∑ b, ∑ x, ∑ y,
g.output a b x y chi psi (alpha, beta) * p x y a b * g.input chi psi (x, y)
/-- Membership as an operation on all arrays; used for the direct LOSR inclusion. -/
def IsGW {s t : BellScenario} (w : BellOperation s t) : Prop :=
∃ g : GlobalWiring s t, ∀ p, w p = g.apply p
/-- PDF p.15, (G1): four one-party kernels, without a shared hidden variable. -/
structure UncorrelatedWiring (s t : BellScenario) where
inputAlice : t.X → s.X → ℝ
inputBob : t.Y → s.Y → ℝ
outputAlice : s.A → s.X → t.X → t.A → ℝ
outputBob : s.B → s.Y → t.Y → t.B → ℝ
inputAliceLaw : ∀ chi, IsLaw (inputAlice chi)
inputBobLaw : ∀ psi, IsLaw (inputBob psi)
outputAliceLaw : ∀ a x chi, IsLaw (outputAlice a x chi)
outputBobLaw : ∀ b y psi, IsLaw (outputBob b y psi)
/-- PDF p.15, (G1): product input and output kernels act on one supplied box. -/
def UncorrelatedWiring.apply {s t : BellScenario} (u : UncorrelatedWiring s t) :
BellOperation s t :=
fun p chi psi alpha beta => ∑ a, ∑ b, ∑ x, ∑ y,
(u.outputAlice a x chi alpha * u.outputBob b y psi beta) * p x y a b *
(u.inputAlice chi x * u.inputBob psi y)
/-- PDF p.10, Appendix A: after Alice's preparation outcome is communicated,
Bob either waits for his final input or measures now and communicates his outcome.
The enclosing function of Alice's outcome makes this decision adaptive. -/
inductive AfterAlice (s t : BellScenario) where
| wait (inputBob : t.Y → s.Y) (outputAlice : t.X → t.A)
(outputBob : t.Y → s.B → t.B)
| measure (y : s.Y) (outputAlice : s.B → t.X → t.A)
(outputBob : s.B → t.Y → t.B)
/-- PDF p.10, Appendix A: the symmetric continuation after Bob measures first. -/
inductive AfterBob (s t : BellScenario) where
| wait (inputAlice : t.X → s.X) (outputAlice : t.X → s.A → t.A)
(outputBob : t.Y → t.B)
| measure (x : s.X) (outputAlice : s.A → t.X → t.A)
(outputBob : s.A → t.Y → t.B)
/-- PDF pp.4,10: deterministic preparation tree. All stochastic choices, including
later local random choices, are incorporated in the input-independent shared seed.
The initial setting is fixed before the final inputs in each first-measurement branch. -/
inductive Preparation (s t : BellScenario) where
| none (inputAlice : t.X → s.X) (inputBob : t.Y → s.Y)
(outputAlice : t.X → s.A → t.A) (outputBob : t.Y → s.B → t.B)
| aliceFirst (x : s.X) (continuation : s.A → AfterAlice s t)
| bobFirst (y : s.Y) (continuation : s.B → AfterBob s t)
/-- Indicator for a deterministic classical response. -/
def responseIndicator {I : Type*} (i j : I) : ℝ := if i = j then 1 else 0
/-- PDF pp.10–11, (A1)–(A4): contribution of a first Alice outcome.
Joint probabilities avoid division by the probability of an impossible transcript. -/
def aliceContribution {s t : BellScenario} (p : Behavior s) (x : s.X) (a : s.A)
(c : AfterAlice s t) (chi : t.X) (psi : t.Y) (alpha : t.A) (beta : t.B) : ℝ :=
match c with
| .wait iy oa ob => ∑ b, p x (iy psi) a b * responseIndicator alpha (oa chi) *
responseIndicator beta (ob psi b)
| .measure y oa ob => ∑ b, p x y a b * responseIndicator alpha (oa b chi) *
responseIndicator beta (ob b psi)
/-- PDF pp.10–11: symmetric contribution of a first Bob outcome. -/
def bobContribution {s t : BellScenario} (p : Behavior s) (y : s.Y) (b : s.B)
(c : AfterBob s t) (chi : t.X) (psi : t.Y) (alpha : t.A) (beta : t.B) : ℝ :=
match c with
| .wait ix oa ob => ∑ a, p (ix chi) y a b * responseIndicator alpha (oa chi a) *
responseIndicator beta (ob psi)
| .measure x oa ob => ∑ a, p x y a b * responseIndicator alpha (oa a chi) *
responseIndicator beta (ob a psi)
/-- PDF pp.4,10–11: exact action of the operational preparation tree. -/
def Preparation.apply {s t : BellScenario} (r : Preparation s t) : BellOperation s t :=
fun p chi psi alpha beta =>
match r with
| .none ix iy oa ob => ∑ a, ∑ b, p (ix chi) (iy psi) a b *
responseIndicator alpha (oa chi a) * responseIndicator beta (ob psi b)
| .aliceFirst x next => ∑ a, aliceContribution p x a (next a) chi psi alpha beta
| .bobFirst y next => ∑ b, bobContribution p y b (next b) chi psi alpha beta
/-- PDF pp.10–11: a branch in which at least one box is measured during
preparation. The no-preparation branch of (A5) is separately one fixed LOSR map. -/
def Preparation.isPrepared {s t : BellScenario} (r : Preparation s t) : Prop :=
match r with
| .none _ _ _ _ => False
| .aliceFirst _ _ => True
| .bobFirst _ _ => True
/-- PDF pp.4,10–11: operational WPICC using the proof convention of (A5).
The no-preparation branch is one fixed Eq.(7) LOSR map. The other branch
averages adaptive trees in which at least one party measures before final inputs.
This keeps Eq.(7)'s separate input/output seeds; it does not silently replace its
LOSR class by a convex hull of complete no-preparation strategies. Weight, map,
seed law and trees precede every supplied behavior. Only NS inputs are constrained.
Locality of the prepared action is a theorem conclusion, not part of this definition. -/
def IsWPICC {s t : BellScenario} (w : BellOperation s t) : Prop :=
∃ (weight : ℝ), 0 ≤ weight ∧ weight ≤ 1 ∧
∃ (v : BellOperation s t), IsLOSR v ∧
∃ (L : Type) (mu : PMF L) (r : L → Preparation s t),
(∀ l, (r l).isPrepared) ∧
∀ p, IsNS p → ∀ chi psi alpha beta,
w p chi psi alpha beta =
weight * (∑' l, (mu l).toReal * (r l).apply p chi psi alpha beta) +
(1 - weight) * v p chi psi alpha beta
/-- Equality on the common physical domain, not on arbitrary raw extensions. -/
def AgreeOnNS {s t : BellScenario} (w v : BellOperation s t) : Prop :=
∀ p, IsNS p → w p = v p
/-- PDF p.6, (19): whether any GW has the same action on every NS behavior. -/
def HasGWRestriction {s t : BellScenario} (w : BellOperation s t) : Prop :=
∃ g : GlobalWiring s t, AgreeOnNS w g.apply
/-- Whether any LOSR operation agrees on the whole NS domain. -/
def HasLOSRRestriction {s t : BellScenario} (w : BellOperation s t) : Prop :=
∃ v : BellOperation s t, IsLOSR v ∧ AgreeOnNS w v
/-- PDF p.5, (14): extended finite-alphabet KL, in the displayed orientation.
Only the total KL is converted to ENNReal; negative individual summands are
retained. A positive numerator over zero gives infinity; zero terms give zero. -/
def classicalRelativeEntropyNats {I : Type*} [Fintype I] (p q : I → ℝ) : ℝ≥0∞ :=
if ∃ i, 0 < p i ∧ q i = 0 then ⊤
else ENNReal.ofReal (∑ i, p i * Real.log (p i / q i))
/-- PDF p.5, (16): maximization over one fixed joint input, for all behaviors. -/
def sb {s : BellScenario} (p q : Behavior s) : ℝ≥0∞ :=
⨆ x : s.X, ⨆ y : s.Y,
classicalRelativeEntropyNats (fun z : s.A × s.B => p x y z.1 z.2)
(fun z : s.A × s.B => q x y z.1 z.2)
-- PDF pp.5,7: use the accepted finite Law and its prob/nonneg/total fields.
/-- PDF p.5, (15): same input law for both compared behaviors.
ENNReal's zero times infinity is zero, including unused support-mismatch inputs. -/
def weightedEntropy {s : BellScenario} (p q : Behavior s) (d : s.X × s.Y → ℝ) : ℝ≥0∞ :=
∑ z : s.X × s.Y, ENNReal.ofReal (d z) *
classicalRelativeEntropyNats (fun o : s.A × s.B => p z.1 z.2 o.1 o.2)
(fun o : s.A × s.B => q z.1 z.2 o.1 o.2)
/-- PDF p.7, (21): all local comparison boxes, on exactly the same alphabets. -/
def snl {s : BellScenario} (p : Behavior s) : ℝ≥0∞ :=
⨅ q : {q : Behavior s // HasLocalModel q}, sb p q.val
/-- Inner local minimization in (22); extrema are certified in `OptimaAttained`. -/
def localDistance {s : BellScenario} (p : Behavior s) (d : s.X × s.Y → ℝ) : ℝ≥0∞ :=
⨅ q : {q : Behavior s // HasLocalModel q}, weightedEntropy p q.val d
/-- PDF p.7, (22a): uniform *joint* input distribution. The positive sizes
in `BellScenario` exclude division by zero. -/
def uniformInput (s : BellScenario) : s.X × s.Y → ℝ :=
fun _ => 1 / ((s.nX * s.nY : ℕ) : ℝ)
/-- PDF p.7, (22a): uniform-input statistical strength. -/
def su {s : BellScenario} (p : Behavior s) : ℝ≥0∞ := localDistance p (uniformInput s)
/-- PDF p.7, (22b): max over product laws, outside the local minimum. -/
def suc {s : BellScenario} (p : Behavior s) : ℝ≥0∞ :=
⨆ dx : Law s.X, ⨆ dy : Law s.Y,
localDistance p (fun z => dx.prob z.1 * dy.prob z.2)
/-- PDF p.7, (22c): max over all joint laws, outside the local minimum. -/
def correlatedInputStrength {s : BellScenario} (p : Behavior s) : ℝ≥0∞ :=
⨆ d : Law (s.X × s.Y), localDistance p d.prob
/-- Explicit meaning of the source's real-valued min/max notation in (21),(22).
Every local minimum and both outer maxima are attained. These are conclusions,
not hypotheses restricting the behaviors in any headline theorem. -/
def OptimaAttained {s : BellScenario} (p : Behavior s) : Prop :=
snl p ≠ ⊤ ∧ su p ≠ ⊤ ∧ suc p ≠ ⊤ ∧ correlatedInputStrength p ≠ ⊤ ∧
(∃ q : Behavior s, HasLocalModel q ∧ sb p q = snl p) ∧
(∀ d : Law (s.X × s.Y),
∃ q : Behavior s, HasLocalModel q ∧ weightedEntropy p q d.prob = localDistance p d.prob) ∧
(∃ q : Behavior s, HasLocalModel q ∧ weightedEntropy p q (uniformInput s) = su p) ∧
(∃ (dx : Law s.X) (dy : Law s.Y),
localDistance p (fun z => dx.prob z.1 * dy.prob z.2) = suc p) ∧
(∃ d : Law (s.X × s.Y), localDistance p d.prob = correlatedInputStrength p)
/-- Families over every finite Bell scenario; only values on NS are relevant. -/
abbrev Quantity := (s : BellScenario) → Behavior s → ℝ≥0∞
/-- PDF p.6, Definition 5(i), including finite nonnegative real values on NS. -/
def IsNormalizedQuantity (f : Quantity) : Prop :=
(∀ s p, IsNS p → f s p ≠ ⊤) ∧ (∀ s p, HasLocalModel p → f s p = 0)
/-- PDF p.6, Definition 5: LOSR monotonicity includes vanishing on local boxes. -/
def IsLOSRMonotone (f : Quantity) : Prop :=
IsNormalizedQuantity f ∧
∀ (s t : BellScenario) (w : BellOperation s t), IsLOSR w →
∀ p, IsNS p → f t (w p) ≤ f s p
/-- PDF p.6, Definition 5: WPICC monotonicity, allowing alphabet changes. -/
def IsWPICCMonotone (f : Quantity) : Prop :=
IsNormalizedQuantity f ∧
∀ (s t : BellScenario) (w : BellOperation s t), IsWPICC w →
∀ p, IsNS p → f t (w p) ≤ f s p
/-- PDF p.6, Definition 7: monotonicity for both equivalent choices of free class.
The numbered Lemma 6 supplies their equivalence, without convexity. -/
def IsBellMonotone (f : Quantity) : Prop := IsLOSRMonotone f ∧ IsWPICCMonotone f
/-! Definition sanity checks: no source result is proved here. -/
/-- Singleton scenario used only to check nonempty boundary conventions. -/
def singletonScenario : BellScenario :=
⟨1, 1, 1, 1, by decide, by decide, by decide, by decide⟩
example : IsNS (s := singletonScenario) (fun _ _ _ _ => (1 : ℝ)) := by
change IsCorrelation (fun (_ _ _ _ : Fin 1) => (1 : ℝ)) ∧
IsNoSignaling (fun (_ _ _ _ : Fin 1) => (1 : ℝ))
constructor
· simp [IsCorrelation]
· simp [IsNoSignaling]
example : uniformInput singletonScenario ((0 : Fin 1), (0 : Fin 1)) = 1 := by
change (1 : ℝ) / ((1 * 1 : ℕ) : ℝ) = 1
norm_num
example {s : BellScenario} (p q : Behavior s) : correlationMixture p q 0 = q := by
funext x y a b
simp [correlationMixture]
example {s : BellScenario} (p q : Behavior s) : correlationMixture p q 1 = p := by
funext x y a b
simp [correlationMixture]
example : classicalRelativeEntropyNats (fun _ : Unit => (1 : ℝ)) (fun _ => 1) = 0 := by
simp [classicalRelativeEntropyNats]
example : classicalRelativeEntropyNats (fun _ : Unit => (1 : ℝ)) (fun _ => 0) = ⊤ := by
simp [classicalRelativeEntropyNats]
example : classicalRelativeEntropyNats (fun _ : Unit => (0 : ℝ)) (fun _ => 0) = 0 := by
simp [classicalRelativeEntropyNats]
example {s t : BellScenario} (p : Behavior s) (x : s.X) (a : s.A)
(y : s.Y) (oa : s.B → t.X → t.A) (ob : s.B → t.Y → t.B)
(chi : t.X) (psi : t.Y) (alpha : t.A) (beta : t.B) :
aliceContribution p x a (.measure y oa ob) chi psi alpha beta =
∑ b, p x y a b * responseIndicator alpha (oa b chi) * responseIndicator beta (ob b psi) := by
rfl
example {s t : BellScenario} (y : s.Y) (next : s.B → AfterBob s t) :
(Preparation.bobFirst y next).isPrepared := by
simp [Preparation.isPrepared]
example {s t : BellScenario} (ix : t.X → s.X) (iy : t.Y → s.Y)
(oa : t.X → s.A → t.A) (ob : t.Y → s.B → t.B) :
¬ (Preparation.none ix iy oa ob).isPrepared := by
simp [Preparation.isPrepared]
end QAlgorithms.Papers.Independent.Intakethird100.P29
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intakethird100.P29.AfterAlice
For Bell scenarios , whose input and output alphabets and are finite and nonempty, an object of this type has exactly one of two forms: a wait object containing functions , , and ; or a measure object containing an element and functions and . These are arbitrary functions of the indicated arguments.
QAlgorithms.Papers.Independent.Intakethird100.P29.AfterBob
For Bell scenarios , whose input and output alphabets and are finite and nonempty, an object of this type has exactly one of two forms: a wait object containing functions , , and ; or a measure object containing an element and functions and . These are arbitrary functions of the indicated arguments.
QAlgorithms.Papers.Independent.Intakethird100.P29.AgreeOnNS
For Bell scenarios with finite nonempty alphabets and , let be any two functions taking real-valued arrays on to real-valued arrays on . They agree on no-signaling correlations precisely when for every array such that for all indices, for every , and
The equality is equality of the entire output arrays, hence holds at every ; the property imposes no equality on other input arrays.
QAlgorithms.Papers.Independent.Intakethird100.P29.Behavior
For any Bell scenario , a behavior is an arbitrary real-valued function , written , where are the integer index sets of sizes , respectively. This definition imposes no nonnegativity, normalization, or no-signaling conditions.
QAlgorithms.Papers.Independent.Intakethird100.P29.BellOperation
For any Bell scenarios , a Bell operation is an arbitrary function from the real-valued functions on to the real-valued functions on , where each index set consists of the integers starting at zero and has the corresponding positive size specified by its scenario. No linearity or preservation of nonnegativity, normalization, or no-signaling is required.
QAlgorithms.Papers.Independent.Intakethird100.P29.BellScenario.A
For any Bell scenario , its set is the finite set . The positivity requirement on makes this set nonempty.
QAlgorithms.Papers.Independent.Intakethird100.P29.BellScenario.B
For any Bell scenario , its set is the finite set . The positivity requirement on makes this set nonempty.
QAlgorithms.Papers.Independent.Intakethird100.P29.BellScenario.X
For any Bell scenario , its set is the finite set . The positivity requirement on makes this set nonempty.
QAlgorithms.Papers.Independent.Intakethird100.P29.BellScenario.Y
For any Bell scenario , its set is the finite set . The positivity requirement on makes this set nonempty.
QAlgorithms.Papers.Independent.Intakethird100.P29.BellScenario
A Bell scenario consists of four natural numbers together with the requirements , , , and . Thus all four numbers are positive; zero is excluded.
QAlgorithms.Papers.Independent.Intakethird100.P29.GlobalWiring.apply
For any Bell scenarios and any global wiring with input distributions on and output distributions on , each nonnegative and of total mass one for every fixed choice of its conditioning arguments, the associated operation sends every arbitrary real-valued behavior to
This holds for every ; all scenario index sets are the integer index sets of their specified positive sizes, and no conditions on are required.
QAlgorithms.Papers.Independent.Intakethird100.P29.GlobalWiring
For any Bell scenarios , a global wiring consists of real-valued functions and , with , where each index set is the integer index set of its scenario’s specified positive size. For every , all values of are nonnegative and ; for every , all values of are nonnegative and . No factorization or no-signaling requirement is imposed on these distributions.
QAlgorithms.Papers.Independent.Intakethird100.P29.HasGWRestriction
For Bell scenarios with finite nonempty alphabets and , let be any function taking real-valued arrays on to real-valued arrays on . It has the stated restriction precisely when there exist real-valued functions and such that, for each , is nonnegative and sums to over , and, for each , is nonnegative and sums to over , with
for every and every nonnegative array normalized by for all and satisfying for all , and for all . This equality is required only for those arrays .
QAlgorithms.Papers.Independent.Intakethird100.P29.HasLOSRRestriction
For Bell scenarios , each consisting of four finite input and output alphabets of strictly positive sizes, and any map from real tables on to real tables on , this property means that there is another such map with the following form. There are arbitrary types , probability mass functions on and on , and real kernels , , , and , each nonnegative and summing to over its final argument for every choice of its other arguments, such that, for every real table ,
Here the potentially infinite sums are the specified sums of real values of the probability masses. Moreover, for every whose entries are nonnegative, whose output entries sum to at every input pair, and which satisfies
for all indicated inputs and outputs. Agreement is required only on these tables, whereas the displayed formula for is required on every real table.
QAlgorithms.Papers.Independent.Intakethird100.P29.IsBellMonotone
For a function , this predicate is the conjunction of the following two monotonicity requirements, each including finiteness on nonsignaling correlations and value zero on local correlations. Scenarios have four positive integer sizes and finite nonempty input and output index sets; a nonsignaling correlation is a nonnegative array with , independent of , and independent of . A local correlation additionally admits , with a probability mass function on an arbitrary type and probability vectors . The first requirement is whenever , on all real arrays, is obtained by a local input preprocessing mixture and a separate local output postprocessing mixture: the input distribution is , the output distribution is , and their product with is summed over ; all kernels are probability vectors and both mixing types may be infinite. The second requirement is the same inequality whenever agrees on all nonsignaling correlations with a probability mixture of deterministic preparations of these forms: both source inputs depend separately on the target inputs and each final output depends on its own target input and source output; or Alice’s source input is fixed first and, depending on her outcome, Bob’s source input either depends on his target input while Alice’s final output ignores Bob’s outcome, or is fixed while both final outputs may depend on Bob’s outcome; or the symmetric construction with Bob first. In each latter construction final outputs depend only on the stated available outcomes and their own target inputs, and probabilities are obtained by summing source entries with the corresponding output indicators. No agreement away from nonsignaling correlations is required for the second class.
QAlgorithms.Papers.Independent.Intakethird100.P29.IsGW
For any Bell scenarios and any operation between their arbitrary real-valued behaviors, this predicate holds exactly when there exist nonnegative input distributions of total mass one on and nonnegative output distributions of total mass one on , for every choice of conditioning arguments, such that for every real-valued behavior and every target index ,
Here each index set is the integer index set of the corresponding positive size in or . The same distributions must give this identity for all , including negative, unnormalized, and signaling functions.
QAlgorithms.Papers.Independent.Intakethird100.P29.IsLOSR
For any Bell scenarios and any operation between their spaces of arbitrary real-valued behaviors, this predicate holds exactly when there exist two types , probability mass functions on and on , and real-valued functions , , , and with the following properties: for every and , is a nonnegative distribution of total mass one on ; for every , is such a distribution on ; for every , is such a distribution on ; and for every , is such a distribution on . For every real-valued behavior and every , the required identity is
Here the scenario index sets are the integer index sets of their specified positive sizes, and need not be finite. The identity is required even for that is negative, unnormalized, or signaling.
QAlgorithms.Papers.Independent.Intakethird100.P29.IsLOSRMonotone
For a function on scenarios and real behavior arrays, this predicate requires finiteness on every nonnegative normalized array whose Alice marginal is independent of Bob’s input and whose Bob marginal is independent of Alice’s input, and value zero on every nonnegative normalized array of the form , with a probability mass function on an arbitrary type and probability vectors . It additionally requires for every pair of scenarios , every such nonsignaling correlation on , and every operation with the following representation, valid on all real arrays :
Here are source indices, are target indices, are separate probability mass functions on arbitrary types, and every displayed or kernel is a nonnegative probability vector in its first argument for every choice of its conditioning arguments. All scenario index sets are finite and nonempty.
QAlgorithms.Papers.Independent.Intakethird100.P29.IsNS
For any Bell scenario and any real-valued behavior on its finite, nonempty index sets of sizes , respectively, the predicate holds exactly when for every , for every , and both marginal equalities hold:
QAlgorithms.Papers.Independent.Intakethird100.P29.IsNormalizedQuantity
For a function assigning a value in to every scenario and every real array on that scenario, this predicate requires two properties. Each scenario has positive integer numbers of Alice inputs, Bob inputs, Alice outputs, and Bob outputs, so all four index sets are finite and nonempty. First, whenever is nonnegative, for every , and its marginals satisfy and for all applicable indices. Second, whenever is a nonnegative normalized correlation admitting a representation
where is a probability mass function on an arbitrary, potentially infinite type, and each and is a nonnegative real probability vector. The series uses the real values of the probability masses. No condition is imposed here on other arrays.
QAlgorithms.Papers.Independent.Intakethird100.P29.IsWPICC
For any Bell scenarios with positive finite input and output cardinalities, and any function from real arrays to real arrays on , this predicate asserts the existence of a real , an operation , a type , a probability mass function on , and preparations for every , such that every is an Alice first or Bob first preparation, and, for every nonnegative array satisfying , with independent of and independent of , and every , one has
Here the sum over is the possibly infinite sum of real terms, with each mass interpreted as a real number. Writing for the equality indicator, an Alice first preparation has a fixed and contributes
For each , its continuation independently chooses either the waiting form, in which is arbitrary, depends only on , and is arbitrary, or the measuring form, in which is constant and both output maps are arbitrary functions of the displayed arguments. A Bob first preparation instead has a fixed and contributes
For each , its waiting form permits arbitrary and , while depends only on ; its measuring form makes constant and permits arbitrary displayed output maps. The required condition on means that there exist types , probability mass functions , input response laws , , and output response laws , , each nonnegative and summing to over its final argument for every choice of its other arguments, such that for every real array ,
The representation of is required only on the normalized nonsignaling arrays specified above. Both endpoints are allowed, but all existential witnesses and the requirement that every be prepared remain required, including for indices of zero -mass.
QAlgorithms.Papers.Independent.Intakethird100.P29.IsWPICCMonotone
For a function on scenarios and real behavior arrays, this predicate requires finiteness on every nonnegative normalized correlation with each party’s marginal independent of the other party’s input, and value zero on every nonnegative normalized correlation , where is a probability mass function on an arbitrary type and are probability vectors. It also requires for every pair of scenarios, every nonsignaling correlation on the source, and every operation that, on every nonsignaling source correlation, agrees with a probability mixture of the following deterministic transformations. One may choose inputs , and output , ; alternatively, one may fix Alice’s input and, separately for each resulting , either choose Bob’s input as a function of , Alice’s output as a function of , and Bob’s output as a function of , or fix Bob’s input and make both final outputs functions of and their respective target inputs. Symmetrically, one may fix Bob’s input and, separately for each resulting , either choose Alice’s input as a function of , Alice’s output as a function of , and Bob’s output as a function of , or fix Alice’s input and make both outputs functions of and their respective target inputs. A deterministic transformation sums over source outcomes with indicators enforcing these output functions; the mixture uses a probability mass function on an arbitrary type. The operation is unrestricted on arrays that are not nonsignaling correlations. All scenario index sets are finite and nonempty.
QAlgorithms.Papers.Independent.Intakethird100.P29.OptimaAttained
For a Bell scenario , with finite nonempty input alphabets and output alphabets of strictly positive sizes, and any real table , define to be the nonnegative output-normalized tables expressible as , for some arbitrary type , probability mass function , and nonnegative response functions normalized over their respective outputs for every hidden value and input. Put if some output satisfies , and otherwise put ; total division by zero and are , and logarithms of negative nonzero arguments use absolute values. For any real input weights , write
using extended nonnegative arithmetic, including , and let . A law means a nonnegative real function summing to . This property asserts that all four numbers
are different from , where ; that some satisfies ; that for every joint input law , some satisfies ; that some satisfies ; that some pair of input laws satisfies ; and that some joint input law satisfies . These witnesses may differ, no uniqueness is required, and itself is not assumed to be a correlation or no-signaling table.
QAlgorithms.Papers.Independent.Intakethird100.P29.Preparation.apply
For Bell scenarios with finite nonempty alphabets and , a preparation defines a transformation of every real-valued array . At , a none preparation with functions has value
For an aliceFirst preparation with fixed and continuation chosen separately for each , the value is : a wait continuation with functions gives , whereas a measure continuation with gives . For a bobFirst preparation with fixed and continuation chosen separately for each , the value is : a wait continuation with gives , whereas a measure continuation with gives . All continuation data may depend on the outcome indexing that continuation; all indicators take values or according to their displayed equalities. No normalization or no-signaling assumption on is required.
QAlgorithms.Papers.Independent.Intakethird100.P29.Preparation.isPrepared
For any two Bell scenarios , each having positive finite numbers of Alice inputs, Bob inputs, Alice outputs, and Bob outputs, and any preparation from to , this predicate is false exactly when has the “none” constructor and true when it has either the “Alice first” or “Bob first” constructor. The “none” constructor contains deterministic input maps , and deterministic output maps , . An “Alice first” preparation contains a fixed input and, for each outcome , a continuation of one of two forms: a waiting continuation with maps , , and ; or a measuring continuation with a fixed and maps , . A “Bob first” preparation contains a fixed input and, for each outcome , either a waiting continuation with maps , , and , or a measuring continuation with a fixed and maps , . The predicate imposes no further condition on any of these inputs, maps, or continuations.
QAlgorithms.Papers.Independent.Intakethird100.P29.Preparation
For Bell scenarios with finite nonempty alphabets and , a preparation is one of three forms. A none preparation contains functions , , , and . An aliceFirst preparation contains and, for every , a choice between wait data , and measure data . A bobFirst preparation contains and, for every , a choice between wait data , and measure data . All these functions and continuation choices are arbitrary.
QAlgorithms.Papers.Independent.Intakethird100.P29.Quantity
This abbreviates the type of functions that assign an extended nonnegative real number in to every pair consisting of a Bell scenario and an arbitrary real table . A scenario specifies four strictly positive natural alphabet sizes, with each alphabet the corresponding finite index set. Such a function is defined on all these tables, without any positivity, normalization, or no-signaling requirement on them, and its values may be .
QAlgorithms.Papers.Independent.Intakethird100.P29.UncorrelatedWiring.apply
For Bell scenarios with finite nonempty input and output alphabets and , let consist of conditional probability distributions , , , and , normalized over , respectively, for each fixed choice of their other arguments. Its application is the function taking any real-valued array to the array defined, for every , by
There is no hypothesis here that is nonnegative, normalized, or no-signaling.
QAlgorithms.Papers.Independent.Intakethird100.P29.UncorrelatedWiring
For Bell scenarios , let and denote their respective input and output alphabets, each a finite set of indices of a specified positive natural size. An uncorrelated wiring from to consists of four real-valued functions
For every , the numbers , indexed by , are nonnegative and sum to ; for every , the numbers , indexed by , are nonnegative and sum to . For every , the numbers , indexed by , are nonnegative and sum to ; for every , the numbers , indexed by , are nonnegative and sum to .
QAlgorithms.Papers.Independent.Intakethird100.P29.aliceContribution
For Bell scenarios with finite nonempty alphabets and , take any real-valued array , elements , and continuation data of either of the following forms. If contains wait functions , its Alice contribution is
If contains measure data , the contribution is
Here every indicator is when its displayed equality holds and otherwise. No probability or no-signaling hypothesis is imposed on .
QAlgorithms.Papers.Independent.Intakethird100.P29.bobContribution
For Bell scenarios with finite nonempty alphabets and , take any real-valued array , elements , and continuation data of either of the following forms. If contains wait functions , its Bob contribution is
If contains measure data , the contribution is
Here every indicator is when its displayed equality holds and otherwise. No probability or no-signaling hypothesis is imposed on .
QAlgorithms.Papers.Independent.Intakethird100.P29.classicalRelativeEntropyNats
For any finite type , equipped with its finite enumeration, and arbitrary real functions , this definition gives the extended nonnegative real value
Neither function is assumed nonnegative or normalized. Division and logarithms are total: division by zero is , , and for a negative nonzero argument the real logarithm is the logarithm of its absolute value. Thus a zero denominator forces infinity precisely when the corresponding numerator is strictly positive; otherwise the finite branch uses these total operations. If is empty, the value is .
QAlgorithms.Papers.Independent.Intakethird100.P29.correlatedInputStrength
For a Bell scenario , with finite nonempty input alphabets and output alphabets of strictly positive sizes, and any real table , this definition gives
Here consists of nonnegative tables normalized over outputs at every input pair that have a representation , where is arbitrary, is a probability mass function, and the response functions are nonnegative and normalized over their respective outputs for every hidden value and input. The value is if some satisfy , and otherwise equals . No positivity, normalization, or no-signaling assumption is imposed on . The joint law may have zeros, with ; division by zero and equal , and logarithms of negative nonzero arguments use their absolute values. No optimizer is asserted.
QAlgorithms.Papers.Independent.Intakethird100.P29.localDistance
For a Bell scenario , with finite nonempty input alphabets and output alphabets of strictly positive sizes, any real table , and any real input weight function , this definition gives
The set consists of nonnegative tables normalized over at every that admit a representation , where is an arbitrary type, is a probability mass function, and each response function is nonnegative and sums to over its output for every hidden value and input. Here if some satisfy , and otherwise
No distribution or no-signaling assumption is imposed on , and need not be nonnegative or normalized. Negative weights become zero, , division by zero and are , and logarithms of negative nonzero arguments use their absolute values. No minimizer is asserted.
QAlgorithms.Papers.Independent.Intakethird100.P29.responseIndicator
For any type and any , the response indicator is the real number
No finiteness or nonemptiness assumption on is required; supplying already supplies elements of .
QAlgorithms.Papers.Independent.Intakethird100.P29.sb
For a Bell scenario , with finite nonempty input alphabets and output alphabets of its specified strictly positive sizes, and arbitrary real tables , this definition gives
The supremum is taken in ; because the input alphabets are finite and nonempty, it is a maximum. No nonnegativity, normalization, or no-signaling condition is imposed on either table. The finite branch uses total real division and logarithms, with division by zero and equal to , and the logarithm of a negative nonzero number equal to the logarithm of its absolute value.
QAlgorithms.Papers.Independent.Intakethird100.P29.singletonScenario
This declaration specifies the scenario with exactly one Alice input, one Bob input, one Alice output, and one Bob output. Each index set is the singleton , and all four required positivity conditions hold.
QAlgorithms.Papers.Independent.Intakethird100.P29.snl
For a Bell scenario , with finite nonempty input alphabets and output alphabets of strictly positive sizes, and any real table , this definition gives
Here consists of nonnegative tables with for every , for which there exist an arbitrary type , a probability mass function on , and response functions , , nonnegative and summing to over and , respectively, for every , such that
The value is if some have , and otherwise is . The table is unrestricted. Real division by zero and equal , and logarithms of negative nonzero arguments use their absolute values. The definition is an infimum and does not assert attainment.
QAlgorithms.Papers.Independent.Intakethird100.P29.su
For a Bell scenario , with finite nonempty input alphabets of sizes and finite nonempty output alphabets , and any real table , this definition gives
Here consists of nonnegative tables normalized over outputs at every input pair and expressible as , with an arbitrary hidden type , a probability mass function , and nonnegative response functions normalized over their respective outputs for every hidden value and input. The value is if some satisfy , and otherwise equals . The table has no normalization, positivity, or no-signaling requirement. Division by zero and are , logarithms of negative nonzero arguments use their absolute values, and no attainment of the infimum is asserted.
QAlgorithms.Papers.Independent.Intakethird100.P29.suc
For a Bell scenario , with finite nonempty input alphabets and output alphabets of strictly positive sizes, and any real table , this definition gives
Here consists of nonnegative output-normalized tables admitting , with arbitrary hidden type , probability mass function , and nonnegative output-normalized response functions for every hidden value and input. The value is when some output has , and otherwise equals . The table is unrestricted, input laws may have zero probabilities, and . Total real division and logarithms give division by zero and the value , and use absolute values for negative nonzero logarithm arguments. No supremum or infimum is asserted to be attained.
QAlgorithms.Papers.Independent.Intakethird100.P29.uniformInput
For any Bell scenario , whose input sizes and output sizes are natural numbers with all four strictly positive, this definition is the real function on input pairs , given by
It is constant on all input pairs, and its denominator is positive by the scenario assumptions.
QAlgorithms.Papers.Independent.Intakethird100.P29.weightedEntropy
For a Bell scenario , with finite nonempty input alphabets and output alphabets of strictly positive sizes, arbitrary real tables , and any real function , this definition gives
where if some output pair satisfies and , and otherwise
There are no distribution or no-signaling assumptions on . Negative weights become zero, and extended nonnegative multiplication satisfies . In the finite branch, division by zero and are , and the real logarithm at a negative nonzero argument is the logarithm of its absolute value.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.