Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Kraus update, POVM elements, density matrices, and complete positivity

Definition
PeresTerno_kraus_basics

by Lucas · 1 vote · Oct 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

kraus-operatorsquantum-information

Let ddd, eee be finite index sets and let {Am}m∈I\{A_m\}_{m\in I}{Am​}m∈I​ be a finite family of complex e×de\times de×d matrices (the Kraus matrices of one outcome). This file defines:

  1. the Kraus update of a d×dd\times dd×d matrix ρ\rhoρ (Eq. (6)):
ρ′=∑m∈IAm ρ Am†(an e×e matrix);\rho' = \sum_{m\in I} A_m\,\rho\,A_m^\dagger \quad (\text{an } e\times e \text{ matrix});ρ′=m∈I∑​Am​ρAm†​(an e×e matrix);
  1. the POVM element (Eq. (8)):
E=∑m∈IAm†Am(a d×d matrix, the size of the initial state);E = \sum_{m\in I} A_m^\dagger A_m \quad (\text{a } d\times d \text{ matrix, the size of the initial state});E=m∈I∑​Am†​Am​(a d×d matrix, the size of the initial state);
  1. a density matrix: a positive semidefinite complex matrix of trace 111;
  2. the ampliation T⊗1T\otimes\mathbb 1T⊗1 of a map TTT from d×dd\times dd×d to e×ee\times ee×e matrices, acting on a matrix RRR indexed by d×Fd\times Fd×F by applying TTT to every d×dd\times dd×d block (R(i,a),(j,b))i,j(R_{(i,a),(j,b)})_{i,j}(R(i,a),(j,b)​)i,j​;
  3. a positive map: T(ρ)T(\rho)T(ρ) is positive semidefinite whenever ρ\rhoρ is;
  4. a completely positive map: (T⊗1)(R)(T\otimes\mathbb 1)(R)(T⊗1)(R) is positive semidefinite for every positive semidefinite RRR on Cd⊗Cn\mathbb C^d\otimes\mathbb C^nCd⊗Cn, for every n∈Nn\in\mathbb Nn∈N.

These are the shared vocabulary of every statement in the mission.

Formalization Note The maps in items 4-6 are arbitrary functions on matrices (linearity is required separately where the source requires it). The ancilla in item 6 is indexed by Fin n.

Definition code
import Mathlib

/-!
# Kraus operators, POVM elements, and complete positivity

Definitions for the mission drafted from A. Peres and D. R. Terno,
*Quantum information and relativity theory*, Rev. Mod. Phys. 76 (2004) 93,
Sec. II.D–II.E, Eqs. (6)–(11).
-/

namespace PeresTerno

open Matrix
open scoped ComplexOrder

/-- Eq. (6): the (unnormalized) post-measurement state
`ρ'_μ = ∑ₘ A_{μm} ρ A_{μm}†` for the Kraus matrices `A m` of one outcome `μ`.
The Kraus matrices may change the dimension (`e × d`). -/
noncomputable def krausUpdate {d e ι : Type*} [Fintype d] [Fintype ι]
    (A : ι → Matrix e d ℂ) (ρ : Matrix d d ℂ) : Matrix e e ℂ :=
  ∑ m, A m * ρ * (A m)ᴴ

/-- Eq. (8): the POVM element `E_μ = ∑ₘ A_{μm}† A_{μm}` (a `d × d` matrix, the same size
as the initial state). -/
noncomputable def povmElement {d e ι : Type*} [Fintype e] [Fintype ι]
    (A : ι → Matrix e d ℂ) : Matrix d d ℂ :=
  ∑ m, (A m)ᴴ * A m

/-- A density matrix: positive semidefinite with unit trace. -/
def IsDensityMatrix {d : Type*} [Fintype d] (ρ : Matrix d d ℂ) : Prop :=
  ρ.PosSemidef ∧ ρ.trace = 1

/-- The map `T ⊗ 1` acting on a bipartite matrix on `d × f`: `T` is applied to each
`d × d` block `(R_{(i,a),(j,b)})_{i,j}` indexed by the ancilla labels `a, b`. -/
def ampliate {d e f : Type*} (T : Matrix d d ℂ → Matrix e e ℂ)
    (R : Matrix (d × f) (d × f) ℂ) : Matrix (e × f) (e × f) ℂ :=
  fun p q => T (fun i j => R (i, p.2) (j, q.2)) p.1 q.1

