Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Private Quantum Channels and the Cost of Randomizing Quantum Information

Definition
QAlgorithms_Papers_Independent_Advance50_P18

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

prove2quantum

The objects the formalized statements of Private Quantum Channels and the Cost of Randomizing Quantum Information (arXiv:quant-ph/0003101) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • KeyedUnitaryEnsemble: PDF pp.3–4: finite classical law and keyed full-space matrices, fixed before the input. Validity is separate so that explicit constructed ensembles carry no unproved proof fields.
  • KeyedUnitaryEnsemble.Valid: PDF p.3: nonnegative probabilities of total mass one; each keyed operator is unitary. Zero-probability key labels are allowed, and still have unitary operators.
  • keyEntropy: PDF p.3, §2.2: Shannon entropy in bits, including the convention 0 log 0 = 0.
  • encrypt: PDF p.3: the average conjugation map, with probability p (not its square root). The source's Kraus operator for key k is sqrt(p k) times U k.
  • sourceMixedIdentity: PDF p.3: normalized identity; all uses below have a nonempty qubit basis.
  • allPure: PDF p.3: the set of all normalized pure states.
  • classicalSource: PDF p.6: classical messages are precisely computational-basis vectors.
  • BarePQC: PDF p.4, Definition 3.1, with no ancilla. The key is independent of the input; unitarity gives exact inverse decoding for each key, without an extra recovery assumption.
  • PQC: PDF p.4, Definition 3.1: an exact private quantum channel with a fixed mixed ancilla. All of I × A is transmitted. The same ancilla, law and unitaries serve every source state.
  • IsSourceMixture: PDF p.4: a density is a finite probability mixture of normalized source-state projectors. The empty mixture is excluded by the sum-one condition, even when S is empty.
  • ExactSourceRandomization: PDF p.8, §6: forgetting only the classical key in the same full-output model.
  • BareRandomizes: PDF pp.8–9: the same randomization model with no ancillary environment.
  • sourcePauli: PDF p.3: sigma_0, sigma_1, sigma_2, sigma_3 are I, X, Y, Z in this order.
  • fullPauli: PDF p.5, Theorem 4.1: uniform, phase-zero tensor Paulis, each of probability 2^(-2n).
  • realPauli: PDF p.5, Theorem 4.2: independent uniform choices of I and Y, each string of probability 2^(-n). A true bit selects sigma_2 = Y.
  • realProductVector: PDF p.5: tensor product of the real qubits cos(theta_j)|0> + sin(theta_j)|1>. For n = 0 the amplitude of the empty bit string is the empty product, namely 1.
  • realProductSource: PDF p.5: exactly B tensor n, not its linear span or all real entangled vectors.
  • exampleSource: PDF p.5: the particular source {|0>, |+>} in the nonmaximal-output example.
  • exampleEnsemble: PDF p.5: the example's two equally likely unitaries I and H.
  • hadamardExampleDensity: PDF p.5: the example's fixed output [[3/4,1/4],[1/4,1/4]], in basis order 0,1.
  • reductionOutput: PDF pp.6–7, Theorem 5.2: (I/2^n) tensor rho0, reassociated from I × (I × A) to (I × I) × A. No register is discarded.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Defs_Stabilizer
import Definitions.Def_QAlgorithms_Defs_LocalHamiltonian

/-!
Private Quantum Channels and the Cost of Randomizing Quantum Information,
arXiv:quant-ph/0003101v2. All new interfaces are local to this paper.
Matrix and EuclideanSpace are used directly from Mathlib; no local type aliases
duplicate accepted-library declarations. Same-named definitions in other accepted
papers were checked for equivalence; incompatible source models are not imported.
Product basis indices keep the entire ancillary output visible. No partial trace
occurs in the security condition. A bare channel is the canonical ancilla-free
version, so there is no artificial zero-qubit tensor factor in its statements.
-/

namespace QAlgorithms.Papers.Independent.Advance50.P18

open scoped ComplexConjugate

noncomputable section

/-- PDF pp.3–4: finite classical law and keyed full-space matrices, fixed before the input.
Validity is separate so that explicit constructed ensembles carry no unproved proof fields. -/
structure KeyedUnitaryEnsemble (K I : Type*) where
  p : K → ℝ
  U : K → (Matrix I I ℂ)

