Definitions of TypedEstimates: Auxiliary estimates for the concrete typed introspection game The uniform ordered-edge law supplies the selection…
DefinitionMIPRE_Foundations_Introspection_TypedEstimatesThe definitions of the module MIPRE.Foundations.Introspection.TypedEstimates of the MIP* = RE formalization (commit 70cbf1c of vidick/MIPRE-formalization). Auxiliary estimates for the concrete typed introspection game. The uniform ordered-edge law supplies the selection probability. The parsed sampling predicate supplies the accepted-answer relation, including malformed constructors, so its estimate has no abstract subtest or probability premise. The Pauli predicate is passed the actual question contents; constructing that predicate, and compiling the byte parser, remain separate obligations.
Definitions (2): MIPRE.Introspection.TypedEstimates.parsedGame (The concrete typed game with the parsed introspection decision predicate.); MIPRE.Introspection.TypedEstimates.questionCheck (Lift the parsed checks to actual typed questions.).
Formalization Note The bundle is the module MIPRE.Foundations.Introspection.TypedEstimates (MIPRE/Foundations/Introspection/TypedEstimates.lean) with every declaration not listed removed, imports rewritten to the bundles of the module's import closure; the declarations keep their names, statements and bodies; the source module is split over 57 imported bundle(s).
/-
Copyright (c) 2026 MIPRE contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/
/- Generated for Prove2Me from vidick/MIPRE-formalization@70cbf1c, MIPRE/Foundations/Introspection/TypedEstimates.lean (definition bundle: declarations the uploaded statements rest on);
produced mechanically by prove2me/tools/gen.py, never edited by hand. -/
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Degrees
import Mathlib.Algebra.MvPolynomial.SchwartzZippel
import Mathlib.Algebra.Polynomial.Roots
import Mathlib.Analysis.CStarAlgebra.CStarMatrix
import Mathlib.Analysis.CStarAlgebra.Classes
import Mathlib.Analysis.CStarAlgebra.Matrix
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Analysis.Matrix.Order
import Mathlib.Analysis.Matrix.PosDef
import Mathlib.Analysis.SpecialFunctions.Complex.Circle
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Finset.Image
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Fintype.Prod
import Mathlib.Data.Fintype.Sum
import Mathlib.Data.List.Basic
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Nat.Notation
import Mathlib.Data.Nat.Size
import Mathlib.Data.Rat.Cast.Order
import Mathlib.Data.Real.Basic
import Mathlib.Data.ZMod.Basic
import Mathlib.FieldTheory.Finite.GaloisField
import Mathlib.LinearAlgebra.BilinearForm.Orthogonal
import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas
import Mathlib.LinearAlgebra.Matrix.Kronecker
import Mathlib.LinearAlgebra.Pi
import Mathlib.RingTheory.Trace.Basic
import Mathlib.Tactic.DeriveFintype
import Mathlib.Tactic.IntervalCases
import Definitions.Def_MIPRE_Foundations_Games
import Definitions.Def_MIPRE_Foundations_Distances
import Definitions.Def_MIPRE_Foundations_CL_Register
import Definitions.Def_MIPRE_Foundations_CL_Canonical
import Definitions.Def_MIPRE_Foundations_CL_Basic
import Definitions.Def_MIPRE_Foundations_Cost_Basic_B
import Definitions.Def_MIPRE_Foundations_Cost_Encoding_B
import Definitions.Def_MIPRE_Foundations_CL_Closure_B
import Definitions.Def_MIPRE_Foundations_LowDegree_Encoding
import Definitions.Def_MIPRE_Foundations_Closeness
import Definitions.Def_MIPRE_Foundations_GameTransport
import Definitions.Def_MIPRE_Foundations_OpBound
import Definitions.Def_MIPRE_Foundations_OpBound_B
import Definitions.Def_MIPRE_Foundations_StateDistance
import Definitions.Def_MIPRE_Foundations_StateDistance_B
import Definitions.Def_MIPRE_Foundations_POVMValue
import Definitions.Def_MIPRE_Foundations_Sign
import Definitions.Def_MIPRE_Foundations_CrossConsistency
import Definitions.Def_MIPRE_Foundations_CrossConsistency_B
import Definitions.Def_MIPRE_Foundations_PVM
import Definitions.Def_MIPRE_Foundations_PVM_B
import Definitions.Def_MIPRE_Foundations_Commutation
import Definitions.Def_MIPRE_Foundations_Dilation
import Definitions.Def_MIPRE_Foundations_Expanded
import Definitions.Def_MIPRE_Foundations_LowDegree_SchwartzZippel
import Definitions.Def_MIPRE_Foundations_LowDegree_Anticomm
import Definitions.Def_MIPRE_Foundations_Weyl
import Definitions.Def_MIPRE_Foundations_Parseval
import Definitions.Def_MIPRE_Foundations_Linearity
import Definitions.Def_MIPRE_Foundations_Sandwich
import Definitions.Def_MIPRE_Foundations_Pasting
import Definitions.Def_MIPRE_Foundations_GameAdapt
import Definitions.Def_MIPRE_Foundations_CL_Embedding
import Definitions.Def_MIPRE_Foundations_CL_Graph
import Definitions.Def_MIPRE_Foundations_CL_Detyping
import Definitions.Def_MIPRE_Foundations_CL_DetypingLaw
import Definitions.Def_MIPRE_Foundations_SampledGame
import Definitions.Def_MIPRE_Foundations_CL_DetypingGame
import Definitions.Def_MIPRE_Foundations_WeylEPR
import Definitions.Def_MIPRE_Foundations_Introspection_Types
import Definitions.Def_MIPRE_Foundations_Introspection_SamplingPrefix
import Definitions.Def_MIPRE_Foundations_Introspection_TwirlDistance
import Definitions.Def_MIPRE_Foundations_Introspection_LinearMeasurement
import Definitions.Def_MIPRE_Foundations_Introspection_CommutatorParseval
import Definitions.Def_MIPRE_Foundations_Introspection_BlockTwirl
import Definitions.Def_MIPRE_Foundations_Introspection_BlockPOVM
import Definitions.Def_MIPRE_Foundations_Introspection_EPR
import Definitions.Def_MIPRE_Foundations_Introspection_BlockRetention
import Definitions.Def_MIPRE_Foundations_Introspection_PauliMixing
import Definitions.Def_MIPRE_Foundations_Introspection_RegisterTransport
import Definitions.Def_MIPRE_Foundations_Introspection_RegisterEPR
import Definitions.Def_MIPRE_Foundations_Introspection_RegisterMixing
import Definitions.Def_MIPRE_Foundations_Introspection_RegisterCoordinates
import Definitions.Def_MIPRE_Foundations_Introspection_AuxiliaryChecks
import Definitions.Def_MIPRE_Foundations_Introspection_TypedPredicate
import Definitions.Def_MIPRE_Foundations_Introspection_TypeGraph
import Definitions.Def_MIPRE_Foundations_Introspection_TypedPresentation
/-! # Auxiliary estimates for the concrete typed introspection game
The uniform ordered-edge law supplies the selection probability. The parsed
sampling predicate supplies the accepted-answer relation, including malformed
constructors, so its estimate has no abstract subtest or probability premise.
The Pauli predicate is passed the actual question contents; constructing that
predicate, and compiling the byte parser, remain separate obligations.
-/
noncomputable section
namespace MIPRE.Introspection.TypedEstimates
open Finset Matrix Classical
variable {PauliType PauliAnswer F ι κ A B C H K : Type*}
[Fintype PauliType] [DecidableEq PauliType]
[Fintype κ] [DecidableEq κ] [Fintype A] [Fintype B] [Fintype C] [DecidableEq C]
[Fintype H] [DecidableEq H] [Fintype K] [DecidableEq K] {ℓ : ℕ}
section Parsed
variable [Field F] [Fintype F] [DecidableEq F] [Fintype ι] [DecidableEq ι]
[Fintype PauliAnswer]
/-- Lift the parsed checks to actual typed questions. Only the Pauli test reads
their contents; the auxiliary tests depend on the type labels and answers. -/
def questionCheck (L : Bool → CL.CLFun F ι ℓ) (X Z : PauliType)
(projectPauli : PauliAnswer → ι → F)
(D : (ι → F) → (ι → F) → A → A → Bool)
(DP : PauliType → PauliType → (κ → ZMod 2) → (κ → ZMod 2) →
PauliAnswer → PauliAnswer → Bool)
(q r : CL.Detyping.Question (QuestionType PauliType ℓ) κ) :
ParsedAnswer (ι → F) A PauliAnswer → ParsedAnswer (ι → F) A PauliAnswer → Bool :=
TypedPredicate.check L X Z projectPauli D (fun p s => DP p s q.2 r.2) q.1 r.1
/-- The concrete typed game with the parsed introspection decision predicate. -/
def parsedGame (E : PauliType → PauliType → Bool) (X Z : PauliType)
(P : PauliType → CL.CLFun (ZMod 2) κ 3) (L : Bool → CL.CLFun F ι ℓ)
(projectPauli : PauliAnswer → ι → F)
(D : (ι → F) → (ι → F) → A → A → Bool)
(DP : PauliType → PauliType → (κ → ZMod 2) → (κ → ZMod 2) →
PauliAnswer → PauliAnswer → Bool) :=
TypedPresentation.game E X Z ℓ P (questionCheck L X Z projectPauli D DP)
variable (E : PauliType → PauliType → Bool) (X Z : PauliType)
(P : PauliType → CL.CLFun (ZMod 2) κ 3) (L : Bool → CL.CLFun F ι ℓ)
(projectPauli : PauliAnswer → ι → F)
(D : (ι → F) → (ι → F) → A → A → Bool)
(DP : PauliType → PauliType → (κ → ZMod 2) → (κ → ZMod 2) →
PauliAnswer → PauliAnswer → Bool)
(ψ : H × K → ℂ) (hψ : star ψ ⬝ᵥ ψ = 1)
(MA : CL.Detyping.Question (QuestionType PauliType ℓ) κ →
POVM (ParsedAnswer (ι → F) A PauliAnswer) H)
(MB : CL.Detyping.Question (QuestionType PauliType ℓ) κ →
POVM (ParsedAnswer (ι → F) A PauliAnswer) K)
{ε : ℝ} (hfail : 1 - povmValue (parsedGame E X Z P L projectPauli D DP) ψ MA MB ≤ ε)
include hψ hfail
end Parsed
end MIPRE.Introspection.TypedEstimates
end