QPBT definitions: Palomar / Bridge
DefinitionQPBT_QPBT_Palomar_Bridgeqpbt
This bundle bridges compact Palomar representations and the library's canonical finite-support game and strategy structures. It converts project distributions, games, symmetric games, measurements, POVMs, and strategies in both directions.
Principal definitions:
MIPStarRE.QPBT.Palomar.pmfDistribution: the canonical project distribution associated with a finite PMF.MIPStarRE.QPBT.Palomar.Game.ofGame: converts a library game to compact PMF data.MIPStarRE.QPBT.Palomar.Game.toGame: converts compact game data to the library representation.MIPStarRE.QPBT.Palomar.SymmetricGame.ofSymmetricGame: converts a library symmetric game to compact data.MIPStarRE.QPBT.Palomar.SymmetricGame.toSymmetricGame: converts compact symmetric data to the library representation.MIPStarRE.QPBT.Palomar.POVM.ofMeasurement: converts a library measurement to a compact POVM.MIPStarRE.QPBT.Palomar.POVM.toMeasurement: converts compact POVM data to a library measurement.MIPStarRE.QPBT.Palomar.Strategy.ofStrategy: converts a library strategy to compact carrier-parametric data.
Formalization Credit. This Lean declaration is part of the Quantum Pauli basis test formalization by Ruixuan Deng. The source code was generated by AI agents; Ruixuan Deng is the responsible maintainer.
Mathematical Source. The mathematical source is Ji, Natarajan, Vidick, Wright, and Yuen, MIP*=RE, arXiv:2001.04383v3.
Definition code
-- Generated from QPBT/Palomar/Bridge.lean by skeleton subtraction.
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_AxisParallelLine
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_DiagonalLine
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_Distribution
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_LinePolynomials
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_LowDegreePolynomial
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_OpFamily
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_PMFAverages
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_ParametersBase
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_ParametersFiniteAnswers
import Definitions.Def_LIDT_MIPStarRE_LDT_Basic_QuantumState
import Definitions.Def_LIDT_MIPStarRE_LDT_CommutativityPoints_Defs
import Definitions.Def_LIDT_MIPStarRE_LDT_ExpansionHypercubeGraph_Defs_Core
import Definitions.Def_LIDT_MIPStarRE_LDT_GlobalVariance_Defs_Core
import Definitions.Def_LIDT_MIPStarRE_LDT_MakingMeasurementsProjective_Defs
import Definitions.Def_LIDT_MIPStarRE_LDT_Pasting_Defs_Families
import Definitions.Def_LIDT_MIPStarRE_LDT_Pasting_Defs_Interpolation
import Definitions.Def_LIDT_MIPStarRE_LDT_Tactic_AvgCongr
import Definitions.Def_LIDT_MIPStarRE_LDT_Test_StrategyCore
import Definitions.Def_LIDT_MIPStarRE_Quantum_FiniteMatrix_Basic
import Definitions.Def_LIDT_MIPStarRE_Quantum_Measurement
import Definitions.Def_QPBT_QPBT_Games_Defs
import Definitions.Def_QPBT_QPBT_Games_StrategyClasses
import Definitions.Def_QPBT_QPBT_Palomar_Definitions
import Definitions.Def_QPBT_QPBT_State
import Definitions.Def_QPBT_QPBT_Upstream
import Mathlib
namespace LIDT.MIPStarRE.LDT
end LIDT.MIPStarRE.LDT
namespace LIDT.MIPStarRE.Quantum
end LIDT.MIPStarRE.Quantum
namespace MIPStarRE.QPBT.Palomar
end MIPStarRE.QPBT.Palomar
namespace MIPStarRE.QPBT.Palomar.Game
end MIPStarRE.QPBT.Palomar.Game
namespace MIPStarRE.QPBT.Palomar.POVM
end MIPStarRE.QPBT.Palomar.POVM
namespace MIPStarRE.QPBT.Palomar.Strategy
end MIPStarRE.QPBT.Palomar.Strategy
namespace MIPStarRE.QPBT.Palomar.SymmetricGame
end MIPStarRE.QPBT.Palomar.SymmetricGame
namespace MIPStarRE.QPBT.Palomar.SymmetricStrategy
end MIPStarRE.QPBT.Palomar.SymmetricStrategy
/-!
# Exact bridges for the compact Palomar game foundation
This module converts the compact Mathlib-only game and strategy data to and
from the library structures. The conversions preserve every effect, state,
Born value, and the projective, consistency, commutation, and SPCC predicates.
This bridge uses the repository's legacy import form because Lean `module`
files cannot import the current non-`module` game API. The compact foundation
itself uses the public module surface required by the Palomar extraction.
## References
`references/qpbt-paper/06_nonlocal_games_and_mipstar.tex:10-57,68-180`.
-/
@[expose] public section
open scoped BigOperators MatrixOrder
namespace MIPStarRE.QPBT.Palomar
open LIDT.MIPStarRE.LDT LIDT.MIPStarRE.Quantum
/-- The canonical project distribution associated to a finite Mathlib PMF. -/
noncomputable def pmfDistribution {α : Type*} [Fintype α] (p : PMF α) :
_root_.LIDT.MIPStarRE.LDT.Distribution α where
support := Finset.univ
weight := fun a => (p a).toReal
nonnegative := fun _ => ENNReal.toReal_nonneg
outsideSupport := by simp
/-- The canonical distribution associated to a PMF has total mass one. -/
theorem pmfDistribution_isProbability {α : Type*} [Fintype α] (p : PMF α) :
(_root_.MIPStarRE.QPBT.Palomar.pmfDistribution p).IsProbability := by
simpa [_root_.LIDT.MIPStarRE.LDT.Distribution.IsProbability, _root_.LIDT.MIPStarRE.LDT.Distribution.totalWeight, _root_.MIPStarRE.QPBT.Palomar.pmfDistribution] using
_root_.LIDT.PMF.sum_toReal_eq_one p
/-- Converting a finite PMF to a project distribution and back is exact. -/
@[simp] theorem pmfDistribution_toPMF {α : Type*} [Fintype α] (p : PMF α) :
(_root_.MIPStarRE.QPBT.Palomar.pmfDistribution p).toPMF (_root_.MIPStarRE.QPBT.Palomar.pmfDistribution_isProbability p) = p := by
ext a
rw [_root_.LIDT.MIPStarRE.LDT.Distribution.toPMF_apply]
exact ENNReal.ofReal_toReal (p.apply_ne_top a)
namespace Game
/-- Convert a library game to the compact PMF representation. -/
noncomputable def ofGame (G : _root_.MIPStarRE.QPBT.Game) :
_root_.MIPStarRE.QPBT.Palomar.Game G.QuestionA G.QuestionB G.AnswerA G.AnswerB where
μ := G.μ.toPMF G.μ_prob
decide := G.decide
/-- Convert a compact game to the library representation with canonical full support. -/
noncomputable def toGame {X Y A B : Type} [Fintype X] [Fintype Y]
[Fintype A] [Fintype B] [DecidableEq X] [DecidableEq Y]
[DecidableEq A] [DecidableEq B] (G : _root_.MIPStarRE.QPBT.Palomar.Game X Y A B) : _root_.MIPStarRE.QPBT.Game where
QuestionA := X
QuestionB := Y
AnswerA := A
AnswerB := B
μ := _root_.MIPStarRE.QPBT.Palomar.pmfDistribution G.μ
μ_prob := _root_.MIPStarRE.QPBT.Palomar.pmfDistribution_isProbability G.μ
decide := G.decide
/-- The canonical library conversion has exactly the original question PMF. -/
@[simp] theorem toGame_questionPMF {X Y A B : Type} [Fintype X] [Fintype Y]
[Fintype A] [Fintype B] [DecidableEq X] [DecidableEq Y]
[DecidableEq A] [DecidableEq B] (G : _root_.MIPStarRE.QPBT.Palomar.Game X Y A B) :
(G.toGame.μ.toPMF G.toGame.μ_prob) = G.μ :=
_root_.MIPStarRE.QPBT.Palomar.pmfDistribution_toPMF G.μ
/-- Compact-to-library-to-compact game conversion is exact. -/
@[simp] theorem ofGame_toGame {X Y A B : Type} [Fintype X] [Fintype Y]
[Fintype A] [Fintype B] [DecidableEq X] [DecidableEq Y]
[DecidableEq A] [DecidableEq B] (G : _root_.MIPStarRE.QPBT.Palomar.Game X Y A B) :
_root_.MIPStarRE.QPBT.Palomar.Game.ofGame G.toGame = G := by
cases G
simp [_root_.MIPStarRE.QPBT.Palomar.Game.ofGame, _root_.MIPStarRE.QPBT.Palomar.Game.toGame]
rfl
/-- Library-to-compact-to-library conversion preserves the question PMF exactly. -/
@[simp] theorem ofGame_toGame_questionPMF (G : _root_.MIPStarRE.QPBT.Game) :
((_root_.MIPStarRE.QPBT.Palomar.Game.ofGame G).toGame.μ.toPMF (_root_.MIPStarRE.QPBT.Palomar.Game.ofGame G).toGame.μ_prob) = G.μ.toPMF G.μ_prob := by
rw [_root_.MIPStarRE.QPBT.Palomar.Game.toGame_questionPMF]
rfl
end Game
namespace SymmetricGame
/-- Convert a library symmetric game to the compact PMF representation. -/
noncomputable def ofSymmetricGame (G : _root_.MIPStarRE.QPBT.SymmetricGame) :
_root_.MIPStarRE.QPBT.Palomar.SymmetricGame G.Question G.Answer where
toGame :=
{ μ := G.μ.toPMF G.μ_prob
decide := G.decide }
μ_symm := by
intro x y
change ENNReal.ofReal (G.μ.weight (x, y)) = ENNReal.ofReal (G.μ.weight (y, x))
rw [G.μ_symm]
decide_symm := G.decide_symm
/-- Convert a compact symmetric game to the library representation. -/
noncomputable def toSymmetricGame {X A : Type} [Fintype X] [Fintype A]
[DecidableEq X] [DecidableEq A]
(G : _root_.MIPStarRE.QPBT.Palomar.SymmetricGame X A) : _root_.MIPStarRE.QPBT.SymmetricGame where
Question := X
Answer := A
μ := _root_.MIPStarRE.QPBT.Palomar.pmfDistribution G.μ
μ_prob := _root_.MIPStarRE.QPBT.Palomar.pmfDistribution_isProbability G.μ
μ_symm := fun x y => congrArg ENNReal.toReal (G.μ_symm x y)
decide := G.decide
decide_symm := G.decide_symm
/-- Compact-to-library-to-compact symmetric-game conversion is exact. -/
@[simp] theorem ofSymmetricGame_toSymmetricGame
{X A : Type} [Fintype X] [Fintype A] [DecidableEq X] [DecidableEq A]
(G : _root_.MIPStarRE.QPBT.Palomar.SymmetricGame X A) : _root_.MIPStarRE.QPBT.Palomar.SymmetricGame.ofSymmetricGame G.toSymmetricGame = G := by
cases G
simp [_root_.MIPStarRE.QPBT.Palomar.SymmetricGame.ofSymmetricGame, _root_.MIPStarRE.QPBT.Palomar.SymmetricGame.toSymmetricGame]
rfl
end SymmetricGame
namespace POVM
/-- Convert a library measurement to a compact POVM. -/
def ofMeasurement {A I : Type*} [Fintype A] [Fintype I] [DecidableEq I]
(M : _root_.LIDT.MIPStarRE.Quantum.Measurement A I) : _root_.MIPStarRE.QPBT.Palomar.POVM A I where
effect := M.effect
pos := fun a => Matrix.nonneg_iff_posSemidef.mp (M.pos a)
sum_eq_one := M.sum_eq_one
/-- Convert a compact POVM to a library measurement. -/
def toMeasurement {A I : Type*} [Fintype A] [Fintype I] [DecidableEq I]
(M : _root_.MIPStarRE.QPBT.Palomar.POVM A I) : _root_.LIDT.MIPStarRE.Quantum.Measurement A I :=
_root_.LIDT.MIPStarRE.Quantum.Measurement.ofSumEqOne M.effect
(fun a => Matrix.nonneg_iff_posSemidef.mpr (M.pos a)) M.sum_eq_one
@[simp] theorem ofMeasurement_effect {A I : Type*} [Fintype A] [Fintype I]
[DecidableEq I] (M : _root_.LIDT.MIPStarRE.Quantum.Measurement A I) (a : A) :
(_root_.MIPStarRE.QPBT.Palomar.POVM.ofMeasurement M).effect a = M.effect a := rfl
@[simp] theorem toMeasurement_effect {A I : Type*} [Fintype A] [Fintype I]
[DecidableEq I] (M : _root_.MIPStarRE.QPBT.Palomar.POVM A I) (a : A) :
M.toMeasurement.effect a = M.effect a := rfl
/-- Compact-to-library-to-compact POVM conversion is exact. -/
@[simp] theorem ofMeasurement_toMeasurement {A I : Type*} [Fintype A] [Fintype I]
[DecidableEq I] (M : _root_.MIPStarRE.QPBT.Palomar.POVM A I) : _root_.MIPStarRE.QPBT.Palomar.POVM.ofMeasurement M.toMeasurement = M := by
cases M
rfl
/-- Library-to-compact-to-library measurement conversion is exact. -/
@[simp] theorem toMeasurement_ofMeasurement {A I : Type*} [Fintype A] [Fintype I]
[DecidableEq I] (M : _root_.LIDT.MIPStarRE.Quantum.Measurement A I) :
(_root_.MIPStarRE.QPBT.Palomar.POVM.ofMeasurement M).toMeasurement = M := by
apply _root_.LIDT.MIPStarRE.Quantum.Measurement.ext
intro a
rfl
end POVM
namespace Strategy
/-- Convert a library strategy to compact carrier-parametric data. -/
def ofStrategy {G : _root_.MIPStarRE.QPBT.Game} (S : _root_.MIPStarRE.QPBT.Strategy G) :
_root_.MIPStarRE.QPBT.Palomar.Strategy G.QuestionA G.QuestionB G.AnswerA G.AnswerB where
ιA := S.ιA
ιB := S.ιB
ψ := S.ψ
ψ_norm := S.ψ_norm
alice := fun x => _root_.MIPStarRE.QPBT.Palomar.POVM.ofMeasurement (S.A x)
bob := fun y => _root_.MIPStarRE.QPBT.Palomar.POVM.ofMeasurement (S.B y)
/-- Convert compact strategy data to a strategy for a library game on the same carriers. -/
def toStrategy {G : _root_.MIPStarRE.QPBT.Game}
(S : _root_.MIPStarRE.QPBT.Palomar.Strategy G.QuestionA G.QuestionB G.AnswerA G.AnswerB) :
_root_.MIPStarRE.QPBT.Strategy G where
ιA := S.ιA
ιB := S.ιB
ψ := S.ψ
ψ_norm := S.ψ_norm
A := fun x => (S.alice x).toMeasurement
B := fun y => (S.bob y).toMeasurement
/-- Strategy conversion preserves Alice's effects pointwise. -/
@[simp] theorem toStrategy_alice_effect {G : _root_.MIPStarRE.QPBT.Game}
(S : _root_.MIPStarRE.QPBT.Palomar.Strategy G.QuestionA G.QuestionB G.AnswerA G.AnswerB)
(x : G.QuestionA) (a : G.AnswerA) :
((_root_.MIPStarRE.QPBT.Palomar.Strategy.toStrategy S).A x).effect a = (S.alice x).effect a := rfl
/-- Strategy conversion preserves Bob's effects pointwise. -/
@[simp] theorem toStrategy_bob_effect {G : _root_.MIPStarRE.QPBT.Game}
(S : _root_.MIPStarRE.QPBT.Palomar.Strategy G.QuestionA G.QuestionB G.AnswerA G.AnswerB)
(y : G.QuestionB) (b : G.AnswerB) :
((_root_.MIPStarRE.QPBT.Palomar.Strategy.toStrategy S).B y).effect b = (S.bob y).effect b := rfl
/-- Library-to-compact-to-library strategy conversion is exact. -/
@[simp] theorem toStrategy_ofStrategy {G : _root_.MIPStarRE.QPBT.Game}
(S : _root_.MIPStarRE.QPBT.Strategy G) : _root_.MIPStarRE.QPBT.Palomar.Strategy.toStrategy (_root_.MIPStarRE.QPBT.Palomar.Strategy.ofStrategy S) = S := by
cases S
rfl
/-- Compact-to-library-to-compact strategy conversion is exact. -/
@[simp] theorem ofStrategy_toStrategy {G : _root_.MIPStarRE.QPBT.Game}
(S : _root_.MIPStarRE.QPBT.Palomar.Strategy G.QuestionA G.QuestionB G.AnswerA G.AnswerB) :
_root_.MIPStarRE.QPBT.Palomar.Strategy.ofStrategy (_root_.MIPStarRE.QPBT.Palomar.Strategy.toStrategy S) = S := by
cases S
rfl
end Strategy
namespace SymmetricStrategy
/-- Convert a library symmetric strategy to compact data. -/
def ofSymmetricStrategy {G : _root_.MIPStarRE.QPBT.SymmetricGame}
(S : _root_.MIPStarRE.QPBT.SymmetricStrategy G) : _root_.MIPStarRE.QPBT.Palomar.SymmetricStrategy G.Question G.Answer where
ι := S.ι
ψ := S.ψ
ψ_norm := S.ψ_norm
ψ_swap := S.ψ_swap
meas := fun x => _root_.MIPStarRE.QPBT.Palomar.POVM.ofMeasurement (S.M x)
/-- Convert compact symmetric strategy data to a library symmetric strategy. -/
def toSymmetricStrategy {G : _root_.MIPStarRE.QPBT.SymmetricGame}
(S : _root_.MIPStarRE.QPBT.Palomar.SymmetricStrategy G.Question G.Answer) : _root_.MIPStarRE.QPBT.SymmetricStrategy G where
ι := S.ι
ψ := S.ψ
ψ_norm := S.ψ_norm
ψ_swap := S.ψ_swap
M := fun x => (S.meas x).toMeasurement
/-- Library-to-compact-to-library symmetric strategy conversion is exact. -/
@[simp] theorem toSymmetricStrategy_ofSymmetricStrategy
{G : _root_.MIPStarRE.QPBT.SymmetricGame} (S : _root_.MIPStarRE.QPBT.SymmetricStrategy G) :
_root_.MIPStarRE.QPBT.Palomar.SymmetricStrategy.toSymmetricStrategy (_root_.MIPStarRE.QPBT.Palomar.SymmetricStrategy.ofSymmetricStrategy S) = S := by
cases S
rfl
/-- Compact-to-library-to-compact symmetric strategy conversion is exact. -/
@[simp] theorem ofSymmetricStrategy_toSymmetricStrategy
{G : _root_.MIPStarRE.QPBT.SymmetricGame} (S : _root_.MIPStarRE.QPBT.Palomar.SymmetricStrategy G.Question G.Answer) :
_root_.MIPStarRE.QPBT.Palomar.SymmetricStrategy.ofSymmetricStrategy (_root_.MIPStarRE.QPBT.Palomar.SymmetricStrategy.toSymmetricStrategy S) = S := by
cases S
rfl
end SymmetricStrategy
end MIPStarRE.QPBT.Palomar
Source