Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Simplified instantaneous non-local quantum computation with applications to position-based cryptography

Definition
QAlgorithms_Papers_Independent_Intake100_P57

by Gohan · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The objects the formalized statements of Simplified instantaneous non-local quantum computation with applications to position-based cryptography (arXiv:1101.1065) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • sourceChoi: PDF pp.7–8: the accepted normalized Choi state, permuted from reference,output order into the source's output,reference order.
  • bellPorts: PDF p.6: density of exactly N copies of Phi_d, in Alice-ports,Bob-ports order. The amplitudes have coefficient d^(-N/2), hence density coefficient d^(-N). Physical uses require d>0.
  • retainPort: PDF p.6, (5): retain port i, tracing out every other port, without corrections.
  • pbtInput: PDF p.6: the input tensor the fixed Bell resource, reordered as (input,Alice-ports),Bob-ports. This resource never depends on the input.
  • pbtChannel: PDF p.6, (5): Alice measures E, Bob retains the named port. Left multiplication by the effect followed by partial trace equals the corresponding measurement branch; no outcome-dependent operation on the retained port is included.
  • InstantMeasurement: Fig.1, PDF pp.1–2: simultaneous local POVMs and unrestricted finite classical outcomes, with a function evaluated in the common causal future. All data are chosen before the unknown input. The resource is supplied separately.
  • instantEffect: Fig.1 Born statistics: the induced effect after contraction with the normalized resource eta. Tensor order is input-A,input-B and resource-A,resource-B. Only classical outcomes are simulated, not conditional postmeasurement states.
  • IsMUB: Section IV, PDF p.9: the columns of distinct unitary bases have squared overlap 1/d. There are d+1 basis labels, and d columns per basis.
  • mubEffect: PDF p.11, corrected probability effects for (13): block diagonal in a, with block |e_x^a><e_x^a|. Equivalently U_AB^dagger(I tensor |x><x|)U_AB. The printed (I tensor |x><x|)U_AB is a Kraus operator, not a POVM effect. The construction requires Alice dimension d+1, correcting the p.12 dimension typo.
  • mubState: The normalized ensemble rho_x in Theorem IV.1, PDF p.10. The basis label a is uniform and independent of the uniformly sampled x.
  • mubSuccess: PDF p.10: average success, with x uniform and all physical measurement data fixed independently of x.
  • ensembleMeanRank: PDF p.16: arithmetic mean of the ranks of the individual states.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_MatrixDistances
import Definitions.Def_QAlgorithms_Defs_QuantumInformation
import Definitions.Def_QAlgorithms_Papers_Independent_Support50_P11
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P34
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P07

/-!
Beigi–Koenig, arXiv:1101.1065v3. Citations use PDF page numbers.
Local definitions specify the source's tensor coordinates and protocols explicitly.
The accepted normalized Choi state is reused with an explicit swap.
Compilation is pending the separate mechanical handoff.
-/

noncomputable section

open scoped Matrix ComplexConjugate ComplexOrder

namespace QAlgorithms.Papers.Independent.Intake100.P57

attribute [local instance] Classical.propDecidable
attribute [local instance] Classical.decEq

-- P34 uses half the channel distance. Every occurrence below is multiplied by two.
open QAlgorithms.Papers.Independent.Information100.P34 (diamondDistance)
open QAlgorithms.Papers.Independent.Dependency50.P07 (ensembleMean)

/- PDF p.7, (7): on differences of CPTP maps the full stabilized induced
trace norm equals twice the accepted P34.diamondDistance, whose optimization
uses normalized density matrices and an input-sized reference. PDF p.8 states
this equivalence explicitly. No new diamond-distance definition is introduced. -/

