Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

QPBT definitions: Observables / ExpandedDefs

Definition
QPBT_QPBT_Observables_ExpandedDefs

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

qpbt

This bundle sets up the six-register realization of the strategy state and the four register placements used in the Pauli-basis consistency statements. It also defines the local Hilbert-space side and the operator embedding that places an operator on one selected register pair while leaving the other registers unchanged.

Principal definitions:

  • MIPStarRE.QPBT.SixReg: defines the six-register space with distinct Alice and Bob local registers.
  • MIPStarRE.QPBT.sixRegDecidableEq: records decidable equality for six-register indices.
  • MIPStarRE.QPBT.sixRegShuffle: reassociates the strategy state and two EPR states into the six-register order.
  • MIPStarRE.QPBT.Placement: defines the four register placements used by the consistency statements.
  • MIPStarRE.QPBT.Placement.side: identifies the strategy-player side supplying the local Hilbert space in each placement.
  • MIPStarRE.QPBT.ProjectiveSetting.ExpandedLocalSpace: pairs a strategy-local register with one generalized-Pauli register.
  • MIPStarRE.QPBT.ProjectiveSetting.psiHat: defines the strategy state tensored with the two EPR states in six-register order.
  • MIPStarRE.QPBT.ProjectiveSetting.place: places an operator on one selected register pair and uses identity on the remaining registers.

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/ExpandedDefs.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_FiniteMatrix_NormalizedTrace
import Definitions.Def_LIDT_MIPStarRE_Quantum_FiniteMatrix_Order
import Definitions.Def_LIDT_MIPStarRE_Quantum_Measurement
import Definitions.Def_QPBT_QPBT_Algebra_FieldBasis
import Definitions.Def_QPBT_QPBT_Algebra_LowDegreeCode
import Definitions.Def_QPBT_QPBT_Algebra_Pauli
import Definitions.Def_QPBT_QPBT_Algebra_PauliTheorems
import Definitions.Def_QPBT_QPBT_Games_Defs
import Definitions.Def_QPBT_QPBT_Games_DistanceTheorems_Support
import Definitions.Def_QPBT_QPBT_Observables_Defs
import Definitions.Def_QPBT_QPBT_State
import Definitions.Def_QPBT_QPBT_Test_PauliBasisTest
import Definitions.Def_QPBT_QPBT_Upstream
import Mathlib
import Theorems.Thm_LIDT_MIPStarRE_LDT_Preliminaries_fourier_fact_scalar
import Theorems.Thm_LIDT_MIPStarRE_LDT_averageOperatorOverDistribution_const_of_isProbability
import Theorems.Thm_LIDT_MIPStarRE_LDT_averageOperatorOverDistribution_mul_left_right
import Theorems.Thm_LIDT_MIPStarRE_LDT_averageOperatorOverDistribution_uniform_equiv

namespace LIDT.MIPStarRE.LDT
end LIDT.MIPStarRE.LDT
namespace LIDT.MIPStarRE.LDT.Preliminaries
end LIDT.MIPStarRE.LDT.Preliminaries
namespace LIDT.MIPStarRE.Quantum
end LIDT.MIPStarRE.Quantum
namespace MIPStarRE.QPBT
end MIPStarRE.QPBT
namespace MIPStarRE.QPBT.ProjectiveSetting
end MIPStarRE.QPBT.ProjectiveSetting

/-!
# Expanded registers and point measurements

This module adjoins two EPR pairs to a heterogeneous Pauli-basis-test strategy,
records the four register placements used in the analysis, and defines the
expanded point observables and measurements. Fourier inversion identifies their
effects with a convolution of projectors and proves completeness and projectivity.

## References

The constructions formalize blueprint `def:expanded-state`,
`def:expanded-observables`, `def:expanded-point-measurement`, and
`def:expanded-point-trace-projection`. Their paper source is
`references/qpbt-paper/14_analysis_of_the_pauli_basis_test.tex:367-418`.
-/

@[expose] public section

open scoped BigOperators Matrix MatrixOrder ComplexOrder

namespace MIPStarRE.QPBT

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

noncomputable section

