Matrix partial trace (K1-B.1) #
Category: 1-Mathlib (CSD-free; staged as a Mathlib-upstream candidate).
Glossary: https://glossary.constraintsurfacedynamics.com/partial-trace/
Plain-language, CSD-role and formal statements of the partial trace, with
this module as the Lean anchor. Kept symmetric by scripts/check-glossary.sh.
The partial trace of a bipartite matrix M : Matrix (n × m) (n × m) ℂ. Mathlib has no
matrix partial trace (the only partialTrace declarations are category-theoretic / probability
kernels), so this is genuinely new infrastructure. It is the shared prerequisite for K1-B
subadditivity (specs/k1-plan.md), the gated decoherence / entangled D1 tier, and the
Landauer / ontic-entropy touchpoint.
For M : Matrix (n × m) (n × m) ℂ:
partialTraceRight M : Matrix n n ℂ,(Tr_B M) i j = ∑ₖ M (i,k) (j,k)— trace out the second (B) factor, leaving the first (A) factor;partialTraceLeft M : Matrix m m ℂ,(Tr_A M) k l = ∑ᵢ M (i,k) (i,l)— trace out the first (A) factor.
Delivered, foundational-triple-only and AxiomAudit-pinned:
- linearity (
_add,_smul, and the bundledpartialTraceRightₗ/partialTraceLeftₗLinearMaps); - trace preservation
trace (Tr_B M) = trace M(partialTraceRight_trace,partialTraceLeft_trace), viaFintype.sum_prod_type; - tensor reduction
Tr_B (ρ ⊗ₖ σ) = (trace σ) • ρandTr_A (ρ ⊗ₖ σ) = (trace ρ) • σ(partialTraceRight_kronecker,partialTraceLeft_kronecker) — note the trace of the traced-out factor multiplies the surviving one; IsHermitianpreservation (partialTraceRight_isHermitian,partialTraceLeft_isHermitian);PosSemidefpreservation (partialTraceRight_posSemidef,partialTraceLeft_posSemidef), via the witness vectorsw_k (i,k') = if k' = k then v i else 0(av ⊗ eₖtensor), for whichstar v ⬝ᵥ (Tr_B M) *ᵥ v = ∑ₖ star (w_k) ⬝ᵥ M *ᵥ (w_k), each summand≥ 0byM.PosSemidef;- density ↦ density (
partialTraceRight_density,partialTraceLeft_density): the reduced state of a density operator is a density operator.
Definitions #
The right partial trace Tr_B : Matrix (n × m) (n × m) ℂ → Matrix n n ℂ, tracing out the
second (B) factor: (Tr_B M) i j = ∑ₖ M (i,k) (j,k). Leaves the first (A) factor.
Instances For
The left partial trace Tr_A : Matrix (n × m) (n × m) ℂ → Matrix m m ℂ, tracing out the
first (A) factor: (Tr_A M) k l = ∑ᵢ M (i,k) (i,l). Leaves the second (B) factor.
Instances For
Linearity #
The right partial trace bundled as a ℂ-linear map.
Equations
- QuantumInfo.partialTraceRightₗ = { toFun := QuantumInfo.partialTraceRight, map_add' := ⋯, map_smul' := ⋯ }
Instances For
The left partial trace bundled as a ℂ-linear map.
Equations
- QuantumInfo.partialTraceLeftₗ = { toFun := QuantumInfo.partialTraceLeft, map_add' := ⋯, map_smul' := ⋯ }
Instances For
Trace preservation #
Trace preservation: trace (Tr_B M) = trace M.
∑ᵢ ∑ₖ M (i,k) (i,k) = ∑_{(i,k)} M (i,k) (i,k) = trace M via Fintype.sum_prod_type.
Tensor reduction #
Tensor reduction: Tr_B (ρ ⊗ₖ σ) = (trace σ) • ρ. The trace of the traced-out
factor σ multiplies the surviving factor ρ:
(ρ⊗σ)((i,k),(j,k)) = ρ i j · σ k k, so ∑ₖ ρ i j · σ k k = ρ i j · trace σ.
Reduced product state: Tr_B (ρ ⊗ₖ σ) = ρ when trace σ = 1. The K1-B.2 consumer:
the right reduced state of a product density operator is its left factor.
IsHermitian preservation #
IsHermitian preservation: M.IsHermitian → (Tr_B M).IsHermitian. From
M (a) (b) = star (M b a) (the Hermitian condition Mᴴ = M), the sum
(Tr_B M)ᴴ i j = star (∑ₖ M (j,k) (i,k)) = ∑ₖ M (i,k) (j,k) = (Tr_B M) i j.
IsHermitian preservation: M.IsHermitian → (Tr_A M).IsHermitian.
PosSemidef preservation #
PosSemidef preservation: M.PosSemidef → (Tr_B M).PosSemidef.
The quadratic form on the reduced operator unfolds, for any v : n → ℂ, into a sum over the
traced-out index k of the quadratic form of M on the tensor witnesses
wₖ : n × m → ℂ, wₖ (i, k') = if k' = k then v i else 0 (i.e. v ⊗ eₖ):
star v ⬝ᵥ (Tr_B M) *ᵥ v = ∑ₖ star (wₖ) ⬝ᵥ M *ᵥ (wₖ) ≥ 0,
each summand ≥ 0 by M.PosSemidef.
PosSemidef preservation: M.PosSemidef → (Tr_A M).PosSemidef. Witnesses
wᵢ : n × m → ℂ, wᵢ (i', k) = if i' = i then v k else 0 (i.e. eᵢ ⊗ v).
Density ↦ density #
The reduced state of a density operator is a density operator (right factor).
From PSD preservation + trace preservation: if M is PSD with unit trace then so is
Tr_B M.
The reduced state of a density operator is a density operator (left factor).
Reduced-trace identities #
Rehomed from Subadditivity.lean (2026-08-20, the Q27 arc): the defining property of the
partial trace belongs beside the definition, and the CV entangled-weights bridge
(CV/EntangledWeights.lean) consumes it without the entropy stack. Both K1-B consumers
(Subadditivity.lean, StrongSubadditivity.lean) keep resolving the names through their
public import of this module.
Reduced-trace identity (right): Tr(M · (X ⊗ I)) = Tr(Tr_B(M) · X). Pairing a bipartite
operator against a X ⊗ I_B observable collapses to the right partial trace. Basis-free; from
expanding the trace, collapsing the I_B Kronecker factor (l = k), and Finset.sum_comm.