/-- Sanity: identical maps have zero distance whenever a normalized input exists. -/
example {I O : Type*} [Fintype I] [Fintype O] [DecidableEq I] [DecidableEq O]
    (F : Superop I O) (rho : Matrix (I × I) (I × I) ℂ)
    (hrho : IsDensityMatrix rho) : 2 * diamondDistance F F = 0 := by
  have hs : {v : ℝ | ∃ tau : Matrix (I × I) (I × I) ℂ,
      IsDensityMatrix tau ∧ v = traceNorm
        (idTensorSuperop (R := I) F tau - idTensorSuperop (R := I) F tau) / 2} = {0} := by
    ext v
    constructor
    · rintro ⟨tau, _, hv⟩
      simpa [traceNorm, cfc_zero] using hv
    · intro hv
      have hv0 : v = 0 := Set.mem_singleton_iff.mp hv
      subst v
      exact ⟨rho, hrho, by simp [traceNorm, cfc_zero]⟩
  unfold diamondDistance
  rw [hs, csSup_singleton]
  norm_num

/-- PDF pp.7–8: the accepted normalized Choi state, permuted from
reference,output order into the source's output,reference order. -/
def sourceChoi {I O : Type*} [Fintype I] [DecidableEq I] (F : Superop I O) :
    Matrix (O × I) (O × I) ℂ :=
  fun p q => QAlgorithms.Papers.Independent.Support50.P11.choiState F
    (p.2, p.1) (q.2, q.1)

/-- Sanity: the swap preserves every diagonal entry under its coordinate bijection. -/
example {I O : Type*} [Fintype I] [DecidableEq I] (F : Superop I O)
    (o : O) (i : I) : sourceChoi F (o,i) (o,i) =
      QAlgorithms.Papers.Independent.Support50.P11.choiState F (i,o) (i,o) := by
  rfl

/-- PDF p.6: density of exactly N copies of Phi_d, in Alice-ports,Bob-ports
order. The amplitudes have coefficient d^(-N/2), hence density coefficient d^(-N).
Physical uses require d>0. -/
def bellPorts (d N : ℕ) :
    Matrix ((Fin N → Fin d) × (Fin N → Fin d))
      ((Fin N → Fin d) × (Fin N → Fin d)) ℂ :=
  fun p q => if p.1 = p.2 ∧ q.1 = q.2 then ((d : ℂ) ^ N)⁻¹ else 0

/-- Sanity: the unique entry of one dimension-one Bell pair is one. -/
example : bellPorts 1 1 ((fun _ => 0), (fun _ => 0))
    ((fun _ => 0), (fun _ => 0)) = 1 := by
  norm_num [bellPorts]

/-- PDF p.6, (5): retain port i, tracing out every other port, without corrections. -/
def retainPort {d N : ℕ} (i : Fin N)
    (R : Matrix (Fin N → Fin d) (Fin N → Fin d) ℂ) : Matrix (Fin d) (Fin d) ℂ :=
  fun b c => ∑ p : Fin N → Fin d, ∑ q : Fin N → Fin d,
    if p i = b ∧ q i = c ∧ (∀ j, j ≠ i → p j = q j) then R p q else 0

/-- PDF p.6: the input tensor the fixed Bell resource, reordered as
(input,Alice-ports),Bob-ports. This resource never depends on the input. -/
def pbtInput {d N : ℕ} (X : Matrix (Fin d) (Fin d) ℂ) :
    Matrix ((Fin d × (Fin N → Fin d)) × (Fin N → Fin d))
      ((Fin d × (Fin N → Fin d)) × (Fin N → Fin d)) ℂ :=
  fun p q => X p.1.1 q.1.1 * bellPorts d N (p.1.2,p.2) (q.1.2,q.2)

/-- PDF p.6, (5): Alice measures E, Bob retains the named port. Left multiplication
by the effect followed by partial trace equals the corresponding measurement branch;
no outcome-dependent operation on the retained port is included. -/
def pbtChannel {d N : ℕ}
    (E : Fin N → Matrix (Fin d × (Fin N → Fin d))
      (Fin d × (Fin N → Fin d)) ℂ) : Superop (Fin d) (Fin d) :=
  fun X => ∑ i, retainPort i
    (traceLeft (Matrix.kronecker (E i)
      (1 : Matrix (Fin N → Fin d) (Fin N → Fin d) ℂ) * pbtInput X))