variable {K I A : Type*} [Fintype K] [DecidableEq K]
  [Fintype I] [DecidableEq I] [Fintype A] [DecidableEq A]

/-- PDF p.3: nonnegative probabilities of total mass one; each keyed operator is unitary.
Zero-probability key labels are allowed, and still have unitary operators. -/
def KeyedUnitaryEnsemble.Valid (E : KeyedUnitaryEnsemble K I) : Prop :=
  (∀ k, 0 ≤ E.p k) ∧ (∑ k, E.p k) = 1 ∧
    ∀ k, E.U k ∈ Matrix.unitaryGroup I ℂ

/-- PDF p.3, §2.2: Shannon entropy in bits, including the convention 0 log 0 = 0. -/
def keyEntropy (p : K → ℝ) : ℝ :=
  -∑ k, if p k = 0 then 0 else p k * (Real.log (p k) / Real.log 2)

/-- PDF p.3: the average conjugation map, with probability p (not its square root).
The source's Kraus operator for key k is sqrt(p k) times U k. -/
def encrypt (E : KeyedUnitaryEnsemble K I) (rho : (Matrix I I ℂ)) : (Matrix I I ℂ) :=
  ∑ k, (E.p k : ℂ) • (E.U k * rho * (E.U k).conjTranspose)

/-- PDF p.3: normalized identity; all uses below have a nonempty qubit basis. -/
def sourceMixedIdentity (I : Type*) [Fintype I] [DecidableEq I] : (Matrix I I ℂ) :=
  ((Fintype.card I : ℂ)⁻¹) • 1

/-- PDF p.3: the set of all normalized pure states. -/
def allPure (I : Type*) [Fintype I] : Set ((EuclideanSpace ℂ I)) :=
  {psi | IsState psi}

/-- PDF p.6: classical messages are precisely computational-basis vectors. -/
def classicalSource (I : Type*) [DecidableEq I] : Set ((EuclideanSpace ℂ I)) :=
  Set.range (fun x : I => ket x)

/-- PDF p.4, Definition 3.1, with no ancilla. The key is independent of the input;
unitarity gives exact inverse decoding for each key, without an extra recovery assumption. -/
def BarePQC (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K I) (rho0 : (Matrix I I ℂ)) : Prop :=
  E.Valid ∧ IsDensityMatrix rho0 ∧
    ∀ psi ∈ S, IsState psi ∧ encrypt E (pureDensity psi) = rho0

/-- PDF p.4, Definition 3.1: an exact private quantum channel with a fixed mixed ancilla.
All of I × A is transmitted. The same ancilla, law and unitaries serve every source state. -/
def PQC (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K (I × A))
    (anc : (Matrix A A ℂ)) (rho0 : (Matrix (I × A) (I × A) ℂ)) : Prop :=
  E.Valid ∧ IsDensityMatrix anc ∧ IsDensityMatrix rho0 ∧
    ∀ psi ∈ S, IsState psi ∧
      encrypt E (Matrix.kronecker (pureDensity psi) anc) = rho0

/-- PDF p.4: a density is a finite probability mixture of normalized source-state projectors.
The empty mixture is excluded by the sum-one condition, even when S is empty. -/
def IsSourceMixture (S : Set ((EuclideanSpace ℂ I))) (rho : (Matrix I I ℂ)) : Prop :=
  ∃ (r : ℕ) (q : Fin r → ℝ) (psi : Fin r → (EuclideanSpace ℂ I)),
    (∀ j, 0 ≤ q j) ∧ (∑ j, q j) = 1 ∧
    (∀ j, psi j ∈ S ∧ IsState (psi j)) ∧
    rho = ∑ j, (q j : ℂ) • pureDensity (psi j)

/-- PDF p.8, §6: forgetting only the classical key in the same full-output model. -/
def ExactSourceRandomization (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K (I × A))
    (anc : (Matrix A A ℂ)) (rho0 : (Matrix (I × A) (I × A) ℂ)) : Prop :=
  PQC S E anc rho0

/-- PDF pp.8–9: the same randomization model with no ancillary environment. -/
def BareRandomizes (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K I) (rho0 : (Matrix I I ℂ)) : Prop :=
  BarePQC S E rho0