/-- The six registers `AA'A''BB'B''`, retaining distinct Alice and Bob local
spaces. This is the register index type of `def:expanded-state`, paper
`14_analysis_of_the_pauli_basis_test.tex:367-372`, blueprint
`def:expanded-state`. -/
abbrev SixReg (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (ιA ιB : Type*) :=
  (ιA × (_root_.MIPStarRE.QPBT.PauliRegister P × _root_.MIPStarRE.QPBT.PauliRegister P)) ×
    (ιB × (_root_.MIPStarRE.QPBT.PauliRegister P × _root_.MIPStarRE.QPBT.PauliRegister P))

/-- Equality of six-register indices is supplied by classical decidability for
the register type. This is the index set of blueprint
`def:expanded-state`. -/
noncomputable instance sixRegDecidableEq (P : _root_.MIPStarRE.QPBT.AdmissibleParams)
    (ιA ιB : Type*) : DecidableEq (_root_.MIPStarRE.QPBT.SixReg P ιA ιB) :=
  Classical.decEq _

/-- Reassociate the tensor product of the strategy state and two EPR states
directly into register order `AA'A''BB'B''` for
`eq:def-psihat`, paper `14_analysis_of_the_pauli_basis_test.tex:367-372`. -/
def sixRegShuffle (P : _root_.MIPStarRE.QPBT.AdmissibleParams) (ιA ιB : Type*) :
    (((ιA × ιB) × (_root_.MIPStarRE.QPBT.PauliRegister P × _root_.MIPStarRE.QPBT.PauliRegister P)) ×
        (_root_.MIPStarRE.QPBT.PauliRegister P × _root_.MIPStarRE.QPBT.PauliRegister P)) ≃ _root_.MIPStarRE.QPBT.SixReg P ιA ιB where
  toFun p := ((p.1.1.1, (p.1.2.1, p.1.2.2)),
    (p.1.1.2, (p.2.1, p.2.2)))
  invFun p := (((p.1.1, p.2.1), (p.1.2.1, p.1.2.2)),
    (p.2.2.1, p.2.2.2))
  left_inv p := by cases p; rfl
  right_inv p := by cases p; rfl

/-- The four placements `AA'`, `BA''`, `BB'`, and `AB''` used explicitly in
the chapter-14 consistency statements. Paper
`14_analysis_of_the_pauli_basis_test.tex:420-450`; blueprint
`def:symmetric-equivalents`. -/
inductive Placement where
  | AA'
  | BA''
  | BB'
  | AB''
  deriving DecidableEq, Repr, Inhabited

instance instFintypePlacement : Fintype _root_.MIPStarRE.QPBT.Placement where
  elems := {.AA', .BA'', .BB', .AB''}
  complete := by
    intro placement
    cases placement <;> simp

/-- The strategy-player side supplying the local Hilbert space in each of the
four register placements at paper
`14_analysis_of_the_pauli_basis_test.tex:420-450`. -/
@[reducible] def Placement.side : _root_.MIPStarRE.QPBT.Placement → _root_.MIPStarRE.QPBT.PlayerSide
  | .AA' => .alice
  | .BA'' => .bob
  | .BB' => .bob
  | .AB'' => .alice

namespace ProjectiveSetting

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

/-- A strategy-local register paired with one generalized-Pauli register. This
is the operator space in `def:expanded-observables`, paper
`14_analysis_of_the_pauli_basis_test.tex:374-382`. -/
abbrev ExpandedLocalSpace (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (side : _root_.MIPStarRE.QPBT.PlayerSide) :=
  S.LocalSpace side × _root_.MIPStarRE.QPBT.PauliRegister P

/-- The strategy state tensored with EPR states on `A'A''` and `B'B''`, in the
six-register order. This is `eq:def-psihat`, paper
`14_analysis_of_the_pauli_basis_test.tex:367-372`, blueprint
`eq:def-psihat`. -/
noncomputable def psiHat (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) :
    EuclideanSpace ℂ (_root_.MIPStarRE.QPBT.SixReg P S.toStrategy.ιA S.toStrategy.ιB) := by
  classical
  exact
    _root_.MIPStarRE.QPBT.reindexState (_root_.MIPStarRE.QPBT.sixRegShuffle P S.toStrategy.ιA S.toStrategy.ιB)
      (_root_.MIPStarRE.QPBT.vecTensor
        (_root_.MIPStarRE.QPBT.vecTensor S.toStrategy.ψ (_root_.MIPStarRE.QPBT.eprState (_root_.MIPStarRE.QPBT.PauliRegister P)))
        (_root_.MIPStarRE.QPBT.eprState (_root_.MIPStarRE.QPBT.PauliRegister P)))

/-- Place an operator on one of `AA'`, `BA''`, `BB'`, or `AB''`, with the
identity on all remaining registers. The input local space is determined by
the placement, so no equality between the player spaces is assumed. Paper
`14_analysis_of_the_pauli_basis_test.tex:420-450`; blueprint
`def:symmetric-equivalents`. -/
noncomputable def place (S : _root_.MIPStarRE.QPBT.ProjectiveSetting P ε) (p : _root_.MIPStarRE.QPBT.Placement)
    (O : _root_.LIDT.MIPStarRE.Quantum.Op (S.ExpandedLocalSpace p.side)) :
    _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.SixReg P S.toStrategy.ιA S.toStrategy.ιB) :=
  fun i j =>
    match p with
    | .AA' =>
        O (i.1.1, i.1.2.1) (j.1.1, j.1.2.1) *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.1.2.2 j.1.2.2 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op S.toStrategy.ιB) i.2.1 j.2.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.2.2.1 j.2.2.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.2.2.2 j.2.2.2
    | .BA'' =>
        (1 : _root_.LIDT.MIPStarRE.Quantum.Op S.toStrategy.ιA) i.1.1 j.1.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.1.2.1 j.1.2.1 *
          O (i.2.1, i.1.2.2) (j.2.1, j.1.2.2) *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.2.2.1 j.2.2.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.2.2.2 j.2.2.2
    | .BB' =>
        (1 : _root_.LIDT.MIPStarRE.Quantum.Op S.toStrategy.ιA) i.1.1 j.1.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.1.2.1 j.1.2.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.1.2.2 j.1.2.2 *
          O (i.2.1, i.2.2.1) (j.2.1, j.2.2.1) *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.2.2.2 j.2.2.2
    | .AB'' =>
        O (i.1.1, i.2.2.2) (j.1.1, j.2.2.2) *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.1.2.1 j.1.2.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.1.2.2 j.1.2.2 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op S.toStrategy.ιB) i.2.1 j.2.1 *
          (1 : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P)) i.2.2.1 j.2.2.1

