Documentation

CslibFrontier.Computability.PCP.TwoProverGame.XORGame

General XOR games, Tsirelson's vector characterization, and the Odd-Cycle game #

In a binary nonlocal game (TwoProverGame X Y Bool Bool), Alice and Bob each answer one bit; it is an XOR game (Cslib.PCP.TwoProverGame.IsXORGame, Cslib.PCP.TwoProverGame.xorGame) when the referee's verdict depends only on a ^^ b (Cleve, Høyer, Toner, Watrous, §5, arXiv:quant-ph/0404076v2).

This module formalizes:

  1. Tsirelson's vector correspondence (Cslib.PCP.tsirelson_vectors_of_observables, Cslib.PCP.tsirelson_observables_of_vectors, Cslib.PCP.tsirelson_iff, Cirel'son; Cleve, Høyer, Toner, Watrous, §5.3, Theorem 4): a table c : S → T → ℝ arises as ⟨ψ| A_s ⊗ B_t |ψ⟩ for a unit vector ψ ∈ ℂⁿ ⊗ ℂⁿ and ±1 observables A_s, B_t if and only if it arises as real unit-vector inner products ⟪u_s, v_t⟫ in ℝᵐ, with the quantitative bounds m = 2n² and n = 2^⌈m / 2⌉ (⌈m / 2⌉ = (m + 1) / 2), plus the general POVM bridge Cslib.PCP.QuantumStrategy.exists_unit_vectors_correlation.
  2. Exact vector characterization and entanglement bound for XOR games (Cslib.PCP.TwoProverGame.value_sub_trivialWinProb, Cslib.PCP.TwoProverGame.exists_max_unit_vectors_xorGame, Cslib.PCP.TwoProverGame.quantumValue_sub_trivialWinProb, Cslib.PCP.TwoProverGame.exists_maxEntangled_optimal_strategy, Cleve, Høyer, Toner, Watrous, §5.3–5.4, Proposition 5 & Theorem 10): ω_q(G) - τ(G) equals half the maximum of ∑_{x,y} π(x,y) (V(0|x,y) - V(1|x,y)) ⟪u_x, v_y⟫ over real unit vectors in ℝ^m for m = min(|X|, |Y|), and every XOR game on nonempty finite question sets attains quantumValue using ⌈min(|X|, |Y|) / 2⌉ shared EPR pairs.
  3. The Odd-Cycle XOR game (Cslib.PCP.TwoProverGame.oddCycleGame, Cslib.PCP.TwoProverGame.value_oddCycleGame, Cslib.PCP.TwoProverGame.quantumWinProb_oddCycleGame_oddCycleStrategy, Cslib.PCP.TwoProverGame.value_oddCycleGame_lt_quantumValue, Cleve, Høyer, Toner, Watrous, §3.2): on an odd cycle of length n ≥ 3, the classical value is 1 - 1 / (2n), whereas the Braunstein–Caves EPR rotation strategy wins with probability cos²(π / (4n)) > 1 - 1 / (2n).

References #

Realification of complex L² vectors and contraction dilation #

Tsirelson's vector correspondence (CHTW §5.3, Theorem 4) #

theorem Cslib.PCP.tsirelson_vectors_of_observables {S : Type u_1} {T : Type u_2} {ι : Type u_3} [Fintype ι] [DecidableEq ι] (ψ : EuclideanSpace ℂ (ι × ι)) (hψ : ‖ψ‖ = 1) (A : S → Matrix ι ι ℂ) (B : T → Matrix ι ι ℂ) (hA_herm : ∀ (s : S), (A s).IsHermitian) (hA_sq : ∀ (s : S), A s * A s = 1) (hB_herm : ∀ (t : T), (B t).IsHermitian) (hB_sq : ∀ (t : T), B t * B t = 1) :
0 < 2 * Fintype.card ι ^ 2 ∧ ∃ (u : S → EuclideanSpace ℝ (Fin (2 * Fintype.card ι ^ 2))) (v : T → EuclideanSpace ℝ (Fin (2 * Fintype.card ι ^ 2))), (∀ (s : S), ‖u s‖ = 1) ∧ (∀ (t : T), ‖v t‖ = 1) ∧ ∀ (s : S) (t : T), star ψ.ofLp ⬝ᵥ (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (A s) (B t)).mulVec ψ.ofLp = ↑(inner ℝ (u s) (v t))