/-- PDF p.3: sigma_0, sigma_1, sigma_2, sigma_3 are I, X, Y, Z in this order. -/
def sourcePauli (j : Fin 4) : Stabilizer.Pauli :=
  if j.val = 0 then .I else if j.val = 1 then .X else if j.val = 2 then .Y else .Z

/-- PDF p.5, Theorem 4.1: uniform, phase-zero tensor Paulis, each of probability 2^(-2n). -/
def fullPauli (n : ℕ) : KeyedUnitaryEnsemble (Fin n → Fin 4) (Qubits n) where
  p := fun _ => ((2 : ℝ) ^ (2 * n))⁻¹
  U := fun x => (Stabilizer.PauliString.mk 0 (fun j => sourcePauli (x j))).toMatrix

/-- PDF p.5, Theorem 4.2: independent uniform choices of I and Y, each string of
probability 2^(-n). A true bit selects sigma_2 = Y. -/
def realPauli (n : ℕ) : KeyedUnitaryEnsemble (Qubits n) (Qubits n) where
  p := fun _ => ((2 : ℝ) ^ n)⁻¹
  U := fun x => (Stabilizer.PauliString.mk 0
    (fun j => if x j then Stabilizer.Pauli.Y else Stabilizer.Pauli.I)).toMatrix

/-- PDF p.5: tensor product of the real qubits cos(theta_j)|0> + sin(theta_j)|1>.
For n = 0 the amplitude of the empty bit string is the empty product, namely 1. -/
def realProductVector {n : ℕ} (theta : Fin n → ℝ) : (EuclideanSpace ℂ (Qubits n)) :=
  WithLp.toLp 2 (fun b => ∏ j, ((if b j then Real.sin (theta j)
    else Real.cos (theta j)) : ℂ))

/-- PDF p.5: exactly B tensor n, not its linear span or all real entangled vectors. -/
def realProductSource (n : ℕ) : Set ((EuclideanSpace ℂ (Qubits n))) :=
  {psi | ∃ theta : Fin n → ℝ,
    (∀ j, 0 ≤ theta j ∧ theta j < 2 * Real.pi) ∧ psi = realProductVector theta}

/-- PDF p.5: the particular source {|0>, |+>} in the nonmaximal-output example. -/
def exampleSource : Set ((EuclideanSpace ℂ Bool)) :=
  {psi | psi = ket false ∨ psi = act hadamard (ket false)}

/-- PDF p.5: the example's two equally likely unitaries I and H. -/
def exampleEnsemble : KeyedUnitaryEnsemble Bool Bool where
  p := fun _ => 1 / 2
  U := fun k => if k then hadamard else 1

/-- PDF p.5: the example's fixed output [[3/4,1/4],[1/4,1/4]], in basis order 0,1. -/
def hadamardExampleDensity : (Matrix Bool Bool ℂ) :=
  fun b c => if b = false ∧ c = false then 3 / 4 else 1 / 4

/-- PDF pp.6–7, Theorem 5.2: (I/2^n) tensor rho0, reassociated from
I × (I × A) to (I × I) × A. No register is discarded. -/
def reductionOutput {n a : ℕ} (rho0 : (Matrix (Qubits n × Qubits a) (Qubits n × Qubits a) ℂ)) :
    (Matrix ((Qubits n × Qubits n) × Qubits a) ((Qubits n × Qubits n) × Qubits a) ℂ) :=
  fun x y => sourceMixedIdentity (Qubits n) x.1.1 y.1.1 * rho0 (x.1.2, x.2) (y.1.2, y.2)

/-! Local definition sanity examples; none use a theorem under draft. -/

example : sourcePauli 2 = Stabilizer.Pauli.Y := by rfl

example : (fullPauli 0).p (fun j => Fin.elim0 j) = 1 := by
  simp [fullPauli]

example : (realPauli 1).p (fun _ => true) = 1 / 2 := by
  norm_num [realPauli]

example : keyEntropy (fun _ : Fin 1 => (0 : ℝ)) = 0 := by
  simp [keyEntropy]

example (E : KeyedUnitaryEnsemble (Fin 0) Bool) : ¬ E.Valid := by
  simp [KeyedUnitaryEnsemble.Valid]

