Finite two-player entangled games and parallel repetition
Definitionquantum_parallel_repetition_gameA finite two-player one-round game has finite question sets , finite answer sets , a nonnegative normalized question distribution , and a Boolean verification predicate . Its -fold parallel repetition samples question pairs independently and accepts exactly when every coordinate accepts.
An entangled strategy chooses arbitrary finite-dimensional local systems, a positive-semidefinite trace-one joint state, and measurement operators and forming a POVM for each possible question or . The Born rule assigns the answer pair probability
The strategy's winning probability is the average of this quantity over accepted question-answer tuples. The entangled value is the supremum of the winning probabilities over all such finite-dimensional strategies, and is the corresponding value for the repeated game.
This definition provides the common formal language used by the mission's qualitative, polynomial, and exponential parallel-repetition statements.
Formalization Note The game uses real-valued normalized weights and a Boolean predicate. Repeated questions and answers are functions from Fin n; repeated strategies may make joint measurements indexed by whole question tuples and are not required to factor coordinatewise. The entangled value is a supremum over arbitrary finite local index types.
import Mathlib.Analysis.Matrix.PosDef
import Mathlib.LinearAlgebra.Matrix.Kronecker
noncomputable section
open scoped BigOperators ComplexOrder Kronecker
open Matrix
namespace QuantumParallelRepetition
variable {X Y A B : Type*}
/-- A finite two-player, one-round game. -/
structure Game (X Y A B : Type*)
[Fintype X] [Fintype Y] [Fintype A] [Fintype B] where
questionWeight : X → Y → ℝ
weight_nonneg : ∀ x y, 0 ≤ questionWeight x y
weight_normalized : (∑ x : X, ∑ y : Y, questionWeight x y) = 1
predicate : X → Y → A → B → Bool
namespace Game
variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B]
/-- The `n`-fold parallel repetition of a game, won only when every coordinate is won. -/
def «repeat» (G : Game X Y A B) (n : ℕ) :
Game (Fin n → X) (Fin n → Y) (Fin n → A) (Fin n → B) where
questionWeight xs ys := ∏ i : Fin n, G.questionWeight (xs i) (ys i)
weight_nonneg xs ys :=
Finset.prod_nonneg fun i _ => G.weight_nonneg (xs i) (ys i)
weight_normalized := by
classical
calc
(∑ xs : Fin n → X, ∑ ys : Fin n → Y,
∏ i : Fin n, G.questionWeight (xs i) (ys i)) =
∑ xs : Fin n → X, ∏ i : Fin n, ∑ y : Y,
G.questionWeight (xs i) y := by
apply Finset.sum_congr rfl
intro xs _
exact (Fintype.prod_sum
(fun i : Fin n => fun y : Y => G.questionWeight (xs i) y)).symm
_ = ∏ _i : Fin n, ∑ x : X, ∑ y : Y,
G.questionWeight x y := by
exact (Fintype.prod_sum
(fun _i : Fin n => fun x : X => ∑ y : Y,
G.questionWeight x y)).symm
_ = 1 := by simp [G.weight_normalized]
predicate xs ys as bs :=
decide (∀ i : Fin n, G.predicate (xs i) (ys i) (as i) (bs i) = true)
end Game
/-- A finite-dimensional quantum state represented by a positive semidefinite,
trace-one matrix. -/
structure DensityMatrix (d : Type*) [Fintype d] where
matrix : Matrix d d ℂ
positive : matrix.PosSemidef
trace_one : Matrix.trace matrix = 1
/-- A finite-outcome positive operator-valued measurement. -/
structure POVM (ι d : Type*) [Fintype ι] [Fintype d] [DecidableEq d] where
operator : ι → Matrix d d ℂ
positive : ∀ i, (operator i).PosSemidef
complete : (∑ i : ι, operator i) = 1
/-- A finite-dimensional entangled strategy for a two-player game. -/
structure Strategy [Fintype X] [Fintype Y] [Fintype A] [Fintype B]
(_G : Game X Y A B) where
Alice : Type
Bob : Type
[alice_fintype : Fintype Alice]
[bob_fintype : Fintype Bob]
[alice_decidableEq : DecidableEq Alice]
[bob_decidableEq : DecidableEq Bob]
state : DensityMatrix (Alice × Bob)
aliceMeasurement : X → POVM A Alice
bobMeasurement : Y → POVM B Bob
attribute [instance] Strategy.alice_fintype Strategy.bob_fintype
Strategy.alice_decidableEq Strategy.bob_decidableEq
namespace Strategy
variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B]
variable {G : Game X Y A B}
/-- The tensor-product measurement operator for a pair of answers. -/
def jointMeasurementOperator (S : Strategy G) (x : X) (y : Y) (a : A) (b : B) :
Matrix (S.Alice × S.Bob) (S.Alice × S.Bob) ℂ :=
(S.aliceMeasurement x).operator a ⊗ₖ (S.bobMeasurement y).operator b
/-- The Born-rule probability of a pair of answers. -/
def outcomeProbability (S : Strategy G) (x : X) (y : Y) (a : A) (b : B) : ℝ :=
(Matrix.trace (S.state.matrix * S.jointMeasurementOperator x y a b)).re
/-- The winning probability of a fixed entangled strategy. -/
def winProbability (S : Strategy G) : ℝ :=
∑ x : X, ∑ y : Y, G.questionWeight x y *
∑ a : A, ∑ b : B,
if G.predicate x y a b = true then S.outcomeProbability x y a b else 0
end Strategy
/-- The entangled value of a game: the supremum of the winning probabilities of all
finite-dimensional entangled strategies. -/
def entangledValue [Fintype X] [Fintype Y] [Fintype A] [Fintype B]
(G : Game X Y A B) : ℝ :=
sSup (Set.range (Strategy.winProbability (G := G)))
/-- The entangled value of the `n`-fold parallel repetition of `G`. -/
def repeatedEntangledValue [Fintype X] [Fintype Y] [Fintype A] [Fintype B]
(G : Game X Y A B) (n : ℕ) : ℝ :=
entangledValue (G.repeat n)
end QuantumParallelRepetition
end
Read-back
What the Lean code literally says, in plain math · gpt-5
Game
For arbitrary types , each equipped with a Fintype structure, Game X Y A B is the type of records consisting of: a real-valued question-weight function ; a proof that for every and ; a proof of the exact normalization
and a Boolean predicate . No condition is imposed on . The two question sums are ordered nested finite sums. The definition does not require or to be explicitly nonempty, although if or is empty then the normalization field would require , so no such record can exist; and may be empty because they do not occur in the normalization condition.
Game.repeat
For arbitrary finite types , a game , and any natural number , is a game whose questions and answers are functions
Its question weight is
The record includes proofs that every such product is nonnegative and that
Its Boolean predicate is the Boolean decision of
thus it is true exactly when the base-game Boolean predicate is true at every coordinate. When , all four function spaces consist of the unique empty function, the empty product defining the question weight is , and the universally quantified winning condition is vacuously true, including when one or more of the underlying answer types are empty.
DensityMatrix
For any finite type , DensityMatrix d is the type of records containing a complex matrix
a proof that is positive semidefinite, and a proof that its matrix trace satisfies
in . No separate Hermiticity, dimension-nonemptiness, or entrywise normalization field is added beyond what the positive-semidefinite and trace-one conditions state. If is empty, its trace is the empty sum , so the trace-one field would require and no such record can exist.
POVM
For finite types and , together with decidable equality on , POVM ι d is the type of records containing, for every outcome , a complex measurement operator
a proof that every is positive semidefinite, and a proof of the exact operator equality
where the right-hand side is the identity matrix on . No probabilities or traces are stored in this record. The outcome type is not explicitly required to be nonempty. If is empty, completeness says that the zero matrix equals ; this is impossible when is nonempty but holds extensionally when is empty.
Strategy
For finite types and a game , Strategy G is the type of records containing two types Alice and Bob; Fintype structures and decidable-equality structures on both types; a density matrix on their product, meaning a complex positive-semidefinite matrix
for every , an Alice POVM with outcomes in , meaning positive-semidefinite measurement operators on Alice satisfying
and, for every , a Bob POVM with outcomes in , meaning positive-semidefinite measurement operators on Bob satisfying
The game parameter indexes the strategy type but does not occur in any field: no field refers to 's question weights or Boolean predicate. Although Alice and Bob are not explicitly required to be nonempty, the trace-one state on their product rules out either being empty. The registered instance attributes make the stored finite-type and decidable-equality structures for Alice and Bob available as typeclass instances whenever a strategy is given.
Strategy.jointMeasurementOperator
For finite types , a game , a strategy , and elements , , , and , S.jointMeasurementOperator x y a b is the complex matrix on defined by the Kronecker product
where is the measurement operator for outcome in 's Alice POVM at question , and is the measurement operator for outcome in 's Bob POVM at question .
Strategy.outcomeProbability
For finite types , a game , a strategy , and , , , , S.outcomeProbability x y a b is the real number
where is 's density-matrix matrix, and and are the corresponding Alice and Bob measurement operators. Matrix multiplication is performed before taking the complex matrix trace, and then only the real part of that trace is retained. This declaration itself adds no explicit clipping or separate assertion that the resulting real number lies in .
Strategy.winProbability
For finite types , a game , and a strategy , S.winProbability is the real number
where is the strategy's state matrix and are its Alice and Bob measurement operators. The answer contribution is selected by equality of the game's Boolean predicate with true. All displayed sums are finite nested sums in the indicated order.
entangledValue
For finite types and a game , entangledValue G is
using the real-number sSup operation on the range of Strategy.winProbability. Here ranges over records that choose arbitrary finite types Alice and Bob with decidable equality, a positive-semidefinite trace-one state matrix on their product, Alice measurement operators that are positive semidefinite and sum to the identity for every , and Bob measurement operators that are positive semidefinite and sum to the identity for every . The definition supplies no explicit nonemptiness or boundedness hypothesis to sSup; if no strategy records exist, its argument is the empty range and the library's total sSup operation is still used.
repeatedEntangledValue
For finite types , a game , and any natural number , repeatedEntangledValue G n is the real-number sSup of the winning probabilities of all strategies for the repeated game whose questions and answers are -tuples represented by functions out of . Explicitly, the repeated game's question weight is
and its Boolean predicate is true exactly when
For each repeated-game strategy , with arbitrary finite decidable-equality types Alice and Bob, positive-semidefinite trace-one state matrix , Alice measurement operators , and Bob measurement operators , where each measurement family consists of positive-semidefinite operators summing to the relevant identity, its value in the supremum is
When , each tuple type is the singleton type of empty functions, the repeated question weight is the empty product , and the repeated Boolean predicate is true by the vacuous universal condition.
Confirmed by the mission captain (proposal self-audit).