/-- The expanded observable
`W^r(u) tensor tau^W(r * ind_m(u))` on a selected player side. This is
Equation `eq:lc-23`, paper `14_analysis_of_the_pauli_basis_test.tex:374-382`,
blueprint `eq:lc-23`. -/
noncomputable def expObs (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.ExpandedLocalSpace side) :=
  _root_.MIPStarRE.QPBT.heteroKron (S.pointObs side W r u)
    (_root_.MIPStarRE.QPBT.tauObservable W (fun h => r * _root_.MIPStarRE.QPBT.indicatorVec u h))

/-- The Fourier average defining the expanded point effect. This is the first
display of `def:expanded-point-measurement`, paper
`14_analysis_of_the_pauli_basis_test.tex:384-418`, blueprint
`def:expanded-point-measurement`. -/
noncomputable def expPointOp (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) (a : _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.LIDT.MIPStarRE.Quantum.Op (S.ExpandedLocalSpace side) :=
  _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution (_root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P)) fun r =>
    _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) • S.expObs side W r u

/-- The Pauli-register projector onto labels whose low-degree encoding has
value `a` at `u`. This is Equation `eq:qld-point-obs-def`, paper
`14_analysis_of_the_pauli_basis_test.tex:389-394`, blueprint
`eq:qld-point-obs-def`. -/
noncomputable def tauPointProj (W : _root_.MIPStarRE.QPBT.PauliKind)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (a : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.LIDT.MIPStarRE.Quantum.Op (_root_.MIPStarRE.QPBT.PauliRegister P) :=
  ∑ h ∈ Finset.univ.filter (fun h : _root_.MIPStarRE.QPBT.PauliRegister P =>
      dotProduct h (_root_.MIPStarRE.QPBT.indicatorVec u) = a),
    _root_.MIPStarRE.QPBT.pauliProj W h





/-- The phase induced by the fixed binary trace is an additive character. -/
private theorem phaseSign_fixedBinTrace_mul (x y : _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model x) * _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model y) =
      _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (x + y)) := by
  rw [_root_.MIPStarRE.QPBT.fixedBinTrace, map_add]
  exact (_root_.MIPStarRE.QPBT.phaseSign_add _ _).symm

/-- The trace phase converts addition of coefficients to multiplication. -/
private theorem phaseSign_fixedBinTrace_mul_add (x y r : _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (x * r)) *
        _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (y * r)) =
      _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model ((x + y) * r)) := by
  rw [add_mul]
  exact phaseSign_fixedBinTrace_mul (x * r) (y * r)