/-- Sanity: zero input gives zero output, rather than a prepared fixed state. -/
example {d N : ℕ}
    (E : Fin N → Matrix (Fin d × (Fin N → Fin d))
      (Fin d × (Fin N → Fin d)) ℂ) : pbtChannel E 0 = 0 := by
  classical
  have input_zero : pbtInput (d := d) (N := N) (0 : Matrix (Fin d) (Fin d) ℂ) = 0 := by
    ext p q
    simp [pbtInput]
  unfold pbtChannel
  rw [input_zero]
  simp only [Matrix.mul_zero]
  ext b c
  simp [traceLeft, retainPort, Matrix.sum_apply]

/-- PDF p.9: the classical-output channels are written directly with the
imported Matrix.diagonal and complex trace below. The frozen namesake
ClassicalShadows.measurementChannel is an averaged measurement-and-repreparation
channel with a different input and output model, so it cannot be substituted.

Sanity: the singleton identity measurement keeps the trace as its sole output. -/
example {I : Type*} [Fintype I] [DecidableEq I] (X : Matrix I I ℂ) :
    (Matrix.diagonal (fun _ : Fin 1 => ((1 : Matrix I I ℂ) * X).trace)) 0 0 = X.trace := by
  simp

/-- Fig.1, PDF pp.1–2: simultaneous local POVMs and unrestricted finite
classical outcomes, with a function evaluated in the common causal future.
All data are chosen before the unknown input. The resource is supplied separately. -/
structure InstantMeasurement (a b l r o : ℕ) where
  alpha : ℕ
  beta : ℕ
  alice : Fin alpha → Matrix (Fin a × Fin l) (Fin a × Fin l) ℂ
  bob : Fin beta → Matrix (Fin b × Fin r) (Fin b × Fin r) ℂ
  alice_povm : IsPOVM alice
  bob_povm : IsPOVM bob
  output : Fin alpha → Fin beta → Fin o

/-- Fig.1 Born statistics: the induced effect after contraction with the
normalized resource eta. Tensor order is input-A,input-B and resource-A,resource-B.
Only classical outcomes are simulated, not conditional postmeasurement states. -/
def instantEffect {a b l r o : ℕ} (s : InstantMeasurement a b l r o)
    (eta : Matrix (Fin l × Fin r) (Fin l × Fin r) ℂ) :
    Fin o → Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ :=
  fun x p q => ∑ alpha, ∑ beta,
    if s.output alpha beta = x then
      ∑ u : Fin l × Fin r, ∑ v : Fin l × Fin r,
        eta v u * s.alice alpha (p.1,u.1) (q.1,v.1) *
          s.bob beta (p.2,u.2) (q.2,v.2)
    else 0

/-- Sanity: an absent (zero) resource has zero Born weight. Physical uses below
require trace one, so this cannot produce a spurious successful protocol. -/
example {a b l r o : ℕ} (s : InstantMeasurement a b l r o) :
    instantEffect s 0 = 0 := by
  classical
  funext x p q
  simp [instantEffect]

/-- Section IV, PDF p.9: the columns of distinct unitary bases have squared
overlap 1/d. There are d+1 basis labels, and d columns per basis. -/
def IsMUB (d : ℕ) (U : Fin (d+1) → Matrix.unitaryGroup (Fin d) ℂ) : Prop :=
  ∀ a b, a ≠ b → ∀ x y : Fin d,
    Complex.normSq (((U a : Matrix (Fin d) (Fin d) ℂ)ᴴ *
      (U b : Matrix (Fin d) (Fin d) ℂ)) x y) = 1 / (d : ℝ)

/-- PDF p.11, corrected probability effects for (13): block diagonal in a,
with block |e_x^a><e_x^a|. Equivalently U_AB^dagger(I tensor |x><x|)U_AB.
The printed (I tensor |x><x|)U_AB is a Kraus operator, not a POVM effect.
The construction requires Alice dimension d+1, correcting the p.12 dimension typo. -/
def mubEffect {d : ℕ} (U : Fin (d+1) → Matrix.unitaryGroup (Fin d) ℂ) :
    Fin d → Matrix (Fin (d+1) × Fin d) (Fin (d+1) × Fin d) ℂ :=
  fun x p q => if p.1 = q.1 then
    (U p.1 : Matrix (Fin d) (Fin d) ℂ) p.2 x *
      conj ((U p.1 : Matrix (Fin d) (Fin d) ℂ) q.2 x) else 0