Tsirelson's correspondence, (1) ⇒ (2) (Cirel'son; Cleve, Høyer, Toner, Watrous, §5.3, Theorem 4): ±1 observables A_s, B_t on ℂ^ι and a unit state ψ ∈ ℂ^(ι × ι) yield real unit vectors in ℝ^(2 |ι|²) with ⟨ψ| A_s ⊗ B_t |ψ⟩ = ⟪u_s, v_t⟫.

theorem Cslib.PCP.QuantumStrategy.exists_unit_vectors_correlation {S : Type u_1} {T : Type u_2} {ι : Type u_3} {κ : Type u_4} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (strat : QuantumStrategy S T Bool Bool ι κ) :
∃ (M : ℕ) (_ : 0 < M) (u : S → EuclideanSpace ℝ (Fin M)) (v : T → EuclideanSpace ℝ (Fin M)), (∀ (s : S), ‖u s‖ = 1) ∧ (∀ (t : T), ‖v t‖ = 1) ∧ ∀ (s : S) (t : T), inner ℝ (u s) (v t) = strat.correlation s t

Every quantum strategy with binary answers—even with non-projective POVMs and unequal local dimensions—has its correlation table realized by real unit vectors.

noncomputable def Cslib.PCP.QuantumStrategy.ofUnitVectors {S : Type u_1} {T : Type u_2} {m : ℕ} (u : S → EuclideanSpace ℝ (Fin m)) (hu : ∀ (s : S), ‖u s‖ = 1) (v : T → EuclideanSpace ℝ (Fin m)) (hv : ∀ (t : T), ‖v t‖ = 1) :
QuantumStrategy S T Bool Bool (Fin ((m + 1) / 2) → Bool) (Fin ((m + 1) / 2) → Bool)

Synthesize a projective quantum strategy on ⌈m / 2⌉ shared EPR pairs whose correlations equal the real inner products ⟪u s, v t⟫.

theorem Cslib.PCP.QuantumStrategy.correlation_ofUnitVectors {S : Type u_1} {T : Type u_2} {m : ℕ} (u : S → EuclideanSpace ℝ (Fin m)) (hu : ∀ (s : S), ‖u s‖ = 1) (v : T → EuclideanSpace ℝ (Fin m)) (hv : ∀ (t : T), ‖v t‖ = 1) (s : S) (t : T) :
(ofUnitVectors u hu v hv).correlation s t = inner ℝ (u s) (v t)
theorem Cslib.PCP.tsirelson_observables_of_vectors {S : Type u_1} {T : Type u_2} {m : ℕ} (u : S → EuclideanSpace ℝ (Fin m)) (hu : ∀ (s : S), ‖u s‖ = 1) (v : T → EuclideanSpace ℝ (Fin m)) (hv : ∀ (t : T), ‖v t‖ = 1) :
have n := 2 ^ ((m + 1) / 2); 0 < n ∧ ∃ (ψ : EuclideanSpace ℂ (Fin n × Fin n)) (A : S → Matrix (Fin n) (Fin n) ℂ) (B : T → Matrix (Fin n) (Fin n) ℂ), ‖ψ‖ = 1 ∧ (∀ (s : S), (A s).IsHermitian ∧ A s * A s = 1) ∧ (∀ (t : T), (B t).IsHermitian ∧ B t * B t = 1) ∧ ∀ (s : S) (t : T), star ψ.ofLp ⬝ᵥ (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (A s) (B t)).mulVec ψ.ofLp = ↑(inner ℝ (u s) (v t))

Tsirelson's correspondence, (2) ⇒ (1) (Cirel'son; Cleve, Høyer, Toner, Watrous, §5.3, Theorem 4): real unit vectors in ℝ^m yield ±1 observables in dimension n = 2^⌈m / 2⌉ (⌈m / 2⌉ = (m + 1) / 2) and a maximally entangled unit state realizing all inner products ⟪u_s, v_t⟫.