/-- Orthogonality of the fixed trace character over the Pauli scalar field. -/
private theorem phaseSign_fixedBinTrace_expect (c : _root_.MIPStarRE.QPBT.PauliScalar P) :
    (𝔼 r : _root_.MIPStarRE.QPBT.PauliScalar P, _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (c * r))) =
      if c = 0 then (1 : ℂ) else 0 := by
  simpa only [_root_.MIPStarRE.QPBT.fixedBinTrace, _root_.MIPStarRE.QPBT.phaseSign_eq_ffChar,
    _root_.LIDT.MIPStarRE.LDT.Preliminaries.ffChar_apply, mul_comm c] using
    (_root_.LIDT.MIPStarRE.LDT.Preliminaries.fourier_fact_scalar (p := 2) (F := _root_.MIPStarRE.QPBT.PauliScalar P) c)

/-- Averaging a trace phase times an operator selects the zero coefficient. -/
private theorem average_phaseSign_fixedBinTrace_smul
    {ι : Type*} [Fintype ι] [DecidableEq ι]
    (c : _root_.MIPStarRE.QPBT.PauliScalar P) (A : _root_.LIDT.MIPStarRE.Quantum.Op ι) :
    _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution (_root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P))
        (fun r => _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (c * r)) • A) =
      if c = 0 then A else 0 := by
  classical
  rw [_root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_smul_const]
  simp only [_root_.LIDT.MIPStarRE.LDT.uniformDistribution, _root_.LIDT.MIPStarRE.LDT.Distribution.uniformOnFinset,
    Finset.mem_univ, if_true, Finset.card_univ, ← Finset.mul_sum]
  have havg := phaseSign_fixedBinTrace_expect (P := P) c
  rw [Fintype.expect_eq_sum_div_card] at havg
  have hcoeff :
      ((1 / (Fintype.card (_root_.MIPStarRE.QPBT.PauliScalar P) : ℝ) : ℝ) : ℂ) *
          (∑ r : _root_.MIPStarRE.QPBT.PauliScalar P,
            _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (c * r))) =
        if c = 0 then (1 : ℂ) else 0 := by
    push_cast
    simpa only [one_div, div_eq_mul_inv, one_mul, mul_comm] using havg
  rw [hcoeff]
  by_cases hc : c = 0 <;> simp [hc]

/-- Averaging three fixed trace characters imposes the convolution constraint. -/
private theorem average_three_phaseSign_fixedBinTrace_smul
    {ι : Type*} [Fintype ι] [DecidableEq ι]
    (a x y : _root_.MIPStarRE.QPBT.PauliScalar P) (A : _root_.LIDT.MIPStarRE.Quantum.Op ι) :
    _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution (_root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P))
        (fun r => _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) •
          (_root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (x * r)) •
            (_root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (y * r)) • A))) =
      if x + y = a then A else 0 := by
  haveI : CharP (_root_.MIPStarRE.QPBT.PauliScalar P) 2 :=
    (Algebra.charP_iff (ZMod 2) (_root_.MIPStarRE.QPBT.PauliScalar P) 2).mp (ZMod.charP 2)
  have hzero : a + x + y = 0 ↔ x + y = a := by
    constructor
    · intro h
      exact (CharTwo.add_eq_zero.mp (by simpa only [add_assoc] using h)).symm
    · intro h
      rw [add_assoc]
      exact CharTwo.add_eq_zero.mpr h.symm
  calc
    _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution (_root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P))
        (fun r => _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) •
          (_root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (x * r)) •
            (_root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (y * r)) • A))) =
      _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution (_root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P))
        (fun r => _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model ((a + x + y) * r)) • A) := by
          apply _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_congr
          intro r
          rw [smul_smul, phaseSign_fixedBinTrace_mul_add a x r, smul_smul,
            phaseSign_fixedBinTrace_mul_add (a + x) y r]
    _ = if a + x + y = 0 then A else 0 :=
      average_phaseSign_fixedBinTrace_smul (a + x + y) A
    _ = if x + y = a then A else 0 := if_congr hzero rfl rfl

/-- A scalar in the indicator vector factors out of the dot product. -/
private theorem dot_smul_indicator (r : _root_.MIPStarRE.QPBT.PauliScalar P)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (e : _root_.MIPStarRE.QPBT.PauliRegister P) :
    dotProduct (fun h => r * _root_.MIPStarRE.QPBT.indicatorVec u h) e =
      dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) * r := by
  change dotProduct (r • _root_.MIPStarRE.QPBT.indicatorVec u) e = _
  rw [smul_dotProduct, dotProduct_comm, smul_eq_mul, mul_comm]