example (theta : Fin 0 → ℝ) (b : Qubits 0) : realProductVector theta b = 1 := by
  simp [realProductVector]

example : hadamardExampleDensity false false = 3 / 4 := by rfl

example : hadamardExampleDensity true false = 1 / 4 := by rfl

example (S : Set ((EuclideanSpace ℂ I))) (E : KeyedUnitaryEnsemble K (I × A)) (anc : (Matrix A A ℂ))
    (rho0 : (Matrix (I × A) (I × A) ℂ)) : ExactSourceRandomization S E anc rho0 ↔ PQC S E anc rho0 := by
  rfl

example : sourceMixedIdentity Bool false false = 1 / 2 := by
  norm_num [sourceMixedIdentity]

example (E : KeyedUnitaryEnsemble K I) : encrypt E 0 = 0 := by
  simp [encrypt]

end

end QAlgorithms.Papers.Independent.Advance50.P18
Source
Private Quantum Channels and the Cost of Randomizing Quantum Information, arXiv:quant-ph/0003101v2, https://arxiv.org/abs/quant-ph/0003101v2
Read-back

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

QAlgorithms.Papers.Independent.Advance50.P18.BarePQC

For finite types KKK and III, with decidable equality on III, a set SSS of complex Euclidean vectors indexed by III, an ensemble E=(p,U)E=(p,U)E=(p,U), and a complex I×II\times II×I matrix ρ0\rho_0ρ0​, the predicate holds precisely when pk≥0p_k\ge0pk​≥0 for every key, ∑kpk=1\sum_kp_k=1∑k​pk​=1, every UkU_kUk​ is unitary, ρ0\rho_0ρ0​ is positive semidefinite with trace one, and every ψ∈S\psi\in Sψ∈S satisfies both ∥ψ∥=1\|\psi\|=1∥ψ∥=1 and

∑k∈Kpk UkPψUk†=ρ0,Pψ(a,b)=ψ(a)ψ(b)‾.\sum_{k\in K}p_k\,U_kP_\psi U_k^\dagger=\rho_0, \qquad P_\psi(a,b)=\psi(a)\overline{\psi(b)}.k∈K∑​pk​Uk​Pψ​Uk†​=ρ0​,Pψ​(a,b)=ψ(a)ψ(b)​.

The real weights are interpreted as complex scalars. If SSS is empty, the conditions quantified over its vectors are vacuous, but ensemble validity and the conditions on ρ0\rho_0ρ0​ remain required. Empty KKK or empty III makes the predicate impossible.

QAlgorithms.Papers.Independent.Advance50.P18.BareRandomizes

For finite types KKK and III, with decidable equality on III, a set SSS of complex Euclidean vectors indexed by III, an ensemble E=(p,U)E=(p,U)E=(p,U), and an I×II\times II×I complex matrix ρ0\rho_0ρ0​, this predicate means that all pk≥0p_k\ge0pk​≥0, ∑kpk=1\sum_kp_k=1∑k​pk​=1, every UkU_kUk​ is unitary, ρ0\rho_0ρ0​ is positive semidefinite with trace one, and every ψ∈S\psi\in Sψ∈S has norm one and satisfies

∑k∈Kpk UkPψUk†=ρ0,Pψ(a,b)=ψ(a)ψ(b)‾.\sum_{k\in K}p_k\,U_kP_\psi U_k^\dagger=\rho_0, \qquad P_\psi(a,b)=\psi(a)\overline{\psi(b)}.k∈K∑​pk​Uk​Pψ​Uk†​=ρ0​,Pψ​(a,b)=ψ(a)ψ(b)​.

Real weights act as complex scalars. If SSS is empty, the vector conditions are vacuous while ensemble validity and the conditions on ρ0\rho_0ρ0​ remain. Empty KKK or empty III makes the predicate impossible.

QAlgorithms.Papers.Independent.Advance50.P18.ExactSourceRandomization

