Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

QPBT definitions: Games / Sandwich / Defs

Definition
QPBT_QPBT_Games_Sandwich_Defs

by Dengnifer · Oct 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

qpbt

This bundle collects the basic operator and measurement definitions for the pasting comparison. It includes the two-family sandwiched product, a conditional collision bound, tensor placement constructions, and relabeling of measurement outcomes by a bijection.

Principal definitions:

  • MIPStarRE.QPBT.pastedMeasurement: defines the two-family sandwiched product used in the pasting comparison.
  • MIPStarRE.QPBT.HasConditionalCollisionBound: states the positive-mass conditional collision bound used by the pasting argument.
  • The measurement placement constructions put a measurement on the left or right tensor register.
  • The outcome relabeling construction transports a measurement along a bijection of outcome sets.

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/Games/Sandwich/Defs.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_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_DistanceTheorems_TensorSupport

namespace LIDT.MIPStarRE.LDT
end LIDT.MIPStarRE.LDT
namespace LIDT.MIPStarRE.Quantum
end LIDT.MIPStarRE.Quantum
namespace MIPStarRE.QPBT
end MIPStarRE.QPBT
namespace MIPStarRE.QPBT.DistanceCalculus
end MIPStarRE.QPBT.DistanceCalculus
namespace MIPStarRE.QPBT.SandwichProduct
end MIPStarRE.QPBT.SandwichProduct

/-! # Definitions for sandwiched measurements

This module defines the palindromic operator products and the conditional
collision predicate used by the sandwich and pasting lemmas.

## References

Blueprint `lem:ld-sandwich` and `lem:pasting`; paper
`references/qpbt-paper/06_nonlocal_games_and_mipstar.tex:465-525`.
-/

@[expose] public section

open scoped BigOperators MatrixOrder Matrix ComplexOrder

namespace MIPStarRE.QPBT

open LIDT.MIPStarRE.LDT hiding Measurement
open LIDT.MIPStarRE.Quantum
open DistanceCalculus





/-- The two-family sandwiched product
`(G₂)_{g₂} (G₁)_{g₁} (G₂)_{g₂}` from blueprint
`eq:pasting-2a`, paper
`references/qpbt-paper/06_nonlocal_games_and_mipstar.tex:504-525`. -/
def pastedMeasurement {ι : Type*} [Fintype ι] [DecidableEq ι]
    {G₁ G₂ : Type*} (M₁ : G₁ → _root_.LIDT.MIPStarRE.Quantum.Op ι) (M₂ : G₂ → _root_.LIDT.MIPStarRE.Quantum.Op ι)
    (g₁ : G₁) (g₂ : G₂) : _root_.LIDT.MIPStarRE.Quantum.Op ι :=
  M₂ g₂ * M₁ g₁ * M₂ g₂