/-- Tensor products distribute over the sums in both factors. -/
private theorem heteroKron_sum_sum {α β ι κ : Type*}
    [Fintype α] [Fintype β] (A : α → _root_.LIDT.MIPStarRE.Quantum.Op ι) (B : β → _root_.LIDT.MIPStarRE.Quantum.Op κ) :
    _root_.MIPStarRE.QPBT.heteroKron (∑ x, A x) (∑ y, B y) =
      ∑ x, ∑ y, _root_.MIPStarRE.QPBT.heteroKron (A x) (B y) := by
  rw [_root_.MIPStarRE.QPBT.DistanceCalculus.heteroKron_finset_sum_left]
  exact Finset.sum_congr rfl fun x _ =>
    _root_.MIPStarRE.QPBT.DistanceCalculus.heteroKron_finset_sum_right _ _ _

/-- Scalars in the two tensor factors act successively on their tensor product. -/
private theorem heteroKron_smul_smul {ι κ : Type*}
    (c d : ℂ) (A : _root_.LIDT.MIPStarRE.Quantum.Op ι) (B : _root_.LIDT.MIPStarRE.Quantum.Op κ) :
    _root_.MIPStarRE.QPBT.heteroKron (c • A) (d • B) = c • (d • _root_.MIPStarRE.QPBT.heteroKron A B) := by
  unfold _root_.MIPStarRE.QPBT.heteroKron Matrix.kronecker
  rw [Matrix.smul_kronecker, Matrix.kronecker_smul]

/-- The expanded point effect is the convolution of the strategy point
measurement and the Pauli-register point projection. This is the final display
of `def:expanded-point-measurement`, paper
`14_analysis_of_the_pauli_basis_test.tex:395-418`. -/
theorem expPointOp_eq_convolution (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)
    (a : _root_.MIPStarRE.QPBT.PauliScalar P) :
    S.expPointOp side W u a =
      ∑ p ∈ Finset.univ.filter (fun p : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P =>
          p.1 + p.2 = a),
        _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
          (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u p.2) := by
  classical
  rw [_root_.MIPStarRE.QPBT.ProjectiveSetting.expPointOp]
  simp only [_root_.MIPStarRE.QPBT.ProjectiveSetting.expObs, _root_.MIPStarRE.QPBT.ProjectiveSetting.pointObs, _root_.MIPStarRE.QPBT.tauObservable_eq_sum_pauliProj]
  simp_rw [dot_smul_indicator]
  calc
    _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution (_root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P))
        (fun r => _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) •
          _root_.MIPStarRE.QPBT.heteroKron
            (∑ x, _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (x * r)) •
              (S.pointMeas side W u).effect x)
            (∑ e, _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model
              (dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) * r)) • _root_.MIPStarRE.QPBT.pauliProj W e)) =
      _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution (_root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P))
        (fun r => ∑ x, ∑ e,
          _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) •
            (_root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (x * r)) •
              (_root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model
                (dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) * r)) •
                  _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect x)
                    (_root_.MIPStarRE.QPBT.pauliProj W e)))) := by
          apply _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_congr
          intro r
          rw [heteroKron_sum_sum]
          simp_rw [heteroKron_smul_smul, Finset.smul_sum]
    _ = ∑ x, ∑ e,
          if x + dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) = a then
            _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect x) (_root_.MIPStarRE.QPBT.pauliProj W e)
          else 0 := by
      rw [_root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_sum]
      simp_rw [_root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_sum]
      simp_rw [average_three_phaseSign_fixedBinTrace_smul]
    _ = ∑ p ∈ Finset.univ.filter (fun p : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P =>
          p.1 + p.2 = a),
        _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
          (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u p.2) := by
      simp only [_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj]
      rw [Finset.sum_filter, Fintype.sum_prod_type]
      apply Finset.sum_congr rfl
      intro x hx
      calc
        (∑ e, if x + dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) = a then
              _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect x) (_root_.MIPStarRE.QPBT.pauliProj W e)
            else 0) =
          ∑ y, ∑ e ∈ Finset.univ.filter
              (fun e : _root_.MIPStarRE.QPBT.PauliRegister P => dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) = y),
            if x + dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) = a then
              _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect x) (_root_.MIPStarRE.QPBT.pauliProj W e)
            else 0 :=
          (Finset.sum_fiberwise Finset.univ
            (fun e : _root_.MIPStarRE.QPBT.PauliRegister P => dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u))
            (fun e => if x + dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) = a then
              _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect x) (_root_.MIPStarRE.QPBT.pauliProj W e)
            else 0)).symm
        _ = ∑ y, if x + y = a then
              _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect x)
                (∑ e ∈ Finset.univ.filter
                  (fun e : _root_.MIPStarRE.QPBT.PauliRegister P =>
                    dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u) = y),
                  _root_.MIPStarRE.QPBT.pauliProj W e)
            else 0 := by
          apply Finset.sum_congr rfl
          intro y hy
          by_cases hxy : x + y = a
          · rw [if_pos hxy, _root_.MIPStarRE.QPBT.DistanceCalculus.heteroKron_finset_sum_right]
            apply Finset.sum_congr rfl
            intro e he
            rw [if_pos]
            rw [(Finset.mem_filter.mp he).2]
            exact hxy
          · rw [if_neg hxy]
            apply Finset.sum_eq_zero
            intro e he
            rw [if_neg]
            intro heq
            apply hxy
            rw [← (Finset.mem_filter.mp he).2]
            exact heq