/-- Sanity: off-diagonal basis-label blocks vanish in the corrected effects. -/
example {d : ℕ} (U : Fin (d+1) → Matrix.unitaryGroup (Fin d) ℂ)
    (x : Fin d) (p q : Fin (d+1) × Fin d) (h : p.1 ≠ q.1) :
    mubEffect U x p q = 0 := by
  simp [mubEffect, h]

/-- The normalized ensemble rho_x in Theorem IV.1, PDF p.10.
The basis label a is uniform and independent of the uniformly sampled x. -/
def mubState {d : ℕ} (U : Fin (d+1) → Matrix.unitaryGroup (Fin d) ℂ)
    (x : Fin d) : Matrix (Fin (d+1) × Fin d) (Fin (d+1) × Fin d) ℂ :=
  ((d+1 : ℂ)⁻¹) • mubEffect U x

/-- PDF p.10: average success, with x uniform and all physical measurement
data fixed independently of x. -/
def mubSuccess {d l r : ℕ} (U : Fin (d+1) → Matrix.unitaryGroup (Fin d) ℂ)
    (s : InstantMeasurement (d+1) d l r d)
    (eta : Matrix (Fin l × Fin r) (Fin l × Fin r) ℂ) : ℝ :=
  (d : ℝ)⁻¹ * ∑ x, effectProb (instantEffect s eta x) (mubState U x)

/-- Sanity: the ensemble definition averages all d+1 basis-label blocks. -/
example {d : ℕ} (U : Fin (d+1) → Matrix.unitaryGroup (Fin d) ℂ) (x : Fin d) :
    mubState U x = ((d+1 : ℂ)⁻¹) • mubEffect U x := by rfl

/-- PDF p.16: arithmetic mean of the ranks of the individual states. -/
def ensembleMeanRank {I : Type*} [Fintype I] [DecidableEq I] {N : ℕ}
    (eta : Fin N → Matrix I I ℂ) : ℝ :=
  (N : ℝ)⁻¹ * ∑ i, (Matrix.rank (eta i) : ℝ)

/-- Sanity: a singleton ensemble has its original density and rank. -/
example {I : Type} [Fintype I] [DecidableEq I] (eta : Fin 1 → Matrix I I ℂ) :
    ensembleMean ⟨(fun _ : Fin 1 => 1), eta⟩ = eta 0 ∧
      ensembleMeanRank eta = Matrix.rank (eta 0) := by
  simp [ensembleMean, QAlgorithms.Papers.Independent.Information100.P27.average,
    ensembleMeanRank]

end QAlgorithms.Papers.Independent.Intake100.P57
Source
Simplified instantaneous non-local quantum computation with applications to position-based cryptography, arXiv:1101.1065v3, https://arxiv.org/abs/1101.1065v3
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

QAlgorithms.Papers.Independent.Intake100.P57.InstantMeasurement

For arbitrary natural numbers a,b,l,r,oa,b,l,r,oa,b,l,r,o, this structure consists of natural numbers α,β\alpha,\betaα,β, families of complex matrices AsA_sAs​ on {0,…,a−1}×{0,…,l−1}\{0,\ldots,a-1\}\times\{0,\ldots,l-1\}{0,…,a−1}×{0,…,l−1} for 0≤s<α0\le s<\alpha0≤s<α and BtB_tBt​ on {0,…,b−1}×{0,…,r−1}\{0,\ldots,b-1\}\times\{0,\ldots,r-1\}{0,…,b−1}×{0,…,r−1} for 0≤t<β0\le t<\beta0≤t<β, proofs that every As,BtA_s,B_tAs​,Bt​ is positive semidefinite and that ∑sAs=I\sum_sA_s=I∑s​As​=I, ∑tBt=I\sum_tB_t=I∑t​Bt​=I on their respective spaces, and a function f:{0,…,α−1}×{0,…,β−1}→{0,…,o−1}f:\{0,\ldots,\alpha-1\}\times\{0,\ldots,\beta-1\}\to\{0,\ldots,o-1\}f:{0,…,α−1}×{0,…,β−1}→{0,…,o−1}. None of the seven natural numbers is explicitly required to be positive; an empty outcome family can satisfy completeness only when its matrix space has zero identity, and if o=0o=0o=0, the function fff requires its domain to be empty.