For finite types K,I,AK,I,AK,I,A, with decidable equality on III and AAA, a set SSS of complex Euclidean vectors indexed by III, an ensemble E=(p,U)E=(p,U)E=(p,U) of matrices indexed by I×AI\times AI×A, an A×AA\times AA×A matrix anc\mathrm{anc}anc, and a matrix ρ0\rho_0ρ0​ indexed by I×AI\times AI×A, exact source randomization means that all pk≥0p_k\ge0pk​≥0, ∑kpk=1\sum_kp_k=1∑k​pk​=1, every UkU_kUk​ is unitary, anc\mathrm{anc}anc and ρ0\rho_0ρ0​ are positive semidefinite with trace one, and every ψ∈S\psi\in Sψ∈S has norm one and satisfies

∑k∈Kpk Uk(Pψ⊗anc)Uk†=ρ0,(Pψ⊗anc)(i,a),(j,b)=ψ(i)ψ(j)‾ anca,b.\sum_{k\in K}p_k\,U_k(P_\psi\otimes\mathrm{anc})U_k^\dagger=\rho_0, \qquad (P_\psi\otimes\mathrm{anc})_{(i,a),(j,b)} =\psi(i)\overline{\psi(j)}\,\mathrm{anc}_{a,b}.k∈K∑​pk​Uk​(Pψ​⊗anc)Uk†​=ρ0​,(Pψ​⊗anc)(i,a),(j,b)​=ψ(i)ψ(j)​anca,b​.

Real weights act as complex scalars. If SSS is empty, the vector conditions are vacuous while all other conditions remain. Empty KKK, III, or AAA makes the predicate impossible.

QAlgorithms.Papers.Independent.Advance50.P18.IsSourceMixture

For a finite type III, a set SSS of complex Euclidean vectors indexed by III, and any complex I×II\times II×I matrix ρ\rhoρ, this predicate means that there exist a natural number rrr, real weights qjq_jqj​, and vectors ψj\psi_jψj​, indexed by 0≤j<r0\le j<r0≤j<r, such that every qj≥0q_j\ge0qj​≥0, ∑j<rqj=1\sum_{j<r}q_j=1∑j<r​qj​=1, every ψj∈S\psi_j\in Sψj​∈S has norm one, and

ρ=∑j<rqjPψj,Pψj(a,b)=ψj(a)ψj(b)‾.\rho=\sum_{j<r}q_jP_{\psi_j}, \qquad P_{\psi_j}(a,b)=\psi_j(a)\overline{\psi_j(b)}.ρ=j<r∑​qj​Pψj​​,Pψj​​(a,b)=ψj​(a)ψj​(b)​.

The weights are interpreted as complex scalars in the matrix sum. Repeated vectors and zero weights are allowed, but even a vector with zero weight must belong to SSS and have norm one. Although r=0r=0r=0 is quantified over, it cannot satisfy the weight normalization; consequently the predicate cannot hold when SSS or III is empty.

QAlgorithms.Papers.Independent.Advance50.P18.KeyedUnitaryEnsemble.Valid

For finite types KKK and III, with decidable equality on III, an ensemble E=(p,U)E=(p,U)E=(p,U) is valid precisely when every pkp_kpk​ is nonnegative, ∑k∈Kpk=1\sum_{k\in K}p_k=1∑k∈K​pk​=1, and every UkU_kUk​ is unitary, meaning Uk†Uk=UkUk†=1IU_k^\dagger U_k=U_kU_k^\dagger=\mathbf 1_IUk†​Uk​=Uk​Uk†​=1I​. Unitarity is required even for keys with weight zero. If KKK is empty, validity is impossible because the weight sum is zero.

QAlgorithms.Papers.Independent.Advance50.P18.KeyedUnitaryEnsemble

For arbitrary types KKK and III, a keyed unitary ensemble consists of a function p:K→Rp:K\to\mathbb Rp:K→R and a function UUU assigning to each k∈Kk\in Kk∈K a complex matrix UkU_kUk​ whose rows and columns are indexed by III. This structure imposes no finiteness, nonnegativity, normalization, or unitarity conditions.

QAlgorithms.Papers.Independent.Advance50.P18.PQC

