Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

QPBT definitions: Observables / Defs

Definition
QPBT_QPBT_Observables_Defs

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

qpbt

This bundle defines the heterogeneous strategy and its canonical question embeddings. It records the two local registers, the projective winning premise, local-space indexing and enumeration, the selected preprocessed measurement, and the point and line embeddings into the full Pauli question space.

Principal definitions:

  • MIPStarRE.QPBT.PlayerSide: defines the two local registers of a heterogeneous bipartite strategy.
  • MIPStarRE.QPBT.ProjectiveSetting: defines a projective strategy satisfying the winning premise used by the commutation argument.
  • MIPStarRE.QPBT.ProjectiveSetting.LocalSpace: defines the local Hilbert-space index type on a selected player side.
  • MIPStarRE.QPBT.ProjectiveSetting.localSpaceFintype: defines the finite enumeration structure on a local space.
  • MIPStarRE.QPBT.ProjectiveSetting.localSpaceDecidableEq: defines decidable equality for the local space.
  • MIPStarRE.QPBT.ProjectiveSetting.strategyMeasurement: selects the strategy measurement before outcome postprocessing on one player side.
  • MIPStarRE.QPBT.ProjectiveSetting.contentOfPoint: embeds a point into the full Pauli question space in a chosen basis.
  • MIPStarRE.QPBT.ProjectiveSetting.contentOfLine: embeds a canonical line description into the full Pauli question space.

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/Observables/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_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_Algebra_FieldBasis
import Definitions.Def_QPBT_QPBT_Algebra_Lines
import Definitions.Def_QPBT_QPBT_Algebra_LowDegreeCode
import Definitions.Def_QPBT_QPBT_Algebra_Pauli
import Definitions.Def_QPBT_QPBT_Games_Defs
import Definitions.Def_QPBT_QPBT_Games_DistanceTheorems_Support
import Definitions.Def_QPBT_QPBT_Games_Sandwich_Support
import Definitions.Def_QPBT_QPBT_Games_StrategyClasses
import Definitions.Def_QPBT_QPBT_Observables_LineDefs
import Definitions.Def_QPBT_QPBT_Test_LowDegreeGame
import Definitions.Def_QPBT_QPBT_Test_MagicSquare
import Definitions.Def_QPBT_QPBT_Test_PauliBasisTest
import Mathlib

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.ProjectiveSetting
end MIPStarRE.QPBT.ProjectiveSetting

/-!
# Typed strategy measurements and point observables

This file fixes a projective, possibly heterogeneous strategy for the Pauli
basis test and extracts the typed measurement families used in the analysis.
Malformed answers are folded into a fixed valid answer, so the extracted
families remain complete measurements. The winning hypothesis bounds their
original wrong-form mass by the rejection probability. `Option` is used only
for the completed line-evaluation classes.

## References

The ambient strategy convention and the observable `W^r(u)` are in
`references/qpbt-paper/14_analysis_of_the_pauli_basis_test.tex:160-190`,
corresponding to blueprint `def:strategy-observables`. The typed question
and answer forms come from blueprint `def:pauli-question-distribution` and
`def:pauli-win-predicate`, with paper origin
`references/qpbt-paper/08_classical_and_quantum_low_degree_tests.tex:964-1225`.
-/

@[expose] public section

open scoped BigOperators Matrix ComplexOrder

namespace MIPStarRE.QPBT

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

noncomputable section

/-- The two local registers of a heterogeneous bipartite strategy. This is
formalization-only indexing for the player-dependent notation at paper
`14_analysis_of_the_pauli_basis_test.tex:160-190`. -/
inductive PlayerSide where
  | alice
  | bob
  deriving DecidableEq, Repr, Inhabited

instance instFintypePlayerSide : Fintype _root_.MIPStarRE.QPBT.PlayerSide where
  elems := {.alice, .bob}
  complete := by
    intro side
    cases side <;> simp