theorem Cslib.PCP.tsirelson_iff {S : Type u_1} {T : Type u_2} (c : S → T → ℝ) :
(∃ (n : ℕ) (_ : 0 < n) (ψ : EuclideanSpace ℂ (Fin n × Fin n)) (A : S → Matrix (Fin n) (Fin n) ℂ) (B : T → Matrix (Fin n) (Fin n) ℂ), ‖ψ‖ = 1 ∧ (∀ (s : S), (A s).IsHermitian ∧ A s * A s = 1) ∧ (∀ (t : T), (B t).IsHermitian ∧ B t * B t = 1) ∧ ∀ (s : S) (t : T), star ψ.ofLp ⬝ᵥ (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (A s) (B t)).mulVec ψ.ofLp = ↑(c s t)) ↔ ∃ (m : ℕ) (_ : 0 < m) (u : S → EuclideanSpace ℝ (Fin m)) (v : T → EuclideanSpace ℝ (Fin m)), (∀ (s : S), ‖u s‖ = 1) ∧ (∀ (t : T), ‖v t‖ = 1) ∧ ∀ (s : S) (t : T), inner ℝ (u s) (v t) = c s t

Tsirelson's theorem (Cirel'son; Cleve, Høyer, Toner, Watrous, §5.3, Theorem 4): c : S → T → ℝ is realized by ±1 observables on ℂⁿ ⊗ ℂⁿ if and only if it is realized by unit vectors in ℝᵐ.

Elementary Gram–Schmidt dimension reduction to min(|S|, |T|) #

General XOR games, Proposition 5, and Theorem 10 (CHTW §5.3–5.4) #

A binary game is an XOR game when its acceptance predicate depends only on a ^^ b (Cleve, Høyer, Toner, Watrous, §5).

noncomputable def Cslib.PCP.TwoProverGame.xorGame {X : Type u_1} {Y : Type u_2} (μ : PMF (X × Y)) (f : X → Y → Bool) :

The canonical XOR game with question distribution μ and target parity f x y, accepted when (a ^^ b) = f x y.

@[instance_reducible]
instance Cslib.PCP.TwoProverGame.instDecidableAcceptsBoolXorGame {X : Type u_1} {Y : Type u_2} (μ : PMF (X × Y)) (f : X → Y → Bool) (x : X) (y : Y) (a b : Bool) :
Decidable ((xorGame μ f).accepts x y a b)
theorem Cslib.PCP.TwoProverGame.isXORGame_xorGame {X : Type u_1} {Y : Type u_2} (μ : PMF (X × Y)) (f : X → Y → Bool) :
noncomputable def Cslib.PCP.TwoProverGame.trivialWinProb {X : Type u_1} {Y : Type u_2} (G : TwoProverGame X Y Bool Bool) :

The trivial random winning probability τ(G) when Alice and Bob ignore their questions and output independent uniform bits (Cleve, Høyer, Toner, Watrous, §5.3).

def Cslib.PCP.TwoProverGame.xorCoeff {X : Type u_1} {Y : Type u_2} (G : TwoProverGame X Y Bool Bool) [(x : X) → (y : Y) → (a b : Bool) → Decidable (G.accepts x y a b)] (x : X) (y : Y) :

The XOR bias coefficient V(0 | x, y) - V(1 | x, y) in { -1, 0, 1 }.

@[simp]
theorem Cslib.PCP.TwoProverGame.xorCoeff_xorGame {X : Type u_1} {Y : Type u_2} (μ : PMF (X × Y)) (f : X → Y → Bool) (x : X) (y : Y) :
(xorGame μ f).xorCoeff x y = BitString.signVal (f x y)
theorem Cslib.PCP.TwoProverGame.trivialWinProb_eq_sum {X : Type u_1} {Y : Type u_2} [Fintype X] [Fintype Y] {G : TwoProverGame X Y Bool Bool} [(x : X) → (y : Y) → (a b : Bool) → Decidable (G.accepts x y a b)] (hG : G.IsXORGame) :
G.trivialWinProb = 1 / 2 * ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * ((if G.accepts x y false false then 1 else 0) + if G.accepts x y true false then 1 else 0)

Explicit sum formula for τ(G) on an XOR game, matching τ(G) = ½ ∑_{c ∈ {0,1}} ∑_{x,y} π(x,y) V(c | x,y) (Cleve, Høyer, Toner, Watrous, §5.3).