For finite types K,I,AK,I,AK,I,A, with decidable equality on III and AAA, a set SSS of complex Euclidean vectors indexed by III, an ensemble E=(p,U)E=(p,U)E=(p,U) of matrices indexed by I×AI\times AI×A, a complex A×AA\times AA×A matrix anc\mathrm{anc}anc, and a complex matrix ρ0\rho_0ρ0​ indexed by I×AI\times AI×A, the predicate holds precisely when pk≥0p_k\ge0pk​≥0 for every key, ∑kpk=1\sum_kp_k=1∑k​pk​=1, every UkU_kUk​ is unitary, both anc\mathrm{anc}anc and ρ0\rho_0ρ0​ are positive semidefinite with trace one, and every ψ∈S\psi\in Sψ∈S satisfies ∥ψ∥=1\|\psi\|=1∥ψ∥=1 and

∑k∈Kpk Uk(Pψ⊗anc)Uk†=ρ0,(Pψ⊗anc)(i,a),(j,b)=ψ(i)ψ(j)‾ anca,b.\sum_{k\in K}p_k\,U_k(P_\psi\otimes\mathrm{anc})U_k^\dagger=\rho_0, \qquad (P_\psi\otimes\mathrm{anc})_{(i,a),(j,b)} =\psi(i)\overline{\psi(j)}\,\mathrm{anc}_{a,b}.k∈K∑​pk​Uk​(Pψ​⊗anc)Uk†​=ρ0​,(Pψ​⊗anc)(i,a),(j,b)​=ψ(i)ψ(j)​anca,b​.

The real weights are interpreted as complex scalars. For empty SSS, only the conditions quantified over its vectors become vacuous. Empty KKK, III, or AAA makes the predicate impossible.

QAlgorithms.Papers.Independent.Advance50.P18.allPure

For any finite type III, allPure⁡(I)\operatorname{allPure}(I)allPure(I) is the set of all vectors ψ\psiψ in the complex Euclidean space indexed by III satisfying ∥ψ∥=1\|\psi\|=1∥ψ∥=1. If III is empty, its Euclidean space contains only the zero vector, so this set is empty.

QAlgorithms.Papers.Independent.Advance50.P18.classicalSource

For any type III with decidable equality, the classical source is the set of coordinate vectors {ex:x∈I}\{e_x:x\in I\}{ex​:x∈I} in the complex Euclidean space indexed by III, where ex(y)=1e_x(y)=1ex​(y)=1 when y=xy=xy=x and ex(y)=0e_x(y)=0ex​(y)=0 otherwise. No finiteness assumption on III appears in this definition. If III is empty, the source is empty.

QAlgorithms.Papers.Independent.Advance50.P18.encrypt

For finite types KKK and III, an ensemble E=(p,U)E=(p,U)E=(p,U) of complex I×II\times II×I matrices, and any complex I×II\times II×I matrix ρ\rhoρ, encryption is defined by

encrypt⁡E(ρ)=∑k∈Kpk UkρUk†,\operatorname{encrypt}_E(\rho) =\sum_{k\in K}p_k\,U_k\rho U_k^\dagger,encryptE​(ρ)=k∈K∑​pk​Uk​ρUk†​,

where each real weight is regarded as a complex scalar and Uk†U_k^\daggerUk†​ is the conjugate transpose. No validity condition on EEE, and no positivity or trace condition on ρ\rhoρ, is assumed. If KKK is empty, the result is the zero matrix.

QAlgorithms.Papers.Independent.Advance50.P18.exampleEnsemble

This defines an ensemble with Boolean keys, each having weight 1/21/21/2, acting on the complex coordinate space indexed by Booleans. The key false\mathrm{false}false selects the identity matrix, and the key true\mathrm{true}true selects

H=12(111−1),H=\frac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix},H=2​1​(11​1−1​),

where rows and columns are ordered as false,true\mathrm{false},\mathrm{true}false,true.

QAlgorithms.Papers.Independent.Advance50.P18.exampleSource

This defines the set of vectors in the complex Euclidean space indexed by false,true\mathrm{false},\mathrm{true}false,true that equal either the basis vector at false\mathrm{false}false, whose coordinates are (1,0)(1,0)(1,0), or the result of multiplying that vector by

H=12(111−1).H=\frac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}.H=2​1​(11​1−1​).

Thus the set is exactly {(1,0),(1/2,1/2)}\{(1,0),(1/\sqrt2,1/\sqrt2)\}{(1,0),(1/2​,1/2​)}, with coordinates ordered as false,true\mathrm{false},\mathrm{true}false,true.

