Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

QPBT definitions: Test / MagicSquareTheorems / Rigidity / IdealTarget

Definition
QPBT_QPBT_Test_MagicSquareTheorems_Rigidity_IdealTarget

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

qpbt

This bundle defines the ideal binary measurement obtained by marginalizing Pauli basis projectors along a binary label function. It proves positivity of the marginal effects, shows that the two effects sum to identity, and identifies the resulting measurement effects.

Principal definitions:

  • MIPStarRE.QPBT.pauliMarginalMeasurement: the binary marginal measurement of Pauli basis projectors.
  • MIPStarRE.QPBT.posSemidef_sum_ite_pauliProj: positivity of a Pauli-projector marginal.
  • MIPStarRE.QPBT.sum_ite_pauliProj_nonneg: Loewner nonnegativity of the marginal operator.
  • MIPStarRE.QPBT.sum_binary_marginal_pauliProj: completeness of the two binary marginals.
  • MIPStarRE.QPBT.pauliMarginalMeasurement_effect: the effect formula for the marginal measurement.

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/Test/MagicSquareTheorems/Rigidity/IdealTarget.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_Pauli

namespace LIDT.MIPStarRE.Quantum
end LIDT.MIPStarRE.Quantum
namespace MIPStarRE.QPBT
end MIPStarRE.QPBT

/-!
# The ideal target of the Magic Square rigidity theorem

The conclusion of `thm:ms-rigidity` compares the two players' bit measurements
with the Pauli basis projectors on a two-qubit register and their shared state
with two EPR pairs tensored with an auxiliary bipartite state.  This file
records the two elementary properties of that target which the estimates of the
rigidity assembly use: the Pauli basis projectors of one kind form a complete
projective measurement, so that any marginal of them is a positive contraction,
and the ideal state is a unit vector whenever the auxiliary state is.

The completeness of the Pauli basis follows from the Fourier expansion
`tauObservable_eq_sum_pauliProj` evaluated at the zero label, where the
generalized Pauli observable is the identity.  Positivity is the rank-one
factorization `pauliProj W e = v vᴴ` for the normalized Pauli eigenvector `v`.

## References

`def:generalized-pauli` and blueprint
`lem:pauli-observable-expansion`, paper
`references/qpbt-paper/04_preliminaries.tex:908-1161`; the target of the
rigidity theorem is blueprint
`thm:ms-rigidity`, paper
`references/qpbt-paper/08_classical_and_quantum_low_degree_tests.tex:612-652`.
-/

@[expose] public section

open scoped BigOperators Matrix MatrixOrder ComplexOrder

namespace MIPStarRE.QPBT

open LIDT.MIPStarRE.Quantum

noncomputable section

variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] [Algebra (ZMod 2) K]
/-! ## Marginals of the Pauli basis -/

/-- A marginal of the Pauli basis projectors, over any set of labels, is
positive semidefinite. -/
theorem posSemidef_sum_ite_pauliProj {ι : Type*} [Fintype ι] [DecidableEq ι]
    (W : _root_.MIPStarRE.QPBT.PauliKind) (p : (ι → K) → Prop) [DecidablePred p] :
    (∑ e : ι → K, if p e then _root_.MIPStarRE.QPBT.pauliProj W e else 0).PosSemidef := by
  classical
  refine Finset.sum_induction _ Matrix.PosSemidef (fun _ _ h₁ h₂ => h₁.add h₂)
    (Matrix.PosSemidef.zero) ?_
  intro e _
  by_cases hp : p e
  · rw [if_pos hp]
    exact _root_.MIPStarRE.QPBT.posSemidef_pauliProj W e
  · rw [if_neg hp]
    exact Matrix.PosSemidef.zero

/-- A marginal of the Pauli basis projectors is a positive operator in the
Loewner order. -/
theorem sum_ite_pauliProj_nonneg {ι : Type*} [Fintype ι] [DecidableEq ι]
    (W : _root_.MIPStarRE.QPBT.PauliKind) (p : (ι → K) → Prop) [DecidablePred p] :
    0 ≤ ∑ e : ι → K, if p e then _root_.MIPStarRE.QPBT.pauliProj W e else 0 := by
  refine Matrix.le_iff.mpr ?_
  simpa using _root_.MIPStarRE.QPBT.posSemidef_sum_ite_pauliProj W p

/-- The two marginals of the Pauli basis attached to a binary function of the
labels sum to the identity. -/
theorem sum_binary_marginal_pauliProj {ι : Type*} [Fintype ι] [DecidableEq ι]
    (W : _root_.MIPStarRE.QPBT.PauliKind) (f : (ι → K) → ZMod 2) :
    (∑ b : ZMod 2, ∑ e : ι → K, if f e = b then _root_.MIPStarRE.QPBT.pauliProj W e else 0) = 1 := by
  classical
  rw [Finset.sum_comm]
  rw [← _root_.MIPStarRE.QPBT.sum_pauliProj_eq_one (K := K) (ι := ι) W]
  refine Finset.sum_congr rfl fun e _ => ?_
  rw [Finset.sum_ite_eq (Finset.univ : Finset (ZMod 2)) (f e) (fun _ => _root_.MIPStarRE.QPBT.pauliProj W e)]
  simp

/-- The binary measurement on the Pauli basis attached to a binary function of
the labels: its effects are the two marginals of the Pauli basis projectors.
This is the ideal target family of blueprint
`thm:ms-rigidity`. -/
noncomputable def pauliMarginalMeasurement {ι : Type*} [Fintype ι] [DecidableEq ι]
    (W : _root_.MIPStarRE.QPBT.PauliKind) (f : (ι → K) → ZMod 2) :
    _root_.LIDT.MIPStarRE.Quantum.Measurement (ZMod 2) (ι → K) :=
  _root_.LIDT.MIPStarRE.Quantum.Measurement.ofSumEqOne
    (fun b => ∑ e : ι → K, if f e = b then _root_.MIPStarRE.QPBT.pauliProj W e else 0)
    (fun b => _root_.MIPStarRE.QPBT.sum_ite_pauliProj_nonneg W (fun e => f e = b))
    (_root_.MIPStarRE.QPBT.sum_binary_marginal_pauliProj W f)

/-- The effects of the Pauli marginal measurement are the marginals
themselves. -/
@[simp]
theorem pauliMarginalMeasurement_effect {ι : Type*} [Fintype ι] [DecidableEq ι]
    (W : _root_.MIPStarRE.QPBT.PauliKind) (f : (ι → K) → ZMod 2) (b : ZMod 2) :
    (_root_.MIPStarRE.QPBT.pauliMarginalMeasurement W f).effect b =
      ∑ e : ι → K, if f e = b then _root_.MIPStarRE.QPBT.pauliProj W e else 0 := rfl



/-! ## The ideal state is normalized -/



end

end MIPStarRE.QPBT
Source
https://github.com/Dengnifer/MIPStarRE-QPBT/blob/8f4118aeea7be16912adbaee3df6dce1741a2c26/QPBT/Test/MagicSquareTheorems/Rigidity/IdealTarget.lean#L45-L98

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