/-- Each point fiber is a sum of positive Pauli projectors. -/
private theorem tauPointProj_nonneg (W : _root_.MIPStarRE.QPBT.PauliKind)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (a : _root_.MIPStarRE.QPBT.PauliScalar P) :
    0 ≤ _root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u a := by
  classical
  unfold _root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj
  exact Finset.sum_nonneg fun e he =>
    Matrix.nonneg_iff_posSemidef.mpr (_root_.MIPStarRE.QPBT.posSemidef_pauliProj W e)

/-- The point fibers partition the complete family of Pauli eigenspace projectors. -/
private theorem sum_tauPointProj_eq_one (W : _root_.MIPStarRE.QPBT.PauliKind)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) :
    ∑ a, _root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u a = 1 := by
  classical
  rw [show (∑ a, _root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u a) =
      ∑ e : _root_.MIPStarRE.QPBT.PauliRegister P, _root_.MIPStarRE.QPBT.pauliProj W e by
    simp only [_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj]
    exact Finset.sum_fiberwise Finset.univ
      (fun e : _root_.MIPStarRE.QPBT.PauliRegister P => dotProduct e (_root_.MIPStarRE.QPBT.indicatorVec u))
      (fun e => _root_.MIPStarRE.QPBT.pauliProj W e)]
  exact _root_.MIPStarRE.QPBT.sum_pauliProj_eq_one W

/-- The projective point measurement on one Pauli register obtained by
coarse-graining the generalized Pauli basis according to its value at `u`.
This is the ancillary measurement used in item 1 of `lem:qld-comm-cons`, paper
`eq:qld-point-obs-def` in
`references/qpbt-paper/14_analysis_of_the_pauli_basis_test.tex:385-411`,
blueprint `def:ancillary-point-measurement`. -/
noncomputable def tauPointMeas (W : _root_.MIPStarRE.QPBT.PauliKind)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement (_root_.MIPStarRE.QPBT.PauliScalar P) (_root_.MIPStarRE.QPBT.PauliRegister P) :=
  _root_.LIDT.MIPStarRE.Quantum.Measurement.ofSumEqOne (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u) (by
    exact tauPointProj_nonneg W u) (by
    exact sum_tauPointProj_eq_one W u)

/-- The effects of the Pauli point measurement are the point projectors. -/
@[simp] theorem tauPointMeas_effect (W : _root_.MIPStarRE.QPBT.PauliKind)
    (u : Fin P.m → _root_.MIPStarRE.QPBT.PauliScalar P) (a : _root_.MIPStarRE.QPBT.PauliScalar P) :
    (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointMeas W u).effect a = _root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u a := rfl

/-- The fine product measurement underlying the convolution definition of an
expanded point measurement. Its outcome records the strategy and Pauli point
values separately. Paper
`references/qpbt-paper/14_analysis_of_the_pauli_basis_test.tex:390-411`,
blueprint `def:point-tau-measurement`. -/
noncomputable def pointTauMeas (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 × _root_.MIPStarRE.QPBT.PauliScalar P) (S.ExpandedLocalSpace side) :=
  _root_.LIDT.MIPStarRE.Quantum.Measurement.ofSumEqOne
    (fun p => _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
      ((_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointMeas W u).effect p.2))
    (fun p => _root_.LIDT.MIPStarRE.Quantum.kronecker_nonneg
      ((S.pointMeas side W u).pos p.1) ((_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointMeas W u).pos p.2))
    (by
      change ∑ p : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P,
          _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
            (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u p.2) = 1
      rw [Fintype.sum_prod_type]
      calc
        (∑ x, ∑ y, _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect x)
            (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u y)) =
            _root_.MIPStarRE.QPBT.heteroKron (∑ x, (S.pointMeas side W u).effect x)
              (∑ y, _root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u y) := (heteroKron_sum_sum _ _).symm
        _ = 1 := by
          rw [(S.pointMeas side W u).sum_eq_one, sum_tauPointProj_eq_one]
          exact Matrix.one_kronecker_one)