QAlgorithms.Papers.Independent.Advance50.P18.fullPauli

For every natural number nnn, this defines an ensemble indexed by strings x∈{0,1,2,3}nx\in\{0,1,2,3\}^{n}x∈{0,1,2,3}n, acting on the complex coordinate space indexed by Boolean strings b∈{false,true}nb\in\{\mathrm{false},\mathrm{true}\}^{n}b∈{false,true}n. Every key has weight 2−2n2^{-2n}2−2n, and its matrix is

(Ux)b,c=∏j=0n−1(σxj)bj,cj,σ0=(1001),σ1=(0110),σ2=(0−ii0),σ3=(100−1),(U_x)_{b,c}=\prod_{j=0}^{n-1}(\sigma_{x_j})_{b_j,c_j}, \qquad \sigma_0=\begin{pmatrix}1&0\\0&1\end{pmatrix},\quad \sigma_1=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad \sigma_2=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\quad \sigma_3=\begin{pmatrix}1&0\\0&-1\end{pmatrix},(Ux​)b,c​=j=0∏n−1​(σxj​​)bj​,cj​​,σ0​=(10​01​),σ1​=(01​10​),σ2​=(0i​−i0​),σ3​=(10​0−1​),

where rows and columns of each 2×22\times22×2 matrix are ordered as false,true\mathrm{false},\mathrm{true}false,true. The Pauli string has phase 000, so its phase factor is i0=1i^0=1i0=1. When n=0n=0n=0, there is one empty key, its weight is 111, and the empty product gives the 1×11\times11×1 matrix (1)(1)(1).

QAlgorithms.Papers.Independent.Advance50.P18.hadamardExampleDensity

This defines the complex matrix indexed by Booleans whose (false,false)(\mathrm{false},\mathrm{false})(false,false) entry is 3/43/43/4 and whose other three entries are 1/41/41/4. With rows and columns ordered as false,true\mathrm{false},\mathrm{true}false,true, it is

(3/41/41/41/4).\begin{pmatrix}3/4&1/4\\1/4&1/4\end{pmatrix}.(3/41/4​1/41/4​).

QAlgorithms.Papers.Independent.Advance50.P18.keyEntropy

For a finite type KKK and any function p:K→Rp:K\to\mathbb Rp:K→R, the key entropy is the real number