QAlgorithms.Papers.Independent.Intake100.P57.IsMUB

For any natural number ddd and any family of unitary complex d×dd\times dd×d matrices U0,…,UdU_0,\ldots,U_dU0​,…,Ud​, this predicate means that, for every pair of distinct labels a,b∈{0,…,d}a,b\in\{0,\ldots,d\}a,b∈{0,…,d} and every x,y∈{0,…,d−1}x,y\in\{0,\ldots,d-1\}x,y∈{0,…,d−1},

∣(Ua†Ub)x,y∣2=1d.\left|(U_a^\dagger U_b)_{x,y}\right|^2=\frac1d.​(Ua†​Ub​)x,y​​2=d1​.

The squared modulus is the complex norm squared. The definition includes d=0d=0d=0, where the condition is vacuous because there are no entry indices x,yx,yx,y; real division uses 1/0=01/0=01/0=0.

QAlgorithms.Papers.Independent.Intake100.P57.bellPorts

For arbitrary natural numbers d,Nd,Nd,N, let W={0,…,d−1}{0,…,N−1}W=\{0,\ldots,d-1\}^{\{0,\ldots,N-1\}}W={0,…,d−1}{0,…,N−1}. This defines a complex matrix Bd,NB_{d,N}Bd,N​ indexed by W×WW\times WW×W whose entries are