/-- Effects of the fine product measurement are the corresponding Kronecker
products of strategy and Pauli point effects. -/
@[simp] theorem pointTauMeas_effect (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)
    (p : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P) :
    (S.pointTauMeas side W u).effect p =
      _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
        (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u p.2) := rfl

/-- Expanded point effects are positive semidefinite. This is the positivity
obligation in `def:expanded-point-measurement`, paper
`14_analysis_of_the_pauli_basis_test.tex:384-418`. -/
theorem expPointOp_nonneg (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) (a : _root_.MIPStarRE.QPBT.PauliScalar P) :
    0 ≤ S.expPointOp side W u a := by
  rw [_root_.MIPStarRE.QPBT.ProjectiveSetting.expPointOp_eq_convolution]
  exact Finset.sum_nonneg fun p hp => _root_.LIDT.MIPStarRE.Quantum.kronecker_nonneg
    ((S.pointMeas side W u).pos p.1) (tauPointProj_nonneg W u p.2)

/-- Expanded point effects sum to the identity. This is the completeness
obligation in `def:expanded-point-measurement`, paper
`14_analysis_of_the_pauli_basis_test.tex:384-418`. -/
theorem expPointOp_sum_eq_one (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) :
    ∑ a, S.expPointOp side W u a = 1 := by
  simp_rw [_root_.MIPStarRE.QPBT.ProjectiveSetting.expPointOp_eq_convolution]
  calc
    (∑ a, ∑ p ∈ Finset.univ.filter
        (fun p : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P => p.1 + p.2 = a),
      _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
        (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u p.2)) =
      ∑ p : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P,
        _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
          (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u p.2) := by
      let f : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P → _root_.MIPStarRE.QPBT.PauliScalar P :=
        fun p => p.1 + p.2
      let A : _root_.MIPStarRE.QPBT.PauliScalar P × _root_.MIPStarRE.QPBT.PauliScalar P →
          _root_.LIDT.MIPStarRE.Quantum.Op (S.ExpandedLocalSpace side) := fun p =>
        _root_.MIPStarRE.QPBT.heteroKron ((S.pointMeas side W u).effect p.1)
          (_root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u p.2)
      change (∑ a, ∑ p ∈ Finset.univ.filter (fun p => f p = a), A p) =
        ∑ p, A p
      exact Finset.sum_fiberwise Finset.univ f A
    _ = _root_.MIPStarRE.QPBT.heteroKron (∑ x, (S.pointMeas side W u).effect x)
        (∑ y, _root_.MIPStarRE.QPBT.ProjectiveSetting.tauPointProj W u y) := by
      rw [Fintype.sum_prod_type]
      exact (heteroKron_sum_sum _ _).symm
    _ = 1 := by
      rw [(S.pointMeas side W u).sum_eq_one,
        sum_tauPointProj_eq_one (P := P)]
      exact Matrix.one_kronecker_one

/-- The complete expanded point measurement on the chosen player and Pauli
register. Its effects are those of `def:expanded-point-measurement`, paper
`14_analysis_of_the_pauli_basis_test.tex:384-418`, blueprint
`def:expanded-point-measurement`. -/
noncomputable def pointMeasExp (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.ExpandedLocalSpace side) :=
  _root_.LIDT.MIPStarRE.Quantum.Measurement.ofSumEqOne (S.expPointOp side W u)
    (S.expPointOp_nonneg side W u) (S.expPointOp_sum_eq_one side W u)