−∑k∈K{0,pk=0,pk log⁡pklog⁡2,pk≠0.-\sum_{k\in K} \begin{cases} 0,&p_k=0,\\ p_k\,\dfrac{\log p_k}{\log 2},&p_k\ne0. \end{cases}−k∈K∑​⎩⎨⎧​0,pk​log2logpk​​,​pk​=0,pk​=0.​

There is no assumption that the weights are nonnegative or sum to one. Negative weights are included using the real logarithm as defined in the code, which satisfies log⁡x=log⁡∣x∣\log x=\log|x|logx=log∣x∣ for negative xxx. For empty KKK, the value is zero.

QAlgorithms.Papers.Independent.Advance50.P18.realPauli

For every natural number nnn, this defines an ensemble whose keys and coordinate indices are Boolean strings of length nnn. Each key xxx has weight 2−n2^{-n}2−n, and

(Ux)b,c=∏j=0n−1(Mxj)bj,cj,Mfalse=(1001),Mtrue=(0−ii0),(U_x)_{b,c}=\prod_{j=0}^{n-1}(M_{x_j})_{b_j,c_j}, \qquad M_{\mathrm{false}}=\begin{pmatrix}1&0\\0&1\end{pmatrix}, \qquad M_{\mathrm{true}}=\begin{pmatrix}0&-i\\i&0\end{pmatrix},(Ux​)b,c​=j=0∏n−1​(Mxj​​)bj​,cj​​,Mfalse​=(10​01​),Mtrue​=(0i​−i0​),

with rows and columns ordered as false,true\mathrm{false},\mathrm{true}false,true. The Pauli string has phase 000, hence phase factor 111. When n=0n=0n=0, the sole empty key has weight 111 and matrix (1)(1)(1).

QAlgorithms.Papers.Independent.Advance50.P18.realProductSource

For every natural number nnn, this defines the set of complex vectors ψ\psiψ indexed by Boolean strings of length nnn for which there exists a real angle assignment θ=(θj)j=0n−1\theta=(\theta_j)_{j=0}^{n-1}θ=(θj​)j=0n−1​ satisfying 0≤θj<2π0\leq\theta_j<2\pi0≤θj​<2π for every jjj, such that

ψb=∏j=0n−1{sin⁡(θj),bj=true,cos⁡(θj),bj=falsefor every Boolean string b.\psi_b=\prod_{j=0}^{n-1} \begin{cases} \sin(\theta_j),&b_j=\mathrm{true},\\ \cos(\theta_j),&b_j=\mathrm{false} \end{cases} \quad\text{for every Boolean string }b.ψb​=j=0∏n−1​{sin(θj​),cos(θj​),​bj​=true,bj​=false​for every Boolean string b.

The real products are regarded as complex coordinates. For n=0n=0n=0, the angle restrictions are vacuous and the set consists of the vector whose sole coordinate is 111.

QAlgorithms.Papers.Independent.Advance50.P18.realProductVector

For every natural number nnn and every assignment of real angles θ=(θj)j=0n−1\theta=(\theta_j)_{j=0}^{n-1}θ=(θj​)j=0n−1​, this defines a vector in the complex Euclidean space indexed by Boolean strings of length nnn, with coordinate

ψb=∏j=0n−1{sin⁡(θj),bj=true,cos⁡(θj),bj=false.\psi_b=\prod_{j=0}^{n-1} \begin{cases} \sin(\theta_j),&b_j=\mathrm{true},\\ \cos(\theta_j),&b_j=\mathrm{false}. \end{cases}ψb​=j=0∏n−1​{sin(θj​),cos(θj​),​bj​=true,bj​=false.​

Each real factor is regarded as a complex number. There are no restrictions on the angles. For n=0n=0n=0, the sole coordinate is the empty product 111.

QAlgorithms.Papers.Independent.Advance50.P18.reductionOutput

For arbitrary natural numbers n,an,an,a and an arbitrary complex matrix ρ0\rho_0ρ0​ indexed by pairs consisting of an nnn-bit Boolean string and an aaa-bit Boolean string, this defines a matrix RRR indexed by triples grouped as ((u,v),w)((u,v),w)((u,v),w), where u,vu,vu,v are nnn-bit strings and www is an aaa-bit string, by

R((u,v),w),((u′,v′),w′)={2−n (ρ0)(v,w),(v′,w′),u=u′,0,u≠u′.R_{((u,v),w),((u',v'),w')} = \begin{cases} 2^{-n}\,(\rho_0)_{(v,w),(v',w')},&u=u',\\ 0,&u\ne u'. \end{cases}R((u,v),w),((u′,v′),w′)​={2−n(ρ0​)(v,w),(v′,w′)​,0,​u=u′,u=u′.​

Thus the factor on the first register is the identity matrix divided by its dimension 2n2^n2n. No positivity, trace, or normalization assumption is imposed on ρ0\rho_0ρ0​. Both n=0n=0n=0 and a=0a=0a=0 are included; a zero-length Boolean register has one possible string.

QAlgorithms.Papers.Independent.Advance50.P18.sourceMixedIdentity

For any finite type III with decidable equality, the source mixed identity is (∣I∣:C)−11I(|I|:\mathbb C)^{-1}\mathbf 1_I(∣I∣:C)−11I​, where 1I\mathbf 1_I1I​ is the identity matrix indexed by III. If III is empty, the scalar inverse is 0−1=00^{-1}=00−1=0, so the definition gives the unique empty matrix.

QAlgorithms.Papers.Independent.Advance50.P18.sourcePauli

For each j∈{0,1,2,3}j\in\{0,1,2,3\}j∈{0,1,2,3}, this function returns the Pauli label III, XXX, YYY, or ZZZ, respectively:

0↦I,1↦X,2↦Y,3↦Z.0\mapsto I,\qquad 1\mapsto X,\qquad 2\mapsto Y,\qquad 3\mapsto Z.0↦I,1↦X,2↦Y,3↦Z.
Human review
  • Endorsed by Shuze Chen · Oct 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 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