Skip to content

Commit ba00271

Browse files
committed
feat(Analysis/Entropy): add quantum relative entropy
1 parent 8b07558 commit ba00271

4 files changed

Lines changed: 169 additions & 3 deletions

File tree

TNLean/Analysis/Entropy.lean

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ the basic quantum entropy infrastructure needed for MPDO / RFP applications.
2020
## Main definitions
2121
2222
* `vonNeumannEntropy`: `S(ρ) = ∑ᵢ negMulLog(λᵢ)` where `λᵢ` are eigenvalues
23+
* `quantumRelativeEntropy`: `D(ρ‖σ) = Re tr(ρ(log ρ - log σ))`
2324
* `traceA_ABC`, `traceC_ABC`, `traceAC_ABC`: tripartite partial traces
2425
* `mutualInformation`: `I(A:B) = S(ρ_A) + S(ρ_B) - S(ρ_AB)`
2526
* `IsSSAEquality`: predicate for equality in strong subadditivity
@@ -143,6 +144,64 @@ theorem vonNeumannEntropy_eq_neg_trace_mul_log
143144
rw [htr, ← Finset.sum_neg_distrib]
144145
exact Finset.sum_congr rfl fun i _ => by simp only [Real.negMulLog]; ring
145146

147+
open scoped Matrix.Norms.L2Operator in
148+
/-- **Quantum relative entropy**, in trace-log form.
149+
150+
For matrices `ρ` and `σ` of the same finite dimension, this is the totalized
151+
trace-log expression
152+
`D(ρ‖σ) = Re tr(ρ · (log ρ - log σ))`, where the logarithm is `CFC.log`.
153+
When `ρ` is a density matrix and `σ` is positive definite, this is the usual
154+
finite-dimensional Umegaki relative entropy.
155+
156+
The definition is total because Mathlib's `CFC.log` is total. The physical
157+
relative entropy domain is the positive semidefinite / positive definite one;
158+
outside that domain this declaration is only the algebraic trace-log expression.
159+
160+
Source: standard; blueprint `def:quantum_relative_entropy`. -/
161+
noncomputable def quantumRelativeEntropy
162+
(ρ σ : Matrix n n ℂ) : ℝ :=
163+
(Matrix.trace (ρ * (CFC.log ρ - CFC.log σ))).re
164+
165+
open scoped Matrix.Norms.L2Operator in
166+
/-- The trace-log form of relative entropy split into its two trace terms. -/
167+
theorem quantumRelativeEntropy_eq_trace_mul_log_sub
168+
(ρ σ : Matrix n n ℂ) :
169+
quantumRelativeEntropy ρ σ
170+
= (Matrix.trace (ρ * CFC.log ρ)).re
171+
- (Matrix.trace (ρ * CFC.log σ)).re := by
172+
simp [quantumRelativeEntropy, Matrix.mul_sub, Matrix.trace_sub]
173+
174+
open scoped Matrix.Norms.L2Operator in
175+
/-- A matrix has zero relative entropy with itself. -/
176+
@[simp] theorem quantumRelativeEntropy_self
177+
(ρ : Matrix n n ℂ) :
178+
quantumRelativeEntropy ρ ρ = 0 := by
179+
simp [quantumRelativeEntropy]
180+
181+
open scoped Matrix.Norms.L2Operator in
182+
/-- The zero left input has zero trace-log relative entropy. -/
183+
@[simp] theorem quantumRelativeEntropy_zero_left
184+
(σ : Matrix n n ℂ) :
185+
quantumRelativeEntropy 0 σ = 0 := by
186+
simp [quantumRelativeEntropy]
187+
188+
open scoped Matrix.Norms.L2Operator in
189+
/-- Relative entropy rewritten using the von Neumann entropy of the first
190+
argument.
191+
192+
For Hermitian `ρ`,
193+
`D(ρ‖σ) = -S(ρ) - Re tr(ρ log σ)`. This is the representation used when
194+
relating the trace-log relative-entropy layer to the eigenvalue definition of
195+
von Neumann entropy. -/
196+
theorem quantumRelativeEntropy_eq_neg_entropy_sub_trace_mul_log
197+
{ρ σ : Matrix n n ℂ} (hρ : ρ.IsHermitian) :
198+
quantumRelativeEntropy ρ σ
199+
= -vonNeumannEntropy ρ hρ - (Matrix.trace (ρ * CFC.log σ)).re := by
200+
rw [quantumRelativeEntropy_eq_trace_mul_log_sub]
201+
have htrace : (Matrix.trace (ρ * CFC.log ρ)).re = -vonNeumannEntropy ρ hρ := by
202+
linarith [vonNeumannEntropy_eq_neg_trace_mul_log hρ]
203+
rw [htrace]
204+
146205
/-- The von Neumann entropy depends only on the characteristic polynomial: it is
147206
the `negMulLog`-sum of the (real parts of the) roots of `charpoly`. -/
148207
theorem vonNeumannEntropy_eq_charpoly_roots (ρ : Matrix n n ℂ) (hρ : ρ.IsHermitian) :
@@ -337,7 +396,8 @@ theorem vonNeumannEntropy_le_log_rank
337396
rw [hLHS] at hJensen
338397
-- `k⁻¹ · S ≤ negMulLog(k⁻¹) = k⁻¹ · log k`, multiply by `k`
339398
have hrhs : (k : ℝ) * Real.negMulLog ((k : ℝ)⁻¹) = Real.log k := by
340-
rw [Real.negMulLog, Real.log_inv, neg_mul_neg, ← mul_assoc, mul_inv_cancel₀ hkR.ne', one_mul]
399+
rw [Real.negMulLog, Real.log_inv, neg_mul_neg, ← mul_assoc,
400+
mul_inv_cancel₀ hkR.ne', one_mul]
341401
have hlhs : (k : ℝ) * ((k : ℝ)⁻¹ * vonNeumannEntropy ρ hρ.isHermitian)
342402
= vonNeumannEntropy ρ hρ.isHermitian := by
343403
rw [← mul_assoc, mul_inv_cancel₀ hkR.ne', one_mul]

TNLean/Entropy/StrongSubadditivity.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ no duplicate axiomatization of SSA is introduced.
4545
4646
Replace the sanctioned axiom `_root_.strong_subadditivity` (in
4747
`TNLean/Axioms/Entropy.lean`) with a proof along the classical route:
48-
1. Define quantum relative entropy `D(ρ‖σ) = tr(ρ(log ρ − log σ))`.
48+
1. Use `Entropy.quantumRelativeEntropy`, the trace-log relative entropy
49+
`D(ρ‖σ) = Re tr(ρ(log ρ − log σ))`.
4950
2. Establish Klein's inequality: `D(ρ‖σ) ≥ 0` for density matrices.
5051
3. Lieb's joint concavity of `(A, B) ↦ tr(Kᴴ Aᵗ K B^{1-t})`.
5152
4. Monotonicity of the relative entropy under partial trace

TNLean/Entropy/VonNeumann.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ with trivial unfolding `@[simp]` lemmas.
3434
* `Entropy.vonNeumannEntropy_le_log_dim` — alias of
3535
`_root_.vonNeumannEntropy_le_log_dim`: `S(ρ) ≤ log D` for density
3636
matrices on a `D`-dimensional system.
37+
* `Entropy.quantumRelativeEntropy` — alias of
38+
`_root_.quantumRelativeEntropy`, the trace-log relative entropy
39+
`D(ρ‖σ) = Re tr(ρ(log ρ - log σ))`.
3740
3841
The aliases are definitionally equal to their `_root_` targets, so the
3942
two spellings are interchangeable in tactics; in particular no
@@ -75,4 +78,27 @@ alias vonNeumannEntropy_nonneg := _root_.vonNeumannEntropy_nonneg
7578
`_root_.vonNeumannEntropy_le_log_dim`. -/
7679
alias vonNeumannEntropy_le_log_dim := _root_.vonNeumannEntropy_le_log_dim
7780

81+
/-- **Quantum relative entropy**, namespaced alias of
82+
`_root_.quantumRelativeEntropy`. -/
83+
noncomputable alias quantumRelativeEntropy := _root_.quantumRelativeEntropy
84+
85+
/-- Trace-log splitting formula for quantum relative entropy, namespaced alias
86+
of `_root_.quantumRelativeEntropy_eq_trace_mul_log_sub`. -/
87+
alias quantumRelativeEntropy_eq_trace_mul_log_sub :=
88+
_root_.quantumRelativeEntropy_eq_trace_mul_log_sub
89+
90+
/-- A matrix has zero relative entropy with itself, namespaced alias of
91+
`_root_.quantumRelativeEntropy_self`. -/
92+
alias quantumRelativeEntropy_self := _root_.quantumRelativeEntropy_self
93+
94+
/-- The zero left input has zero trace-log relative entropy, namespaced alias of
95+
`_root_.quantumRelativeEntropy_zero_left`. -/
96+
alias quantumRelativeEntropy_zero_left := _root_.quantumRelativeEntropy_zero_left
97+
98+
/-- Relative entropy rewritten using the von Neumann entropy of the first
99+
argument, namespaced alias of
100+
`_root_.quantumRelativeEntropy_eq_neg_entropy_sub_trace_mul_log`. -/
101+
alias quantumRelativeEntropy_eq_neg_entropy_sub_trace_mul_log :=
102+
_root_.quantumRelativeEntropy_eq_neg_entropy_sub_trace_mul_log
103+
78104
end Entropy

blueprint/src/chapter/ch19_entropy.tex

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,84 @@ \section{Von Neumann entropy}
177177
standard expression $S(\rho) = -\operatorname{tr}(\rho\log\rho)$.
178178
\end{remark}
179179

180+
\begin{definition}[Quantum relative entropy]\label{def:quantum_relative_entropy}
181+
\lean{quantumRelativeEntropy}
182+
\leanok
183+
For matrices $\rho,\sigma\in \MN{D}$, define the trace-log expression
184+
\[
185+
D(\rho\Vert\sigma)
186+
= \operatorname{Re}\operatorname{tr}\bigl(\rho(\log\rho-\log\sigma)\bigr).
187+
\]
188+
On the physical domain where $\rho$ is a density matrix and $\sigma$ is
189+
positive definite, this is the Umegaki relative entropy.
190+
\end{definition}
191+
192+
\begin{lemma}[Trace-log splitting for relative entropy]
193+
\label{lem:quantum_relative_entropy_trace_split}
194+
\lean{quantumRelativeEntropy_eq_trace_mul_log_sub}
195+
\leanok
196+
\uses{def:quantum_relative_entropy}
197+
For matrices $\rho,\sigma\in \MN{D}$,
198+
\[
199+
D(\rho\Vert\sigma)
200+
= \operatorname{Re}\operatorname{tr}(\rho\log\rho)
201+
- \operatorname{Re}\operatorname{tr}(\rho\log\sigma).
202+
\]
203+
\end{lemma}
204+
205+
\begin{proof}\leanok
206+
Expand the matrix product over the difference $\log\rho-\log\sigma$ and use
207+
linearity of the trace and of the real part.
208+
\end{proof}
209+
210+
\begin{lemma}[Relative entropy with identical arguments]
211+
\label{lem:quantum_relative_entropy_self}
212+
\lean{quantumRelativeEntropy_self}
213+
\leanok
214+
\uses{def:quantum_relative_entropy}
215+
For every matrix $\rho\in \MN{D}$,
216+
\[
217+
D(\rho\Vert\rho)=0.
218+
\]
219+
\end{lemma}
220+
221+
\begin{proof}\leanok
222+
The logarithmic difference $\log\rho-\log\rho$ vanishes.
223+
\end{proof}
224+
225+
\begin{lemma}[Relative entropy with zero first argument]
226+
\label{lem:quantum_relative_entropy_zero_left}
227+
\lean{quantumRelativeEntropy_zero_left}
228+
\leanok
229+
\uses{def:quantum_relative_entropy}
230+
For every matrix $\sigma\in \MN{D}$,
231+
\[
232+
D(0\Vert\sigma)=0.
233+
\]
234+
\end{lemma}
235+
236+
\begin{proof}\leanok
237+
The trace-log expression is multiplied on the left by the zero matrix.
238+
\end{proof}
239+
240+
\begin{theorem}[Relative entropy in entropy form]
241+
\label{thm:quantum_relative_entropy_entropy_form}
242+
\lean{quantumRelativeEntropy_eq_neg_entropy_sub_trace_mul_log}
243+
\leanok
244+
\uses{def:quantum_relative_entropy, thm:entropy_eq_neg_trace_mul_log}
245+
If $\rho$ is Hermitian, then
246+
\[
247+
D(\rho\Vert\sigma)
248+
= -S(\rho)-\operatorname{Re}\operatorname{tr}(\rho\log\sigma).
249+
\]
250+
\end{theorem}
251+
252+
\begin{proof}\leanok
253+
Split the definition of $D(\rho\Vert\sigma)$ into its two trace terms and
254+
replace the first term by $-S(\rho)$ using the trace-logarithm form of the
255+
von Neumann entropy.
256+
\end{proof}
257+
180258
\begin{theorem}[Entropy is invariant under reindexing]
181259
\label{thm:entropy_submatrix_equiv}
182260
\lean{vonNeumannEntropy_submatrix_equiv}
@@ -398,7 +476,8 @@ \section{Entropy formulations}
398476
standard entropy literature and supply the entropy-theoretic input for the
399477
later MPDO arguments.
400478

401-
\begin{definition}[Entropy formulation of von Neumann entropy]\label{def:entropy_von_neumann_entropy}
479+
\begin{definition}[Entropy formulation of von Neumann entropy]
480+
\label{def:entropy_von_neumann_entropy}
402481
\lean{Entropy.vonNeumannEntropy}
403482
\leanok
404483
\uses{def:von_neumann_entropy}

0 commit comments

Comments
 (0)