/-- Expanded observables inherit the additive representation law. -/
private theorem expObs_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.expObs side W r u * S.expObs side W s u =
      S.expObs side W (r + s) u := by
  calc
    S.expObs side W r u * S.expObs side W s u =
        _root_.MIPStarRE.QPBT.heteroKron
          (S.pointObs side W r u * S.pointObs side W s u)
          (_root_.MIPStarRE.QPBT.tauObservable W (fun h => r * _root_.MIPStarRE.QPBT.indicatorVec u h) *
            _root_.MIPStarRE.QPBT.tauObservable W (fun h => s * _root_.MIPStarRE.QPBT.indicatorVec u h)) := by
      exact (Matrix.mul_kronecker_mul
        (S.pointObs side W r u) (S.pointObs side W s u)
        (_root_.MIPStarRE.QPBT.tauObservable W (fun h => r * _root_.MIPStarRE.QPBT.indicatorVec u h))
        (_root_.MIPStarRE.QPBT.tauObservable W (fun h => s * _root_.MIPStarRE.QPBT.indicatorVec u h))).symm
    _ = _root_.MIPStarRE.QPBT.heteroKron (S.pointObs side W (r + s) u)
        (_root_.MIPStarRE.QPBT.tauObservable W ((fun h => r * _root_.MIPStarRE.QPBT.indicatorVec u h) +
          (fun h => s * _root_.MIPStarRE.QPBT.indicatorVec u h))) := by
      rw [_root_.MIPStarRE.QPBT.ProjectiveSetting.pointObs_mul, _root_.MIPStarRE.QPBT.tauObservable_mul]
    _ = S.expObs side W (r + s) u := by
      congr 2
      funext h
      simp only [Pi.add_apply]
      ring

/-- Idempotence of the expanded point effect, the idempotence half of projectivity
in `def:expanded-point-measurement`, paper
`references/qpbt-paper/14_analysis_of_the_pauli_basis_test.tex:384-418`. -/
private theorem expPointOp_mul_self (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)
    (a : _root_.MIPStarRE.QPBT.PauliScalar P) :
    S.expPointOp side W u a * S.expPointOp side W u a =
      S.expPointOp side W u a := by
  classical
  let D := _root_.LIDT.MIPStarRE.LDT.uniformDistribution (_root_.MIPStarRE.QPBT.PauliScalar P)
  let F : _root_.MIPStarRE.QPBT.PauliScalar P → _root_.LIDT.MIPStarRE.Quantum.Op (S.ExpandedLocalSpace side) := fun r =>
    _root_.MIPStarRE.QPBT.phaseSign (_root_.MIPStarRE.QPBT.fixedBinTrace P.model (a * r)) • S.expObs side W r u
  change _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F *
      _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F = _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F
  calc
    _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F * _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F =
        _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D
          (fun r => F r * _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F) := by
      simpa using (_root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_mul_left_right D
        1 (_root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F) F).symm
    _ = _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D
          (fun r => _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D (fun s => F r * F s)) := by
      apply _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_congr
      intro r
      simpa using
        (_root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_mul_left_right D (F r) 1 F).symm
    _ = _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D
          (fun r => _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D (fun s => F (r + s))) := by
      apply _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_congr
      intro r
      apply _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_congr
      intro s
      dsimp only [F]
      rw [Matrix.smul_mul, Matrix.mul_smul, smul_smul, expObs_mul]
      congr 1
      simpa only [mul_add] using
        phaseSign_fixedBinTrace_mul (P := P) (a * r) (a * s)
    _ = _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D
          (fun _ => _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F) := by
      apply _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_congr
      intro r
      exact (_root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_uniform_equiv
        ((Equiv.addLeft r).symm) F).symm
    _ = _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution D F := by
      exact _root_.LIDT.MIPStarRE.LDT.averageOperatorOverDistribution_const_of_isProbability D
        (_root_.LIDT.MIPStarRE.LDT.uniformDistribution_isProbability (_root_.MIPStarRE.QPBT.PauliScalar P)) _

/-- A Fourier coefficient of the expanded representation is a projection. -/
private theorem expPointOp_isProj (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)
    (a : _root_.MIPStarRE.QPBT.PauliScalar P) : _root_.LIDT.MIPStarRE.Quantum.IsProj (S.expPointOp side W u a) := by
  refine isStarProjection_iff'.2 ⟨expPointOp_mul_self S side W u a, ?_⟩
  rw [Matrix.star_eq_conjTranspose]
  exact (Matrix.nonneg_iff_posSemidef.mp (S.expPointOp_nonneg side W u a)).isHermitian.eq

/-- The expanded point measurement is projective, as asserted after the
convolution formula in `def:expanded-point-measurement`, paper
`14_analysis_of_the_pauli_basis_test.tex:395-418`. -/
theorem pointMeasExp_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.pointMeasExp side W u) := by
  intro a
  change _root_.LIDT.MIPStarRE.Quantum.IsProj (S.expPointOp side W u a)
  exact expPointOp_isProj S side W u a











end ProjectiveSetting

end

end MIPStarRE.QPBT
Source
https://github.com/Dengnifer/MIPStarRE-QPBT/blob/8f4118aeea7be16912adbaee3df6dce1741a2c26/QPBT/Observables/ExpandedDefs.lean#L34-L643

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