@[simp]
theorem Cslib.PCP.TwoProverGame.trivialWinProb_xorGame {X : Type u_1} {Y : Type u_2} [Finite X] [Finite Y] (μ : PMF (X × Y)) (f : X → Y → Bool) :
(xorGame μ f).trivialWinProb = 1 / 2
theorem Cslib.PCP.TwoProverGame.quantumWinProb_sub_trivialWinProb {X : Type u_1} {Y : Type u_2} [Fintype X] [Fintype Y] {G : TwoProverGame X Y Bool Bool} [(x : X) → (y : Y) → (a b : Bool) → Decidable (G.accepts x y a b)] (hG : G.IsXORGame) {ι : Type u_3} {κ : Type u_4} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (S : QuantumStrategy X Y Bool Bool ι κ) :
G.quantumWinProb S - G.trivialWinProb = 1 / 2 * ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * G.xorCoeff x y * S.correlation x y

Quantum advantage over the trivial random strategy in terms of S.correlation (Cleve, Høyer, Toner, Watrous, proof of Proposition 5).

theorem Cslib.PCP.TwoProverGame.winProb_sub_trivialWinProb {X : Type u_1} {Y : Type u_2} [Fintype X] [Fintype Y] {G : TwoProverGame X Y Bool Bool} [(x : X) → (y : Y) → (a b : Bool) → Decidable (G.accepts x y a b)] (hG : G.IsXORGame) (ha : X → Bool) (hb : Y → Bool) :
G.winProb ha hb - G.trivialWinProb = 1 / 2 * ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * G.xorCoeff x y * (BitString.signVal (ha x) * BitString.signVal (hb y))

Deterministic advantage over τ(G) as a ±1 sign bilinear form.

theorem Cslib.PCP.TwoProverGame.value_sub_trivialWinProb {X : Type u_1} {Y : Type u_2} [Fintype X] [Fintype Y] {G : TwoProverGame X Y Bool Bool} [(x : X) → (y : Y) → (a b : Bool) → Decidable (G.accepts x y a b)] (hG : G.IsXORGame) :
G.value - G.trivialWinProb = 1 / 2 * ⨆ (ha : X → Bool), ⨆ (hb : Y → Bool), ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * G.xorCoeff x y * (BitString.signVal (ha x) * BitString.signVal (hb y))

Classical bias characterization of XOR games (Cleve, Høyer, Toner, Watrous, §5.3): ω_c(G) - τ(G) = ½ max_{a,b : {±1}} ∑_{x,y} π(x,y) xorCoeff(x,y) a(x) b(y).

theorem Cslib.PCP.TwoProverGame.exists_max_unit_vectors_xorGame {X : Type u_1} {Y : Type u_2} [Fintype X] [Fintype Y] [Nonempty X] [Nonempty Y] {G : TwoProverGame X Y Bool Bool} [(x : X) → (y : Y) → (a b : Bool) → Decidable (G.accepts x y a b)] (hG : G.IsXORGame) :
have m := min (Fintype.card X) (Fintype.card Y); ∃ (u : X → EuclideanSpace ℝ (Fin m)) (v : Y → EuclideanSpace ℝ (Fin m)), (∀ (x : X), ‖u x‖ = 1) ∧ (∀ (y : Y), ‖v y‖ = 1) ∧ (∀ {M : ℕ} (u' : X → EuclideanSpace ℝ (Fin M)) (v' : Y → EuclideanSpace ℝ (Fin M)), (∀ (x : X), ‖u' x‖ = 1) → (∀ (y : Y), ‖v' y‖ = 1) → ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * G.xorCoeff x y * inner ℝ (u' x) (v' y) ≤ ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * G.xorCoeff x y * inner ℝ (u x) (v y)) ∧ G.quantumValue - G.trivialWinProb = 1 / 2 * ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * G.xorCoeff x y * inner ℝ (u x) (v y)

Proposition 5 (attainment form) of Cleve, Høyer, Toner, Watrous, §5.3: for every XOR game G on nonempty finite question sets and m = min(|X|, |Y|), there exist real unit vectors in ℝ^m maximizing the vector objective across all dimensions and attaining ω_q(G) - τ(G).

theorem Cslib.PCP.TwoProverGame.quantumValue_sub_trivialWinProb {X : Type u_1} {Y : Type u_2} [Fintype X] [Fintype Y] [Nonempty X] [Nonempty Y] {G : TwoProverGame X Y Bool Bool} [(x : X) → (y : Y) → (a b : Bool) → Decidable (G.accepts x y a b)] (hG : G.IsXORGame) :
have m := min (Fintype.card X) (Fintype.card Y); have Sph := Metric.sphere 0 1; G.quantumValue - G.trivialWinProb = 1 / 2 * ⨆ (u : X → ↑Sph), ⨆ (v : Y → ↑Sph), ∑ x : X, ∑ y : Y, (G.questions (x, y)).toReal * G.xorCoeff x y * inner ℝ ↑(u x) ↑(v y)