/-- The positive-mass conditional collision bound used by `lem:pasting`.
This is a formalization-only spelling of the conditional probability in
`lem:pasting`, with paper origin
`references/qpbt-paper/06_nonlocal_games_and_mipstar.tex:504-525`. -/
def HasConditionalCollisionBound {X Y₁ Y₂ R₂ Γ₂ : Type*}
    [Fintype X] [DecidableEq X] [Fintype Y₁] [DecidableEq Y₁]
    [Fintype Y₂] [DecidableEq Y₂] [Fintype R₂] [DecidableEq R₂]
    [Fintype Γ₂]
    (D : _root_.LIDT.MIPStarRE.LDT.Distribution ((X × Y₁) × Y₂)) (eval₂ : Γ₂ → Y₂ → R₂)
    (η : ℝ) : Prop :=
  ∀ x y₁, 0 < (D.map Prod.fst).weight (x, y₁) →
    ∀ g g' : Γ₂, g ≠ g' →
      (∑ y₂ : Y₂, D.weight ((x, y₁), y₂) *
        if eval₂ g y₂ = eval₂ g' y₂ then 1 else 0) ≤
        η * (D.map Prod.fst).weight (x, y₁)


/-! ### Tensor placements of measurements

The operator families compared in `lem:pasting` are placed on one factor of a
bipartite space. The two constructions below present such a placed family as a
measurement, so that the consistency calculus applies to it verbatim. -/

/-- An alias of `DistanceCalculus.leftPlacedMeasurement`, whose effects are the
left tensor placements of the effects of `M`. Formalization support for `lem:pasting`, blueprint
`ch12_qpbt_games.tex:960-990`. -/
noncomputable def Measurement.leftPlacement {α ιA ιB : Type*} [Fintype α]
    [Fintype ιA] [DecidableEq ιA] [Fintype ιB] [DecidableEq ιB]
    (M : _root_.LIDT.MIPStarRE.Quantum.Measurement α ιA) : _root_.LIDT.MIPStarRE.Quantum.Measurement α (ιA × ιB) :=
  _root_.MIPStarRE.QPBT.DistanceCalculus.leftPlacedMeasurement M

/-- An alias of `DistanceCalculus.rightPlacedMeasurement`, whose effects are the
right tensor placements of the effects of `M`. Formalization support for `lem:pasting`, blueprint
`ch12_qpbt_games.tex:960-990`. -/
noncomputable def Measurement.rightPlacement {α ιA ιB : Type*} [Fintype α]
    [Fintype ιA] [DecidableEq ιA] [Fintype ιB] [DecidableEq ιB]
    (M : _root_.LIDT.MIPStarRE.Quantum.Measurement α ιB) : _root_.LIDT.MIPStarRE.Quantum.Measurement α (ιA × ιB) :=
  _root_.MIPStarRE.QPBT.DistanceCalculus.rightPlacedMeasurement M

/-- The effects of the left placement. -/
@[simp] theorem Measurement.leftPlacement_effect {α ιA ιB : Type*} [Fintype α]
    [Fintype ιA] [DecidableEq ιA] [Fintype ιB] [DecidableEq ιB]
    (M : _root_.LIDT.MIPStarRE.Quantum.Measurement α ιA) (a : α) :
    (_root_.MIPStarRE.QPBT.Measurement.leftPlacement (ιB := ιB) M).effect a = _root_.MIPStarRE.QPBT.heteroKron (M.effect a) 1 := rfl

/-- The effects of the right placement. -/
@[simp] theorem Measurement.rightPlacement_effect {α ιA ιB : Type*} [Fintype α]
    [Fintype ιA] [DecidableEq ιA] [Fintype ιB] [DecidableEq ιB]
    (M : _root_.LIDT.MIPStarRE.Quantum.Measurement α ιB) (a : α) :
    (_root_.MIPStarRE.QPBT.Measurement.rightPlacement (ιA := ιA) M).effect a = _root_.MIPStarRE.QPBT.heteroKron 1 (M.effect a) := rfl










/-- The measurement obtained by relabelling the outcome set along a bijection.
Formalization support for `lem:pasting`, blueprint
`ch12_qpbt_games.tex:960-990`. -/
noncomputable def Measurement.congrAlphabet {α β ι : Type*} [Fintype α]
    [Fintype β] [Fintype ι] [DecidableEq ι] (e : β ≃ α) (M : _root_.LIDT.MIPStarRE.Quantum.Measurement α ι) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement β ι :=
  _root_.LIDT.MIPStarRE.Quantum.Measurement.ofSumEqOne (fun b => M.effect (e b)) (fun b => M.pos (e b))
    ((e.sum_comp M.effect).trans M.sum_eq_one)

/-- The effects of a relabelled measurement. -/
@[simp] theorem Measurement.congrAlphabet_effect {α β ι : Type*} [Fintype α]
    [Fintype β] [Fintype ι] [DecidableEq ι] (e : β ≃ α) (M : _root_.LIDT.MIPStarRE.Quantum.Measurement α ι)
    (b : β) :
    (_root_.MIPStarRE.QPBT.Measurement.congrAlphabet e M).effect b = M.effect (e b) := rfl





end MIPStarRE.QPBT
Source
https://github.com/Dengnifer/MIPStarRE-QPBT/blob/8f4118aeea7be16912adbaee3df6dce1741a2c26/QPBT/Games/Sandwich/Defs.lean#L66-L214

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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me