Bd,N((u,v),(u′,v′))={(dN)−1,u=v and u′=v′,0,otherwise.B_{d,N}((u,v),(u',v'))= \begin{cases} (d^N)^{-1},&u=v\ \text{and}\ u'=v',\\ 0,&\text{otherwise}. \end{cases}Bd,N​((u,v),(u′,v′))={(dN)−1,0,​u=v and u′=v′,otherwise.​

No positivity assumption on ddd or NNN is required. If N=0N=0N=0, WWW consists of the unique empty word and this is the one-entry matrix [1][1][1], including when d=0d=0d=0. If d=0<Nd=0<Nd=0<N, WWW is empty and the matrix has no entries; inversion is total, with 0−1=00^{-1}=00−1=0.

QAlgorithms.Papers.Independent.Intake100.P57.ensembleMeanRank

For any finite type III equipped with decidable equality, any natural number NNN, and any family of complex matrices ηi\eta_iηi​ indexed by III, for i<Ni<Ni<N, the defined real number is

1N∑i<Nrank⁡(ηi).\frac1N\sum_{i<N}\operatorname{rank}(\eta_i).N1​i<N∑​rank(ηi​).

No positivity or trace condition is imposed on the matrices, and III may be empty. When N=0N=0N=0, the empty sum and the convention 0−1=00^{-1}=00−1=0 give value 000.

QAlgorithms.Papers.Independent.Intake100.P57.instantEffect

For arbitrary natural numbers a,b,l,r,oa,b,l,r,oa,b,l,r,o, take a structure consisting of local positive semidefinite matrix families AsA_sAs​, 0≤s<α0\le s<\alpha0≤s<α, on Ca⊗Cl\mathbb C^a\otimes\mathbb C^lCa⊗Cl and BtB_tBt​, 0≤t<β0\le t<\beta0≤t<β, on Cb⊗Cr\mathbb C^b\otimes\mathbb C^rCb⊗Cr, each summing to the identity, together with a function f(s,t)∈{0,…,o−1}f(s,t)\in\{0,\ldots,o-1\}f(s,t)∈{0,…,o−1}. For any complex matrix η\etaη indexed by {0,…,l−1}×{0,…,r−1}\{0,\ldots,l-1\}\times\{0,\ldots,r-1\}{0,…,l−1}×{0,…,r−1}, this defines a family HxH_xHx​, 0≤x<o0\le x<o0≤x<o, of matrices on Ca⊗Cb\mathbb C^a\otimes\mathbb C^bCa⊗Cb by

Hx((a0,b0),(a1,b1))=∑0≤s<α, 0≤t<βf(s,t)=x∑u,v∈{0,…,l−1}×{0,…,r−1}ηv,u (As)(a0,u1),(a1,v1)(Bt)(b0,u2),(b1,v2).H_x((a_0,b_0),(a_1,b_1)) = \sum_{\substack{0\le s<\alpha,\ 0\le t<\beta\\f(s,t)=x}} \sum_{u,v\in\{0,\ldots,l-1\}\times\{0,\ldots,r-1\}} \eta_{v,u}\, (A_s)_{(a_0,u_1),(a_1,v_1)} (B_t)_{(b_0,u_2),(b_1,v_2)}.Hx​((a0​,b0​),(a1​,b1​))=0≤s<α, 0≤t<βf(s,t)=x​∑​u,v∈{0,…,l−1}×{0,…,r−1}∑​ηv,u​(As​)(a0​,u1​),(a1​,v1​)​(Bt​)(b0​,u2​),(b1​,v2​)​.

No positivity or normalization assumption is imposed on η\etaη; zero dimensions and empty sums are included.

QAlgorithms.Papers.Independent.Intake100.P57.mubEffect

For any natural number ddd and any family of unitary complex d×dd\times dd×d matrices U0,…,UdU_0,\ldots,U_dU0​,…,Ud​, this defines a matrix MxM_xMx​ on {0,…,d}×{0,…,d−1}\{0,\ldots,d\}\times\{0,\ldots,d-1\}{0,…,d}×{0,…,d−1} for each x∈{0,…,d−1}x\in\{0,\ldots,d-1\}x∈{0,…,d−1}, by

Mx((a,i),(b,j))={(Ua)i,x (Ua)j,x‾,a=b,0,a≠b.M_x((a,i),(b,j))= \begin{cases} (U_a)_{i,x}\,\overline{(U_a)_{j,x}},&a=b,\\ 0,&a\ne b. \end{cases}Mx​((a,i),(b,j))={(Ua​)i,x​(Ua​)j,x​​,0,​a=b,a=b.​

No mutual-unbiasedness condition is assumed. The definition allows d=0d=0d=0, in which case the family has no members.

QAlgorithms.Papers.Independent.Intake100.P57.mubState

For any natural number ddd, any family of unitary complex d×dd\times dd×d matrices U0,…,UdU_0,\ldots,U_dU0​,…,Ud​, and any x∈{0,…,d−1}x\in\{0,\ldots,d-1\}x∈{0,…,d−1}, this defines a matrix ρx\rho_xρx​ on {0,…,d}×{0,…,d−1}\{0,\ldots,d\}\times\{0,\ldots,d-1\}{0,…,d}×{0,…,d−1} by

ρx((a,i),(b,j))={(Ua)i,x (Ua)j,x‾d+1,a=b,0,a≠b.\rho_x((a,i),(b,j))= \begin{cases} \dfrac{(U_a)_{i,x}\,\overline{(U_a)_{j,x}}}{d+1},&a=b,\\ 0,&a\ne b. \end{cases}ρx​((a,i),(b,j))=⎩⎨⎧​d+1(Ua​)i,x​(Ua​)j,x​​​,0,​a=b,a=b.​

No mutual-unbiasedness condition is assumed. Although ddd is quantified over all natural numbers, supplying the index xxx requires d>0d>0d>0.

QAlgorithms.Papers.Independent.Intake100.P57.mubSuccess

For arbitrary natural numbers d,l,rd,l,rd,l,r, let U0,…,UdU_0,\ldots,U_dU0​,…,Ud​ be unitary d×dd\times dd×d complex matrices. Let sss consist of natural numbers α,β\alpha,\betaα,β, positive semidefinite matrices AaA_aAa​ on Cd+1⊗Cl\mathbb C^{d+1}\otimes\mathbb C^lCd+1⊗Cl and BbB_bBb​ on Cd⊗Cr\mathbb C^d\otimes\mathbb C^rCd⊗Cr, satisfying ∑aAa=1\sum_a A_a=1∑a​Aa​=1 and ∑bBb=1\sum_b B_b=1∑b​Bb​=1, and a function f:Fin⁡α×Fin⁡β→Fin⁡df:\operatorname{Fin}\alpha\times\operatorname{Fin}\beta\to\operatorname{Fin}df:Finα×Finβ→Find. For any complex matrix η\etaη indexed by Fin⁡l×Fin⁡r\operatorname{Fin}l\times\operatorname{Fin}rFinl×Finr, define matrices Fx,GxF_x,G_xFx​,Gx​ on H=Cd+1⊗CdH=\mathbb C^{d+1}\otimes\mathbb C^dH=Cd+1⊗Cd by

(Fx)(a,b),(a′,b′)=∑u<α, v<βf(u,v)=x ∑ξ,ζ∈Fin⁡l×Fin⁡rηζ,ξ(Au)(a,ξ1),(a′,ζ1)(Bv)(b,ξ2),(b′,ζ2),(Gx)(a,b),(a′,b′)={(Ua)b,x(Ua)b′,x‾,a=a′,0,a≠a′.(F_x)_{(a,b),(a',b')}= \sum_{\substack{u<\alpha,\ v<\beta\\f(u,v)=x}} \ \sum_{\xi,\zeta\in\operatorname{Fin}l\times\operatorname{Fin}r} \eta_{\zeta,\xi}(A_u)_{(a,\xi_1),(a',\zeta_1)} (B_v)_{(b,\xi_2),(b',\zeta_2)},\qquad (G_x)_{(a,b),(a',b')}= \begin{cases} (U_a)_{b,x}\overline{(U_a)_{b',x}},&a=a',\\ 0,&a\ne a'. \end{cases}(Fx​)(a,b),(a′,b′)​=u<α, v<βf(u,v)=x​∑​ ξ,ζ∈Finl×Finr∑​ηζ,ξ​(Au​)(a,ξ1​),(a′,ζ1​)​(Bv​)(b,ξ2​),(b′,ζ2​)​,(Gx​)(a,b),(a′,b′)​={(Ua​)b,x​(Ua​)b′,x​​,0,​a=a′,a=a′.​

The defined real number is

1d∑x<dRe⁡tr⁡ ⁣(Fx Gxd+1).\frac1d\sum_{x<d}\operatorname{Re}\operatorname{tr}\!\left(F_x\,\frac{G_x}{d+1}\right).d1​x<d∑​Retr(Fx​d+1Gx​​).

There is no assumption that η\etaη is a density matrix or that the UaU_aUa​ satisfy a mutual unbiasedness condition. Zero dimensions are included; when d=0d=0d=0, the sum is empty and the value is 000, with division by zero interpreted as zero.

QAlgorithms.Papers.Independent.Intake100.P57.pbtChannel

For arbitrary natural numbers d,Nd,Nd,N, let WWW be the set of length-NNN words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, and let EiE_iEi​, for 0≤i<N0\le i<N0≤i<N, be arbitrary complex matrices indexed by {0,…,d−1}×W\{0,\ldots,d-1\}\times W{0,…,d−1}×W. This defines a function PE\mathcal P_EPE​ on complex d×dd\times dd×d matrices as follows: set

PX(((a,u),v),((a′,u′),v′))=Xa,a′(dN)−11u=v1u′=v′,Ri(v,w)=∑a,u[(Ei⊗IW)PX]((a,u),v),((a,u),w);P_X(((a,u),v),((a',u'),v')) =X_{a,a'}(d^N)^{-1}\mathbf1_{u=v}\mathbf1_{u'=v'}, \qquad R_i(v,w)=\sum_{a,u}[(E_i\otimes I_W)P_X]_{((a,u),v),((a,u),w)};PX​(((a,u),v),((a′,u′),v′))=Xa,a′​(dN)−11u=v​1u′=v′​,Ri​(v,w)=a,u∑​[(Ei​⊗IW​)PX​]((a,u),v),((a,u),w)​;

then

PE(X)b,c=∑i=0N−1∑v,w∈Wvi=b, wi=cvj=wj for every j≠iRi(v,w).\mathcal P_E(X)_{b,c} =\sum_{i=0}^{N-1} \sum_{\substack{v,w\in W\\v_i=b,\ w_i=c\\v_j=w_j\ \text{for every }j\ne i}} R_i(v,w).PE​(X)b,c​=i=0∑N−1​v,w∈Wvi​=b, wi​=cvj​=wj​ for every j=i​∑​Ri​(v,w).

No positivity, completeness, or channel assumption is imposed on the family EEE. In particular, N=0N=0N=0 gives the zero function, and d=0d=0d=0 is allowed.

QAlgorithms.Papers.Independent.Intake100.P57.pbtInput

For arbitrary natural numbers d,Nd,Nd,N and any complex d×dd\times dd×d matrix XXX, let WWW be the set of length-NNN words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}. This defines a complex matrix PXP_XPX​ indexed by ({0,…,d−1}×W)×W(\{0,\ldots,d-1\}\times W)\times W({0,…,d−1}×W)×W, with

PX(((a,u),v),((a′,u′),v′))={Xa,a′(dN)−1,u=v and u′=v′,0,otherwise.P_X(((a,u),v),((a',u'),v'))= \begin{cases} X_{a,a'}(d^N)^{-1},&u=v\ \text{and}\ u'=v',\\ 0,&\text{otherwise}. \end{cases}PX​(((a,u),v),((a′,u′),v′))={Xa,a′​(dN)−1,0,​u=v and u′=v′,otherwise.​

No positivity or normalization assumption is imposed on XXX. For N=0N=0N=0, the word registers are singletons and the formula reproduces XXX; if d=0d=0d=0, the full index set is empty. The scalar inverse uses 0−1=00^{-1}=00−1=0.

QAlgorithms.Papers.Independent.Intake100.P57.retainPort

For arbitrary natural numbers d,Nd,Nd,N, an index i∈{0,…,N−1}i\in\{0,\ldots,N-1\}i∈{0,…,N−1}, and an arbitrary complex matrix RRR indexed by length-NNN words over {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1}, this defines a d×dd\times dd×d matrix by

(Ret⁡iR)b,c=∑p,q:{0,…,N−1}→{0,…,d−1}pi=b, qi=cpj=qj for every j≠iRp,q.(\operatorname{Ret}_iR)_{b,c} = \sum_{\substack{p,q:\{0,\ldots,N-1\}\to\{0,\ldots,d-1\}\\ p_i=b,\ q_i=c\\ p_j=q_j\ \text{for every }j\ne i}} R_{p,q}.(Reti​R)b,c​=p,q:{0,…,N−1}→{0,…,d−1}pi​=b, qi​=cpj​=qj​ for every j=i​∑​Rp,q​.

There is no positivity or normalization assumption on RRR. The supplied index iii requires N>0N>0N>0; d=0d=0d=0 is allowed and gives a matrix with no entries.

QAlgorithms.Papers.Independent.Intake100.P57.sourceChoi

For any finite type III equipped with decidable equality, any type OOO, and any function FFF from complex I×II\times II×I matrices to complex O×OO\times OO×O matrices, this defines a matrix SFS_FSF​ indexed by O×IO\times IO×I by

SF((o,i),(o′,j))=1∣I∣(F(Eij))o,o′,S_F((o,i),(o',j))=\frac{1}{|I|}\bigl(F(E_{ij})\bigr)_{o,o'},SF​((o,i),(o′,j))=∣I∣1​(F(Eij​))o,o′​,

where EijE_{ij}Eij​ has entry 111 at (i,j)(i,j)(i,j) and 000 elsewhere. No linearity, positivity, or channel assumption is imposed on FFF, and OOO need not be finite. The definition also includes empty III, in which case the resulting matrix has an empty index set; scalar inversion uses 0−1=00^{-1}=00−1=0.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

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