Proposition 5 (supremum / SDP form) of Cleve, Høyer, Toner, Watrous, §5.3: ω_q(G) - τ(G) is half the supremum over real unit vectors in ℝ^(min(|X|, |Y|)).

Theorem 10 of Cleve, Høyer, Toner, Watrous, §5.4: every XOR game on nonempty finite question sets has an optimal quantum strategy sharing a maximally entangled state on ⌈min(|X|, |Y|) / 2⌉ qubits.

The Odd-Cycle XOR game (CHTW §3.2) #

Question distribution of the n-vertex Odd-Cycle game: uniform over {(s, t) | s = t ∨ s + 1 = t} in ZMod n × ZMod n (Cleve, Høyer, Toner, Watrous, §3.2).

The Odd-Cycle XOR game on ZMod n (Cleve, Høyer, Toner, Watrous, §3.2): answers must agree when s = t and differ when s + 1 = t.

@[instance_reducible]
theorem Cslib.PCP.TwoProverGame.winProb_oddCycleGame {n : ℕ} [NeZero n] (ha hb : ZMod n → Bool) :
(oddCycleGame n).winProb ha hb = ∑ sb : ZMod n × Bool, if (ha sb.1 ^^ hb (bif sb.2 then sb.1 + 1 else sb.1)) = decide (sb.1 + 1 = bif sb.2 then sb.1 + 1 else sb.1) then (2 * ↑n)⁻¹ else 0

Explicit winning probability of a deterministic strategy (ha, hb) on oddCycleGame n.

theorem Cslib.PCP.TwoProverGame.winProb_oddCycleGame_parity {n : ℕ} [NeZero n] (hn : Odd n) (hn3 : 3 ≤ n) :
have color := fun (s : ZMod n) => decide (s.val % 2 = 1); (oddCycleGame n).winProb color color = 1 - 1 / (2 * ↑n)

The alternating parity coloring s.val % 2 == 1 wins oddCycleGame n with probability 1 - 1 / (2n) for odd n ≥ 3.

theorem Cslib.PCP.TwoProverGame.value_oddCycleGame {n : ℕ} [NeZero n] (hn : Odd n) (hn3 : 3 ≤ n) :
(oddCycleGame n).value = 1 - 1 / (2 * ↑n)

Classical value of the Odd-Cycle game (Cleve, Høyer, Toner, Watrous, §3.2): ω_c(oddCycleGame n) = 1 - 1 / (2n) for odd n ≥ 3.

noncomputable def Cslib.PCP.TwoProverGame.oddCycleAliceAngle (n : ℕ) (s : ZMod n) :

Alice's measurement angle (π/2 - π/(2n)) s - π/(4n) in the Braunstein–Caves strategy for oddCycleGame n. (Note: Cleve, Høyer, Toner, Watrous, §3.2 print + π/(4n), which corresponds to the reversed edge orientation t + 1 ≡ s; for s + 1 ≡ t, - π/(4n) gives α_s - β_{s+1} = -π/2 + π/(4n) and sin²(α_s - β_{s+1}) = cos²(π/(4n)).)

noncomputable def Cslib.PCP.TwoProverGame.oddCycleBobAngle (n : ℕ) (t : ZMod n) :

Bob's measurement angle (π/2 - π/(2n)) t in the Braunstein–Caves strategy for oddCycleGame n.

The Braunstein–Caves EPR rotation strategy for oddCycleGame n (Cleve, Høyer, Toner, Watrous, §3.2).

Braunstein–Caves quantum value lower bound for the Odd-Cycle game (Cleve, Høyer, Toner, Watrous, §3.2): for odd n ≥ 3, oddCycleStrategy n wins oddCycleGame n with probability cos²(π / (4n)).

Entanglement strictly helps in every Odd-Cycle game (n ≥ 3 odd): ω_c(oddCycleGame n) = 1 - 1 / (2n) < cos²(π / (4n)) ≤ ω_q(oddCycleGame n) (Cleve, Høyer, Toner, Watrous, §3.2).