Partial trace

Mathlib has no matrix partial trace, so the corpus built one -- the staple operation of quantum information, staged for upstreaming with its API proved.

proved in corpus · proved here, no imported axiomsLean partialTraceRight

In plain terms

Here is the problem, and it is the formal-methods reader's problem more than the physicist's. Ignoring part of a quantum system -- tracing out the environment, keeping the subsystem -- is the single most common operation in quantum information. Ask what a library of formalised mathematics offers for it, and until recently the answer for Lean's Mathlib was: nothing at the matrix level.

The corpus's staging tree fills the gap: the partial trace over either tensor factor, with the lemmas one actually needs -- linearity, trace preservation, positivity preservation, the reduced state of a density matrix being a density matrix, and the defining identities pairing a joint operator against one-sided observables.

Category-one infrastructure: nothing CSD-specific anywhere in it, built to be given away.

In CSD

The partial trace is load-bearing across the corpus: reduced states in the decoherence and einselection tiers, marginals of the composite field arena -- where local observations on entangled points are exactly reduced-state expectations -- and the entropy tier's subadditivity arguments all consume it.

A small library-hygiene story attaches: the defining reduced-trace identities were originally proved in the entropy module, and when the entangled-weights work needed them without the entropy stack they were rehomed beside the definition -- the rule that the defining property of an operation lives with the operation.

Mathematically

partialTraceRight and partialTraceLeft on Matrix (n x m) (n x m), with: bundled linearity; trace preservation; Kronecker reduction, the trace of the traced-out factor scaling the survivor; Hermiticity and positivity preservation via tensor witness vectors; density-to-density; and the reduced-trace identities Tr(M (X (x) I)) = Tr(Tr_B M X) and its mirror. All foundational-triple-only.

Module
CsdLean4/Mathlib/QuantumInfo/PartialTrace.lean
Related
quantum channel, von neumann entropy, entropy subadditivity, kronecker product
Referenced
Wikipedia

Source links are pinned to a commit, so they do not drift. The anchors above are checked mechanically against the Lean tree on every build. The mathematics is not, and cannot be: that is a human responsibility and it rests with the author.

Part of Constraint-Surface Dynamics · Formalised in csd-lean4.

Privacy policy