/-- A projective strategy satisfying the winning premise used throughout
Section `sec:commutation`. The structure retains the distinct player spaces and
measurement families of `Strategy`. Paper
`14_analysis_of_the_pauli_basis_test.tex:160-172`; blueprint
`sec:commutation`. -/
structure ProjectiveSetting (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (ε : ℝ) where
  toStrategy : _root_.MIPStarRE.QPBT.Strategy (_root_.MIPStarRE.QPBT.pauliBasisTest P)
  isProjective : toStrategy.IsProjective
  win : 1 - ε ≤ toStrategy.value

namespace ProjectiveSetting

variable {P : _root_.MIPStarRE.QPBT.AdmissibleParams} {ε : ℝ}

/-- The local Hilbert-space index type on a specified player side. It indexes
the side-qualified operators at paper
`14_analysis_of_the_pauli_basis_test.tex:174-190`. -/
@[reducible] def LocalSpace (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) : _root_.MIPStarRE.QPBT.PlayerSide → Type
  | .alice => S.toStrategy.ιA
  | .bob => S.toStrategy.ιB

instance localSpaceFintype (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide) :
    Fintype (S.LocalSpace side) := by
  cases side <;> simp only [_root_.MIPStarRE.QPBT.ProjectiveSetting.LocalSpace] <;> infer_instance

instance localSpaceDecidableEq (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide) :
    DecidableEq (S.LocalSpace side) := by
  cases side <;> simp only [_root_.MIPStarRE.QPBT.ProjectiveSetting.LocalSpace] <;> infer_instance

/-- Select the strategy measurement before outcome postprocessing on one
player side. This is the heterogeneous interpretation of the shared symbol `M` at
paper `14_analysis_of_the_pauli_basis_test.tex:160-184`. -/
def strategyMeasurement (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (question : _root_.MIPStarRE.QPBT.PauliQuestion P) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement (_root_.MIPStarRE.QPBT.PauliAnswer P) (S.LocalSpace side) := by
  cases side with
  | alice => exact S.toStrategy.A question
  | bob => exact S.toStrategy.B question

/-- Embed a point into the full Pauli question space in basis `W`. This is the
point-question content from `def:pauli-question-distribution`, paper
`08_classical_and_quantum_low_degree_tests.tex:997-1008`, blueprint
`def:pauli-question-distribution`. -/
def contentOfPoint (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (W : _root_.MIPStarRE.QPBT.PauliKind)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.MIPStarRE.QPBT.PauliSpace P :=
  _root_.MIPStarRE.QPBT.embedLd P W fun i =>
    match i with
    | .inl (.inl j) => u j
    | .inl (.inr _) => 0
    | .inr _ => 0

/-- Embed a canonical line description into the full Pauli question space.
Axis lines clear the direction block, whereas diagonal lines retain their
canonical projected direction. Paper
`08_classical_and_quantum_low_degree_tests.tex:997-1008`; blueprint
`def:pauli-question-distribution` and `rem:deg-line-representatives`. -/
def contentOfLine (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (W : _root_.MIPStarRE.QPBT.PauliKind)
    (line : _root_.MIPStarRE.QPBT.LineDesc P.toLdParams) : _root_.MIPStarRE.QPBT.PauliSpace P :=
  _root_.MIPStarRE.QPBT.embedLd P W fun i =>
    match i with
    | .inl (.inl j) => line.base j
    | .inl (.inr _) => line.seed
    | .inr j =>
        match line with
        | .axis _ _ _ => 0
        | .diagonal _ _ direction _ _ => direction j

/-- Fill the point, scalar, and phase blocks shared by Pair, Pair/W, and Magic
Square questions. This is the type-4 content of
`def:pauli-question-distribution`, paper
`08_classical_and_quantum_low_degree_tests.tex:1030-1120`, blueprint
`def:pauli-question-distribution`. -/
def contentOfTuple (P : _root_.MIPStarRE.QPBT.AdmissibleParams)
    (uX uZ : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (rX rZ : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.MIPStarRE.QPBT.PauliSpace P :=
  fun i =>
    match i with
    | .inl (.inl (.inl (.inl (.inl j)))) => uX j
    | .inl (.inl (.inl (.inl (.inr j)))) => uZ j
    | .inl (.inl (.inl (.inr _))) => 0
    | .inl (.inl (.inr _)) => 0
    | .inl (.inr _) => rX
    | .inr _ => rZ

/-- The typed point question in basis `W`, from the strategy notation at paper
`14_analysis_of_the_pauli_basis_test.tex:174-190` and
blueprint `def:pauli-question-distribution`. -/
def pointQuestion (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (W : _root_.MIPStarRE.QPBT.PauliKind)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.MIPStarRE.QPBT.PauliQuestion P :=
  (.point W, _root_.MIPStarRE.QPBT.ProjectiveSetting.contentOfPoint P W u)

/-- The typed axis or diagonal line question represented by a canonical
`LineDesc`. Paper `14_analysis_of_the_pauli_basis_test.tex:174-184`; blueprint
`def:strategy-observables` and `rem:deg-line-representatives`. -/
def lineQuestion (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (W : _root_.MIPStarRE.QPBT.PauliKind)
    (line : _root_.MIPStarRE.QPBT.LineDesc P.toLdParams) : _root_.MIPStarRE.QPBT.PauliQuestion P :=
  match line.kind with
  | .axis => (.aline W, _root_.MIPStarRE.QPBT.ProjectiveSetting.contentOfLine P W line)
  | .diagonal => (.dline W, _root_.MIPStarRE.QPBT.ProjectiveSetting.contentOfLine P W line)

/-- The typed Pair question for a tuple `(u_X,u_Z,r_X,r_Z)`. Paper
`14_analysis_of_the_pauli_basis_test.tex:210-249`; blueprint
`lem:qld-win-implications`. -/
def pairQuestion (P : _root_.MIPStarRE.QPBT.AdmissibleParams)
    (uX uZ : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (rX rZ : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.MIPStarRE.QPBT.PauliQuestion P :=
  (.pair, _root_.MIPStarRE.QPBT.ProjectiveSetting.contentOfTuple P uX uZ rX rZ)

/-- The typed Pair/W question for a tuple `(u_X,u_Z,r_X,r_Z)`. Paper
`14_analysis_of_the_pauli_basis_test.tex:210-249`; blueprint
`lem:qld-win-implications`. -/
def pairWQuestion (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (W : _root_.MIPStarRE.QPBT.PauliKind)
    (uX uZ : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (rX rZ : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.MIPStarRE.QPBT.PauliQuestion P :=
  (.pairW W, _root_.MIPStarRE.QPBT.ProjectiveSetting.contentOfTuple P uX uZ rX rZ)

/-- The typed Magic Square question for a tuple `(u_X,u_Z,r_X,r_Z)`. Paper
`14_analysis_of_the_pauli_basis_test.tex:213-258`; blueprint
`lem:qld-win-implications`. -/
def msQuestion (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (t : _root_.MIPStarRE.QPBT.MsType)
    (uX uZ : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (rX rZ : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.MIPStarRE.QPBT.PauliQuestion P :=
  (.ms t, _root_.MIPStarRE.QPBT.ProjectiveSetting.contentOfTuple P uX uZ rX rZ)





-- The support rewrites below elaborate the `Fintype` instance of
-- `PauliEdge × PauliSpace P`, whose nested sigma/sum instance chain exceeds the
-- default recursion depth.














/-- Fold every non-point answer into the fixed point answer `0`. This realizes
the typed point family without adding a bottom outcome; wrong-form mass remains
visible through `wrongFormEffect`. Paper
`14_analysis_of_the_pauli_basis_test.tex:174-190`; blueprint
`def:strategy-observables`. -/
def pointAnswerOrZero {P : _root_.MIPStarRE.QPBT.AdmissibleParams} : _root_.MIPStarRE.QPBT.PauliAnswer P → _root_.MIPStarRE.QPBT.PauliScalar P
  | .value a => a
  | _ => 0

/-- Fold every answer not prescribed for `line` into the zero coefficient
list. Axis answers are padded from degree `d` to degree `m*d`. This realizes
the coefficient convention of `def:ideg-deg-polynomials`, paper
`14_analysis_of_the_pauli_basis_test.tex:51-62`, blueprint
`def:ideg-deg-polynomials`. -/
def lineAnswerOrZero (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (line : _root_.MIPStarRE.QPBT.LineDesc P.toLdParams) :
    _root_.MIPStarRE.QPBT.PauliAnswer P → _root_.MIPStarRE.QPBT.DegPoly P.toLdParams (P.m * P.d) :=
  match line with
  | .axis _ _ _ => fun answer =>
      match answer with
      | .alinePoly f =>
          _root_.MIPStarRE.QPBT.DegPoly.padTo (Nat.le_mul_of_pos_left P.d (Nat.zero_lt_of_lt P.one_le_m)) f
      | _ => 0
  | .diagonal _ _ _ _ _ => fun answer =>
      match answer with
      | .dlinePoly f => f
      | _ => 0

/-- Fold every non-Pair answer into `(0,0)`. This is the complete typed Pair
family used in items 4 and 6 of `lem:qld-win-implications`, paper
`14_analysis_of_the_pauli_basis_test.tex:210-258`. -/
def pairAnswerOrZero {P : _root_.MIPStarRE.QPBT.AdmissibleParams} : _root_.MIPStarRE.QPBT.PauliAnswer P → ZMod 2 × ZMod 2
  | .pairBits bits => bits
  | _ => (0, 0)

/-- Fold every non-Pair/W answer into bit `0`. This is the complete typed
Pair/W family used in items 4 and 7 of `lem:qld-win-implications`, paper
`14_analysis_of_the_pauli_basis_test.tex:210-263`. -/
def pairWAnswerOrZero {P : _root_.MIPStarRE.QPBT.AdmissibleParams} : _root_.MIPStarRE.QPBT.PauliAnswer P → ZMod 2
  | .bit bit => bit
  | _ => 0

/-- Fold wrong-form Pauli-test answers into a fixed valid Magic Square answer
of the requested question type. This supplies the typed families needed for an
actual `Strategy msGame`; paper
`14_analysis_of_the_pauli_basis_test.tex:213-258`, blueprint
`lem:qld-win-implications`. -/
def msAnswerOrZero {P : _root_.MIPStarRE.QPBT.AdmissibleParams} (t : _root_.MIPStarRE.QPBT.MsType) : _root_.MIPStarRE.QPBT.PauliAnswer P → _root_.MIPStarRE.QPBT.MsAnswer :=
  match t with
  | .constraint _ => fun answer =>
      match answer with
      | .msTriple bits => .triple bits
      | _ => .triple 0
  | .var _ => fun answer =>
      match answer with
      | .bit bit => .bit bit
      | _ => .bit 0

/-- The complete typed point measurement on one player side. It is the
corresponding strategy measurement postprocessed by `pointAnswerOrZero`; paper
`14_analysis_of_the_pauli_basis_test.tex:174-190`, blueprint
`def:strategy-observables`. -/
noncomputable def pointMeas (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (W : _root_.MIPStarRE.QPBT.PauliKind) (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement (_root_.MIPStarRE.QPBT.PauliScalar P) (S.LocalSpace side) :=
  (S.strategyMeasurement side (_root_.MIPStarRE.QPBT.ProjectiveSetting.pointQuestion P W u)).postprocess _root_.MIPStarRE.QPBT.ProjectiveSetting.pointAnswerOrZero

/-- The complete typed line measurement on one player side, uniformly indexed
by degree-`m*d` coefficient lists. Paper
`14_analysis_of_the_pauli_basis_test.tex:174-184`; blueprint
`def:ideg-deg-polynomials` and `lem:qld-win-implications`. -/
noncomputable def lineMeas (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (W : _root_.MIPStarRE.QPBT.PauliKind) (line : _root_.MIPStarRE.QPBT.LineDesc P.toLdParams) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement (_root_.MIPStarRE.QPBT.DegPoly P.toLdParams (P.m * P.d)) (S.LocalSpace side) :=
  (S.strategyMeasurement side (_root_.MIPStarRE.QPBT.ProjectiveSetting.lineQuestion P W line)).postprocess
    (_root_.MIPStarRE.QPBT.ProjectiveSetting.lineAnswerOrZero P line)

/-- The completed evaluation classes of a typed line measurement. This is the
only strategy-side family whose outcome uses `Option`; `none` is precisely the
non-evaluating class of `def:ideg-deg-polynomials`, paper
`14_analysis_of_the_pauli_basis_test.tex:51-62`, blueprint
`def:ideg-deg-polynomials`. -/
noncomputable def lineEvalMeas (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (W : _root_.MIPStarRE.QPBT.PauliKind) (line : _root_.MIPStarRE.QPBT.LineDesc P.toLdParams)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement (Option (_root_.MIPStarRE.QPBT.PauliScalar P)) (S.LocalSpace side) :=
  (S.lineMeas side W line).postprocess (_root_.MIPStarRE.QPBT.evalOpt line u)

/-- The complete typed Pair measurement on one player side. Paper
`14_analysis_of_the_pauli_basis_test.tex:210-249`; blueprint
`lem:qld-win-implications`. -/
noncomputable def pairMeas (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (uX uZ : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (rX rZ : _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement (ZMod 2 × ZMod 2) (S.LocalSpace side) :=
  (S.strategyMeasurement side (_root_.MIPStarRE.QPBT.ProjectiveSetting.pairQuestion P uX uZ rX rZ)).postprocess _root_.MIPStarRE.QPBT.ProjectiveSetting.pairAnswerOrZero

/-- The complete typed Pair/W measurement on one player side. Paper
`14_analysis_of_the_pauli_basis_test.tex:210-263`; blueprint
`lem:qld-win-implications`. -/
noncomputable def pairWMeas (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (W : _root_.MIPStarRE.QPBT.PauliKind) (uX uZ : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P)
    (rX rZ : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.LIDT.MIPStarRE.Quantum.Measurement (ZMod 2) (S.LocalSpace side) :=
  (S.strategyMeasurement side (_root_.MIPStarRE.QPBT.ProjectiveSetting.pairWQuestion P W uX uZ rX rZ)).postprocess
    _root_.MIPStarRE.QPBT.ProjectiveSetting.pairWAnswerOrZero

/-- The complete typed Pauli/W measurement on one player side. Paper
`14_analysis_of_the_pauli_basis_test.tex:205-209`; blueprint
`lem:qld-win-implications`. -/
noncomputable def pauliMeas (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (W : _root_.MIPStarRE.QPBT.PauliKind) : _root_.LIDT.MIPStarRE.Quantum.Measurement (_root_.MIPStarRE.QPBT.PauliRegister P) (S.LocalSpace side) :=
  (S.strategyMeasurement side (_root_.MIPStarRE.QPBT.pauliQuestion P W)).postprocess _root_.MIPStarRE.QPBT.pauliAnswerOrZero

/-- The complete typed Magic Square measurement on one player side. Its answer
alphabet is exactly `MsAnswer`; these families therefore define a Magic Square
strategy. Paper `14_analysis_of_the_pauli_basis_test.tex:213-258`;
blueprint `lem:qld-win-implications`. -/
noncomputable def msMeas (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (t : _root_.MIPStarRE.QPBT.MsType) (uX uZ : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P)
    (rX rZ : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.LIDT.MIPStarRE.Quantum.Measurement _root_.MIPStarRE.QPBT.MsAnswer (S.LocalSpace side) :=
  (S.strategyMeasurement side (_root_.MIPStarRE.QPBT.ProjectiveSetting.msQuestion P t uX uZ rX rZ)).postprocess
    (_root_.MIPStarRE.QPBT.ProjectiveSetting.msAnswerOrZero t)

/-- The sum of effects corresponding to answers that are invalid for a given
question type. This mass is kept separate from the fixed valid outcome into
which typed postprocessing folds it. Paper
`08_classical_and_quantum_low_degree_tests.tex:1126-1225`, blueprint
`def:pauli-win-predicate`. -/
noncomputable def wrongFormEffect {ι : Type*} [Fintype ι] [DecidableEq ι]
    (t : _root_.MIPStarRE.QPBT.PauliType) (M : _root_.LIDT.MIPStarRE.Quantum.Measurement (_root_.MIPStarRE.QPBT.PauliAnswer P) ι) : _root_.LIDT.MIPStarRE.Quantum.Op ι :=
  ∑ answer ∈ Finset.univ.filter (fun answer => _root_.MIPStarRE.QPBT.validPauliAnswer t answer = false),
    M.effect answer

















/-- The side-indexed strategy observable
`W^r(u) = sum_a (-1)^(tr(ar)) M_a^((Point,W),u)`. It uses the canonical
character `phaseSign` and the fixed trace of `P.model`. This is
`def:strategy-observables`, paper
`14_analysis_of_the_pauli_basis_test.tex:174-190`, blueprint
`def:strategy-observables`. -/
noncomputable def pointObs (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (W : _root_.MIPStarRE.QPBT.PauliKind) (r : _root_.MIPStarRE.QPBT.PauliScalar P) (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.LIDT.MIPStarRE.Quantum.Op (S.LocalSpace side) :=
  ∑ a : _root_.MIPStarRE.QPBT.PauliScalar P,
    _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) • (S.pointMeas side W u).effect a

/-- Select projectivity of the strategy POVM on either local space. -/
private theorem strategyMeasurement_isProjective
    (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide) (question : _root_.MIPStarRE.QPBT.PauliQuestion P) :
    _root_.MIPStarRE.QPBT.Measurement.IsProjective (S.strategyMeasurement side question) := by
  cases side with
  | alice => exact S.isProjective.1 question
  | bob => exact S.isProjective.2 question

/-- The typed point measurement remains projective after answer folding. -/
theorem pointMeas_isProjective (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε)
    (side : _root_.MIPStarRE.QPBT.PlayerSide) (W : _root_.MIPStarRE.QPBT.PauliKind) (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.MIPStarRE.QPBT.Measurement.IsProjective (S.pointMeas side W u) := by
  apply _root_.MIPStarRE.QPBT.SandwichProduct.postprocess_isProjective
  exact strategyMeasurement_isProjective S side _

/-- The point observables form an additive representation, as follows from
`eq:qld-strat-obs`, paper `14_analysis_of_the_pauli_basis_test.tex:174-190`.
This multiplication law is a formalization-only consequence of that definition. -/
theorem pointObs_mul (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide)
    (W : _root_.MIPStarRE.QPBT.PauliKind) (r s : _root_.MIPStarRE.QPBT.PauliScalar P)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) :
    S.pointObs side W r u * S.pointObs side W s u =
      S.pointObs side W (r + s) u := by
  classical
  let M := S.pointMeas side W u
  have hM : _root_.MIPStarRE.QPBT.Measurement.IsProjective M := _root_.MIPStarRE.QPBT.ProjectiveSetting.pointMeas_isProjective S side W u
  change (∑ a : _root_.MIPStarRE.QPBT.PauliScalar P,
      _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) • M.effect a) *
      (∑ a : _root_.MIPStarRE.QPBT.PauliScalar P,
        _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * s)) • M.effect a) =
    ∑ a : _root_.MIPStarRE.QPBT.PauliScalar P,
      _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * (r + s))) • M.effect a
  calc
    _ = ∑ a : _root_.MIPStarRE.QPBT.PauliScalar P, ∑ b : _root_.MIPStarRE.QPBT.PauliScalar P,
        (_root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) *
          _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (b * s))) •
            (M.effect a * M.effect b) := by
      rw [Finset.sum_mul]
      apply Finset.sum_congr rfl
      intro a ha
      rw [Finset.mul_sum]
      apply Finset.sum_congr rfl
      intro b hb
      rw [Matrix.smul_mul, Matrix.mul_smul, smul_smul]
    _ = ∑ a : _root_.MIPStarRE.QPBT.PauliScalar P,
        _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * (r + s))) • M.effect a := by
      apply Finset.sum_congr rfl
      intro a ha
      rw [Finset.sum_eq_single a]
      · rw [(hM a).isIdempotentElem.eq]
        congr 1
        rw [mul_add, _root_.MIPStarRE.QPBT.fixedBinTrace, map_add, _root_.MIPStarRE.QPBT.phaseSign_add]
      · intro b hb hba
        have hab : a ≠ b := fun h => hba h.symm
        rw [_root_.MIPStarRE.QPBT.DistanceCalculus.projective_effect_mul_effect_eq_zero M hM hab]
        simp
      · intro ha'
        exact (ha' (Finset.mem_univ a)).elim







end ProjectiveSetting

end

end MIPStarRE.QPBT
Source
https://github.com/Dengnifer/MIPStarRE-QPBT/blob/8f4118aeea7be16912adbaee3df6dce1741a2c26/QPBT/Observables/Defs.lean#L40-L691

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