/-- A map is positive if it sends positive semidefinite matrices to positive semidefinite
matrices. -/
def IsPositiveMap {d e : Type*} [Fintype d] [Fintype e]
    (T : Matrix d d ℂ → Matrix e e ℂ) : Prop :=
  ∀ ρ : Matrix d d ℂ, ρ.PosSemidef → (T ρ).PosSemidef

/-- A map is completely positive if `T ⊗ 1` is positive for an ancilla of every finite
dimension `n`. -/
def IsCompletelyPositive {d e : Type*} [Fintype d] [Fintype e]
    (T : Matrix d d ℂ → Matrix e e ℂ) : Prop :=
  ∀ (n : ℕ) (R : Matrix (d × Fin n) (d × Fin n) ℂ), R.PosSemidef →
    (ampliate T R).PosSemidef

end PeresTerno
Source
A. Peres and D. R. Terno, Quantum information and relativity theory, Rev. Mod. Phys. 76, 93-123 (2004), https://doi.org/10.1103/RevModPhys.76.93, pp. 99-100, Sec. II.D, Eqs. (6) and (8); complete positivity as defined on p. 100
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) - NON-BLIND: same agent that drafted the statements

Non-blind read-back - not independent testimony. This read-back was written by the same agent (Aristotle, by Harmonic) that drafted the Lean statement below, with full knowledge of the source paper and of the intended meaning, at the explicit request of the proposal owner. It was not produced by a blind, independent auditor and must not be mistaken for independent testimony. Reviewers should compare the Lean code against the source themselves.

The file declares, inside a namespace PeresTerno, the following objects; all matrices have complex entries and all index types used in sums are finite.

  1. Kraus update. For index types d,ed, ed,e (ddd finite), a finite index type III, a family A:I→Ce×dA : I \to \mathbb C^{e\times d}A:I→Ce×d and a d×dd\times dd×d matrix ρ\rhoρ, the e×ee\times ee×e matrix
krausUpdate(A,ρ)=∑m∈IAm ρ Am†,\mathrm{krausUpdate}(A,\rho) = \sum_{m\in I} A_m\,\rho\,A_m^{\dagger},krausUpdate(A,ρ)=m∈I∑​Am​ρAm†​,

where †{}^\dagger† is the conjugate transpose. If III is empty this is the zero matrix.

  1. POVM element. For eee finite and AAA as above, the d×dd\times dd×d matrix
povmElement(A)=∑m∈IAm†Am,\mathrm{povmElement}(A) = \sum_{m\in I} A_m^{\dagger} A_m ,povmElement(A)=m∈I∑​Am†​Am​,

zero if III is empty.

  1. Density matrix. For a finite index type ddd, a d×dd\times dd×d matrix ρ\rhoρ is a density matrix iff ρ\rhoρ is positive semidefinite (Hermitian with x†ρx≥0x^\dagger \rho x \ge 0x†ρx≥0 for all xxx) and tr⁡ρ=1\operatorname{tr}\rho = 1trρ=1. If ddd is empty no matrix qualifies (its trace is 000).

  2. Ampliation. For any function TTT from d×dd\times dd×d matrices to e×ee\times ee×e matrices (no linearity assumed) and any matrix RRR indexed by pairs in d×Fd\times Fd×F, the matrix indexed by e×Fe\times Fe×F whose entry at row (k,a)(k,a)(k,a), column (l,b)(l,b)(l,b) is

[T(R(a,b))]kl,Rij(a,b)=R(i,a),(j,b).\big[T\big(R^{(a,b)}\big)\big]_{k l}, \qquad R^{(a,b)}_{ij} = R_{(i,a),(j,b)} .[T(R(a,b))]kl​,Rij(a,b)​=R(i,a),(j,b)​.
  1. Positive map. For finite d,ed, ed,e, TTT is positive iff for every positive semidefinite d×dd\times dd×d matrix ρ\rhoρ, T(ρ)T(\rho)T(ρ) is positive semidefinite.

  2. Completely positive map. For finite d,ed, ed,e, TTT is completely positive iff for every natural number nnn (including n=0n=0n=0) and every positive semidefinite matrix RRR indexed by d×{0,…,n−1}d\times\{0,\dots,n-1\}d×{0,…,n−1}, the ampliation of TTT applied to RRR (item 4) is positive semidefinite.

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

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 5, 2026

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

  • Endorsed by Alien60 · Oct 8, 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