/- Copyright (c) 2026 Marcel Morgenstern. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Marcel Morgenstern -/ module public import OperatorEntropy.Petz.Support /-! # Petz's theorem under the support condition only Compression to supports: for a state `σ` let `V_σ : ℂ^{supp σ} → ℂⁿ` be the isometry onto the support of `σ` (`DensityMatrix.suppIso`). For `ρ ≼ σ` (`ρ.SupportLE σ`) the compressed states `V_σᴴ ρ V_σ`, `V_σᴴ σ V_σ` live on `supp σ`, where `σ` is faithful; a channel `Λ` compresses to a channel `Λ.compress σ` from `supp σ` to `supp Λσ` (Kraus operators `V_{Λσ}ᴴ Kᵢ V_σ`, trace preserving because `Kᵢ` maps `supp σ` into `supp Λσ`), under which `Λσ` is faithful. Relative entropies (`relEntropy_isometryConj`) and the Petz map (`petz_compress`) are transported along the isometries, so the faithful-reference Petz theorem gives the general one: * `petz_equality_recovery` — `ρ ≼ σ` and `D(Λρ‖Λσ) = D(ρ‖σ)` imply `petz σ Λ (Λρ) = ρ`; * `relEntropy_eq_of_petz_recovery` — `ρ ≼ σ` and `petz σ Λ (Λρ) = ρ` imply `D(Λρ‖Λσ) = D(ρ‖σ)`; * `petz_recovery_iff` — Petz's theorem: for every channel `Λ : M_n → M_m` and states with `ρ ≼ σ`, `petz σ Λ (Λρ) = ρ ↔ D(Λρ‖Λσ) = D(ρ‖σ)`; * `petz_recovery_iff_supportLE_and_relEntropy_eq` — the same for all states: `petz σ Λ (Λρ) = ρ ↔ ρ ≼ σ ∧ D(Λρ‖Λσ) = D(ρ‖σ)` (`DensityMatrix.supportLE_of_petz_eq`); * `petz_recovery` — `petz σ Λ (Λσ) = σ` for every state `σ`. -/ @[expose] public section open Matrix open scoped ComplexOrder MatrixOrder noncomputable section namespace OperatorEntropy variable {n m : Type*} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] /-! ## The support isometry of a state -/ /-- The index set of the support of `σ`: eigenvalue indices with nonzero eigenvalue. -/ def DensityMatrix.Supp (σ : DensityMatrix n) := {i : n // σ.eig i ≠ 0} noncomputable instance (σ : DensityMatrix n) : Fintype σ.Supp := by unfold DensityMatrix.Supp; classical exact inferInstance instance (σ : DensityMatrix n) : DecidableEq σ.Supp := by unfold DensityMatrix.Supp; exact inferInstance /-- The isometry `V_σ` onto the support of `σ` (the eigenvectors with nonzero eigenvalue). -/ def DensityMatrix.suppIso (σ : DensityMatrix n) : Matrix n σ.Supp ℂ := Matrix.of fun k s => σ.eigVec k s.1 /-- The (positive) eigenvalues of `σ` on its support, as a diagonal matrix. -/ def DensityMatrix.suppDiag (σ : DensityMatrix n) : Matrix σ.Supp σ.Supp ℂ := diagonal fun s => (σ.eig s.1 : ℂ) theorem DensityMatrix.suppIso_isometry (σ : DensityMatrix n) : σ.suppIsoᴴ * σ.suppIso = 1 := by have hU : star σ.eigVec * σ.eigVec = 1 := by unfold DensityMatrix.eigVec; exact Unitary.coe_star_mul_self _ ext s t have := congrFun (congrFun hU s.1) t.1 simp only [Matrix.mul_apply, Matrix.star_apply, Matrix.one_apply] at this simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, DensityMatrix.suppIso, Matrix.of_apply, Matrix.one_apply, this] exact if_congr Subtype.ext_iff.symm rfl rfl theorem DensityMatrix.suppDiag_posDef (σ : DensityMatrix n) : σ.suppDiag.PosDef := by rw [DensityMatrix.suppDiag, Matrix.posDef_diagonal_iff] intro s have h := lt_of_le_of_ne (σ.eigenvalues_nonneg s.1) (Ne.symm s.2) exact_mod_cast h theorem DensityMatrix.val_eq_suppIso (σ : DensityMatrix n) : σ.val = σ.suppIso * σ.suppDiag * σ.suppIsoᴴ := by conv_lhs => rw [σ.val_eq_spectral] ext k l rw [Matrix.mul_apply, Matrix.mul_apply] simp only [Matrix.mul_diagonal, Matrix.star_apply, Matrix.conjTranspose_apply, DensityMatrix.suppIso, DensityMatrix.suppDiag, Matrix.of_apply] rw [← Fintype.sum_subtype_add_sum_subtype (fun i => σ.eig i ≠ 0)] have h0 : ∑ i : {i // ¬ σ.eig i ≠ 0}, σ.eigVec k i.1 * (σ.eig i.1 : ℂ) * star (σ.eigVec l i.1) = 0 := Finset.sum_eq_zero fun i _ => by have : σ.eig i.1 = 0 := not_not.mp i.2 simp [this] rw [h0, add_zero] rfl /-- `σ (1 − V_σ V_σᴴ) = 0`. -/ theorem DensityMatrix.mul_one_sub_suppProj (σ : DensityMatrix n) : σ.val * (1 - σ.suppIso * σ.suppIsoᴴ) = 0 := by rw [σ.val_eq_suppIso, Matrix.mul_sub, Matrix.mul_one] calc σ.suppIso * σ.suppDiag * σ.suppIsoᴴ - σ.suppIso * σ.suppDiag * σ.suppIsoᴴ * (σ.suppIso * σ.suppIsoᴴ) = σ.suppIso * σ.suppDiag * σ.suppIsoᴴ - σ.suppIso * σ.suppDiag * (σ.suppIsoᴴ * σ.suppIso) * σ.suppIsoᴴ := by simp only [Matrix.mul_assoc] _ = 0 := by rw [σ.suppIso_isometry, Matrix.mul_one, sub_self] /-- A Hermitian `B` with `ker σ ⊆ ker B` is supported in `supp σ`: `B (V V ᴴ) = B`. -/ theorem DensityMatrix.mul_suppProj_of_ker (σ : DensityMatrix n) {B : Matrix n n ℂ} (h : ∀ v, σ.val *ᵥ v = 0 → B *ᵥ v = 0) : B * (σ.suppIso * σ.suppIsoᴴ) = B := by have h1 : B * (1 - σ.suppIso * σ.suppIsoᴴ) = 0 := by refine Matrix.ext_of_mulVec_single fun i => ?_ rw [← Matrix.mulVec_mulVec, h _ (by rw [Matrix.mulVec_mulVec, σ.mul_one_sub_suppProj, Matrix.zero_mulVec]), Matrix.zero_mulVec] rw [Matrix.mul_sub, Matrix.mul_one, sub_eq_zero] at h1 exact h1.symm theorem DensityMatrix.suppProj_isHermitian (σ : DensityMatrix n) : (σ.suppIso * σ.suppIsoᴴ)ᴴ = σ.suppIso * σ.suppIsoᴴ := by rw [Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose] /-- A Hermitian `B` with `ker σ ⊆ ker B` satisfies `B = V (Vᴴ B V) Vᴴ`. -/ theorem DensityMatrix.eq_compress_of_ker (σ : DensityMatrix n) {B : Matrix n n ℂ} (hB : B.IsHermitian) (h : ∀ v, σ.val *ᵥ v = 0 → B *ᵥ v = 0) : B = σ.suppIso * (σ.suppIsoᴴ * B * σ.suppIso) * σ.suppIsoᴴ := by have hR := σ.mul_suppProj_of_ker h have hL : σ.suppIso * σ.suppIsoᴴ * B = B := by have := congrArg Matrix.conjTranspose hR rwa [Matrix.conjTranspose_mul, σ.suppProj_isHermitian, hB.eq] at this calc B = σ.suppIso * σ.suppIsoᴴ * B * (σ.suppIso * σ.suppIsoᴴ) := by rw [hL, hR] _ = _ := by simp only [Matrix.mul_assoc] /-- The compression `V_σᴴ ρ V_σ` of a state `ρ ≼ σ` to the support of `σ`. -/ def DensityMatrix.compress (σ ρ : DensityMatrix n) (h : ρ.SupportLE σ) : DensityMatrix σ.Supp where val := σ.suppIsoᴴ * ρ.val * σ.suppIso posSemidef := ρ.posSemidef.conjTranspose_mul_mul_same _ trace_one := by calc (σ.suppIsoᴴ * ρ.val * σ.suppIso).trace = (σ.suppIso * σ.suppIsoᴴ * ρ.val).trace := by rw [Matrix.trace_mul_comm, Matrix.mul_assoc] _ = (ρ.val * (σ.suppIso * σ.suppIsoᴴ)).trace := Matrix.trace_mul_comm _ _ _ = 1 := by rw [σ.mul_suppProj_of_ker (fun v hv => h v hv), ρ.trace_one] /-- `Vᴴ (V X Vᴴ) V = X` for an isometry `V`. -/ lemma isometry_cancel {p q : Type*} [Fintype p] [Fintype q] [DecidableEq q] (V : Matrix p q ℂ) (hV : Vᴴ * V = 1) (X : Matrix q q ℂ) : Vᴴ * (V * X * Vᴴ) * V = X := by calc Vᴴ * (V * X * Vᴴ) * V = (Vᴴ * V) * X * (Vᴴ * V) := by simp only [Matrix.mul_assoc] _ = X := by rw [hV, Matrix.one_mul, Matrix.mul_one] theorem DensityMatrix.isometryConj_compress (σ ρ : DensityMatrix n) (h : ρ.SupportLE σ) : (σ.compress ρ h).isometryConj σ.suppIso σ.suppIso_isometry = ρ := DensityMatrix.ext (σ.eq_compress_of_ker ρ.posSemidef.1 (fun v hv => h v hv)).symm theorem DensityMatrix.compress_self_val (σ : DensityMatrix n) : (σ.compress σ σ.supportLE_refl).val = σ.suppDiag := by change σ.suppIsoᴴ * σ.val * σ.suppIso = _ conv_lhs => rw [σ.val_eq_suppIso] exact isometry_cancel _ σ.suppIso_isometry _ theorem DensityMatrix.compress_self_posDef (σ : DensityMatrix n) : (σ.compress σ σ.supportLE_refl).val.PosDef := by rw [σ.compress_self_val]; exact σ.suppDiag_posDef /-- `V_σᴴ σ = D_σ V_σᴴ`. -/ theorem DensityMatrix.suppIso_conjTranspose_mul (σ : DensityMatrix n) : σ.suppIsoᴴ * σ.val = σ.suppDiag * σ.suppIsoᴴ := by conv_lhs => rw [σ.val_eq_suppIso] rw [← Matrix.mul_assoc, ← Matrix.mul_assoc, σ.suppIso_isometry, Matrix.one_mul] /-! ## Compression of a channel -/ /-- If `Λσ` kills `v`, then `σ` kills `Kᵢᴴ v` for every Kraus operator. -/ theorem KrausChannel.mulVec_adj_eq_zero (Λ : KrausChannel n m) (σ : DensityMatrix n) {v : m → ℂ} (hv : (Λ.toDM σ).val *ᵥ v = 0) (i : Λ.ι) : σ.val *ᵥ ((Λ.K i)ᴴ *ᵥ v) = 0 := by have hterm : ∀ i, star v ⬝ᵥ ((Λ.K i * σ.val * (Λ.K i)ᴴ) *ᵥ v) = star ((Λ.K i)ᴴ *ᵥ v) ⬝ᵥ (σ.val *ᵥ ((Λ.K i)ᴴ *ᵥ v)) := by intro i rw [← Matrix.mulVec_mulVec, ← Matrix.mulVec_mulVec, Matrix.dotProduct_mulVec, Matrix.star_mulVec, Matrix.conjTranspose_conjTranspose] have hnn : ∀ i ∈ Finset.univ, 0 ≤ star ((Λ.K i)ᴴ *ᵥ v) ⬝ᵥ (σ.val *ᵥ ((Λ.K i)ᴴ *ᵥ v)) := fun i _ => σ.posSemidef.dotProduct_mulVec_nonneg _ have hsum : ∑ i, star ((Λ.K i)ᴴ *ᵥ v) ⬝ᵥ (σ.val *ᵥ ((Λ.K i)ᴴ *ᵥ v)) = 0 := by have : star v ⬝ᵥ ((Λ.toDM σ).val *ᵥ v) = 0 := by rw [hv, dotProduct_zero] change star v ⬝ᵥ ((∑ i, Λ.K i * σ.val * (Λ.K i)ᴴ) *ᵥ v) = 0 at this rw [Matrix.sum_mulVec, dotProduct_sum] at this simpa only [hterm] using this exact σ.posSemidef.dotProduct_mulVec_zero_iff.mp ((Finset.sum_eq_zero_iff_of_nonneg hnn).mp hsum i (Finset.mem_univ i)) /-- **Kraus operators map `supp σ` into `supp Λσ`:** `V_{Λσ} V_{Λσ}ᴴ Kᵢ V_σ = Kᵢ V_σ`. -/ theorem KrausChannel.suppProj_mul_K_suppIso (Λ : KrausChannel n m) (σ : DensityMatrix n) (i : Λ.ι) : (Λ.toDM σ).suppIso * (Λ.toDM σ).suppIsoᴴ * Λ.K i * σ.suppIso = Λ.K i * σ.suppIso := by set VQ := (Λ.toDM σ).suppIso set VP := σ.suppIso have hz : VPᴴ * (Λ.K i)ᴴ * (1 - VQ * VQᴴ) = 0 := by refine Matrix.ext_of_mulVec_single fun j => ?_ set u := (1 - VQ * VQᴴ) *ᵥ Pi.single j (1 : ℂ) have hu : (Λ.toDM σ).val *ᵥ u = 0 := by rw [Matrix.mulVec_mulVec, (Λ.toDM σ).mul_one_sub_suppProj, Matrix.zero_mulVec] have hx := Λ.mulVec_adj_eq_zero σ hu i have hD : σ.suppDiag *ᵥ (VPᴴ *ᵥ ((Λ.K i)ᴴ *ᵥ u)) = 0 := by rw [Matrix.mulVec_mulVec, ← σ.suppIso_conjTranspose_mul, ← Matrix.mulVec_mulVec, hx, Matrix.mulVec_zero] have hinj : Function.Injective σ.suppDiag.mulVec := Matrix.mulVec_injective_iff_isUnit.mpr σ.suppDiag_posDef.isUnit have h0 : VPᴴ *ᵥ ((Λ.K i)ᴴ *ᵥ u) = 0 := hinj (by rw [hD, Matrix.mulVec_zero]) rw [Matrix.zero_mulVec, ← Matrix.mulVec_mulVec, ← Matrix.mulVec_mulVec] exact h0 have hz' := congrArg Matrix.conjTranspose hz simp only [Matrix.conjTranspose_mul, Matrix.conjTranspose_sub, Matrix.conjTranspose_one, Matrix.conjTranspose_conjTranspose, Matrix.conjTranspose_zero] at hz' rw [Matrix.sub_mul, Matrix.one_mul, sub_eq_zero] at hz' rw [Matrix.mul_assoc (VQ * VQᴴ) (Λ.K i) VP] exact hz'.symm /-- The **compressed channel** `supp σ → supp Λσ`, Kraus operators `V_{Λσ}ᴴ Kᵢ V_σ`. -/ def KrausChannel.compress (Λ : KrausChannel n m) (σ : DensityMatrix n) : KrausChannel σ.Supp (Λ.toDM σ).Supp where ι := Λ.ι K i := (Λ.toDM σ).suppIsoᴴ * Λ.K i * σ.suppIso htp := by have h : ∀ i, ((Λ.toDM σ).suppIsoᴴ * Λ.K i * σ.suppIso)ᴴ * ((Λ.toDM σ).suppIsoᴴ * Λ.K i * σ.suppIso) = σ.suppIsoᴴ * ((Λ.K i)ᴴ * Λ.K i) * σ.suppIso := fun i => by have hr := Λ.suppProj_mul_K_suppIso σ i have hr' : (Λ.toDM σ).suppIso * ((Λ.toDM σ).suppIsoᴴ * (Λ.K i * σ.suppIso)) = Λ.K i * σ.suppIso := by simpa only [Matrix.mul_assoc] using hr simp only [Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, Matrix.mul_assoc] rw [hr'] simp_rw [h] rw [← Matrix.sum_mul, ← Matrix.mul_sum, Λ.htp, Matrix.mul_one, σ.suppIso_isometry] theorem KrausChannel.compress_toMat (Λ : KrausChannel n m) (σ : DensityMatrix n) (X : Matrix σ.Supp σ.Supp ℂ) : Λ.toMat (σ.suppIso * X * σ.suppIsoᴴ) = (Λ.toDM σ).suppIso * (Λ.compress σ).toMat X * (Λ.toDM σ).suppIsoᴴ := by change _ = (Λ.toDM σ).suppIso * (∑ i, (Λ.toDM σ).suppIsoᴴ * Λ.K i * σ.suppIso * X * ((Λ.toDM σ).suppIsoᴴ * Λ.K i * σ.suppIso)ᴴ) * (Λ.toDM σ).suppIsoᴴ rw [Matrix.mul_sum, Matrix.sum_mul] refine Finset.sum_congr rfl fun i _ => ?_ set VQ := (Λ.toDM σ).suppIso set VP := σ.suppIso have hrA : VQ * VQᴴ * (Λ.K i * VP) = Λ.K i * VP := by rw [← Matrix.mul_assoc]; exact Λ.suppProj_mul_K_suppIso σ i have hrB : (Λ.K i * VP)ᴴ * (VQ * VQᴴ) = (Λ.K i * VP)ᴴ := by have := congrArg Matrix.conjTranspose hrA rwa [Matrix.conjTranspose_mul, (Λ.toDM σ).suppProj_isHermitian] at this have e1 : Λ.K i * (VP * X * VPᴴ) * (Λ.K i)ᴴ = (Λ.K i * VP) * X * (Λ.K i * VP)ᴴ := by simp only [Matrix.conjTranspose_mul, Matrix.mul_assoc] have e2 : VQ * (VQᴴ * Λ.K i * VP * X * (VQᴴ * Λ.K i * VP)ᴴ) * VQᴴ = (VQ * VQᴴ * (Λ.K i * VP)) * X * ((Λ.K i * VP)ᴴ * (VQ * VQᴴ)) := by simp only [Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, Matrix.mul_assoc] rw [e1, e2, hrA, hrB] /-! ## Transport of states, relative entropies and the Petz map -/ theorem KrausChannel.toDM_compress (Λ : KrausChannel n m) {ρ σ : DensityMatrix n} (h : ρ.SupportLE σ) : ((Λ.compress σ).toDM (σ.compress ρ h)).isometryConj (Λ.toDM σ).suppIso (Λ.toDM σ).suppIso_isometry = Λ.toDM ρ := by apply DensityMatrix.ext change (Λ.toDM σ).suppIso * (Λ.compress σ).toMat (σ.compress ρ h).val * (Λ.toDM σ).suppIsoᴴ = Λ.toMat ρ.val rw [← Λ.compress_toMat] congr 1 exact (σ.eq_compress_of_ker ρ.posSemidef.1 (fun v hv => h v hv)).symm /-- Under the compressed channel the compressed `σ` has a faithful image. -/ theorem KrausChannel.compress_toDM_posDef (Λ : KrausChannel n m) (σ : DensityMatrix n) : ((Λ.compress σ).toDM (σ.compress σ σ.supportLE_refl)).val.PosDef := by have e := congrArg DensityMatrix.val (Λ.toDM_compress (σ := σ) σ.supportLE_refl) have hX : ((Λ.compress σ).toDM (σ.compress σ σ.supportLE_refl)).val = (Λ.toDM σ).suppIsoᴴ * (Λ.toDM σ).val * (Λ.toDM σ).suppIso := by rw [← e]; exact (isometry_cancel _ (Λ.toDM σ).suppIso_isometry _).symm rw [hX] exact (Λ.toDM σ).compress_self_posDef theorem relEntropy_compress {ρ σ : DensityMatrix n} (h : ρ.SupportLE σ) : relEntropy (σ.compress ρ h) (σ.compress σ σ.supportLE_refl) = relEntropy ρ σ := by rw [← relEntropy_isometryConj σ.suppIso σ.suppIso_isometry, σ.isometryConj_compress, σ.isometryConj_compress] theorem KrausChannel.relEntropy_toDM_compress (Λ : KrausChannel n m) {ρ σ : DensityMatrix n} (h : ρ.SupportLE σ) : relEntropy ((Λ.compress σ).toDM (σ.compress ρ h)) ((Λ.compress σ).toDM (σ.compress σ σ.supportLE_refl)) = relEntropy (Λ.toDM ρ) (Λ.toDM σ) := by rw [← relEntropy_isometryConj (Λ.toDM σ).suppIso (Λ.toDM σ).suppIso_isometry, Λ.toDM_compress, Λ.toDM_compress] /-- Real powers commute with isometric embeddings: `(V A Vᴴ)^y = V A^y Vᴴ` (`y ≠ 0`). -/ lemma rpow_isometryConj {p q : Type*} [Fintype p] [DecidableEq p] [Fintype q] [DecidableEq q] (V : Matrix p q ℂ) (hV : Vᴴ * V = 1) {A : Matrix q q ℂ} (hA : A.PosSemidef) {y : ℝ} (hy : y ≠ 0) : (V * A * Vᴴ) ^ y = V * A ^ y * Vᴴ := by rw [CFC.rpow_eq_cfc_real (hA.mul_mul_conjTranspose_same V).nonneg, CFC.rpow_eq_cfc_real hA.nonneg, cfc_isometry_conj V hV hA.1 (fun x : ℝ => x ^ y) (Real.zero_rpow hy)] /-- **The Petz map compresses to supports:** `petz σ Λ X = V_σ · petz σ_c Λ_c (V_{Λσ}ᴴ X V_{Λσ}) · V_σᴴ`. -/ theorem KrausChannel.petz_compress (Λ : KrausChannel n m) (σ : DensityMatrix n) (X : Matrix m m ℂ) : petz σ Λ X = σ.suppIso * petz (σ.compress σ σ.supportLE_refl) (Λ.compress σ) ((Λ.toDM σ).suppIsoᴴ * X * (Λ.toDM σ).suppIso) * σ.suppIsoᴴ := by have hσ : σ.val = σ.suppIso * (σ.compress σ σ.supportLE_refl).val * σ.suppIsoᴴ := (congrArg DensityMatrix.val (σ.isometryConj_compress σ σ.supportLE_refl)).symm have hΛσ : (Λ.toDM σ).val = (Λ.toDM σ).suppIso * ((Λ.compress σ).toDM (σ.compress σ σ.supportLE_refl)).val * (Λ.toDM σ).suppIsoᴴ := (congrArg DensityMatrix.val (Λ.toDM_compress (σ := σ) σ.supportLE_refl)).symm have e1 : CFC.sqrt σ.val = σ.suppIso * CFC.sqrt (σ.compress σ σ.supportLE_refl).val * σ.suppIsoᴴ := by rw [CFC.sqrt_eq_rpow, CFC.sqrt_eq_rpow, hσ, rpow_isometryConj _ σ.suppIso_isometry (DensityMatrix.posSemidef _) (by norm_num)] have e2 : (Λ.toDM σ).val ^ (-(1 / 2) : ℝ) = (Λ.toDM σ).suppIso * ((Λ.compress σ).toDM (σ.compress σ σ.supportLE_refl)).val ^ (-(1 / 2) : ℝ) * (Λ.toDM σ).suppIsoᴴ := by rw [hΛσ, rpow_isometryConj _ (Λ.toDM σ).suppIso_isometry (DensityMatrix.posSemidef _) (by norm_num)] rw [petz, petz, e1, e2] simp only [KrausChannel.adj, Matrix.mul_sum, Matrix.sum_mul] refine Finset.sum_congr rfl fun i _ => ?_ simp only [KrausChannel.compress, Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, Matrix.mul_assoc] /-! ## Petz's theorem under the support condition -/ /-- **Equality in the data-processing inequality implies Petz recovery** (support condition only): for every channel `Λ : M_n → M_m` and states with `ρ ≼ σ`, if `D(Λρ‖Λσ) = D(ρ‖σ)` then `petz σ Λ (Λρ) = ρ`. -/ theorem petz_equality_recovery (Λ : KrausChannel n m) {ρ σ : DensityMatrix n} (h : ρ.SupportLE σ) (hEq : relEntropy (Λ.toDM ρ) (Λ.toDM σ) = relEntropy ρ σ) : petz σ Λ (Λ.toDM ρ).val = ρ.val := by have hσc := σ.compress_self_posDef have hΛσc := Λ.compress_toDM_posDef σ have hEqc := hEq rw [← Λ.relEntropy_toDM_compress h, ← relEntropy_compress h, relEntropy_of_posDef _ hΛσc, relEntropy_of_posDef _ hσc, EReal.coe_eq_coe_iff] at hEqc have hrec := petz_equality_recovery_of_faithful_ref (Λ.compress σ) (σ.compress ρ h) (σ.compress σ σ.supportLE_refl) hσc hΛσc hEqc.symm have hX : (Λ.toDM σ).suppIsoᴴ * (Λ.toDM ρ).val * (Λ.toDM σ).suppIso = ((Λ.compress σ).toDM (σ.compress ρ h)).val := by rw [← congrArg DensityMatrix.val (Λ.toDM_compress h)] exact isometry_cancel _ (Λ.toDM σ).suppIso_isometry _ rw [Λ.petz_compress, hX, hrec] exact congrArg DensityMatrix.val (σ.isometryConj_compress ρ h) /-- **Petz recovery implies equality in the data-processing inequality** (support condition only, no faithfulness of `Λσ`). -/ theorem relEntropy_eq_of_petz_recovery (Λ : KrausChannel n m) {ρ σ : DensityMatrix n} (h : ρ.SupportLE σ) (hrec : petz σ Λ (Λ.toDM ρ).val = ρ.val) : relEntropy (Λ.toDM ρ) (Λ.toDM σ) = relEntropy ρ σ := by have hΛσc := Λ.compress_toDM_posDef σ have hX : (Λ.toDM σ).suppIsoᴴ * (Λ.toDM ρ).val * (Λ.toDM σ).suppIso = ((Λ.compress σ).toDM (σ.compress ρ h)).val := by rw [← congrArg DensityMatrix.val (Λ.toDM_compress h)] exact isometry_cancel _ (Λ.toDM σ).suppIso_isometry _ rw [Λ.petz_compress, hX] at hrec have hc : petz (σ.compress σ σ.supportLE_refl) (Λ.compress σ) ((Λ.compress σ).toDM (σ.compress ρ h)).val = (σ.compress ρ h).val := by have := congrArg (fun M => σ.suppIsoᴴ * M * σ.suppIso) hrec rw [isometry_cancel _ σ.suppIso_isometry] at this exact this have := petz_recovery_imp_relEntropy_eq (Λ.compress σ) hΛσc hc rwa [Λ.relEntropy_toDM_compress h, relEntropy_compress h] at this /-- **Petz's theorem.** For every quantum channel `Λ : M_n → M_m` (Kraus form) and states `ρ, σ` with `supp ρ ⊆ supp σ`: the (generalised-inverse) Petz map recovers `ρ` from `Λρ` if and only if the data-processing inequality is saturated, `D(Λρ‖Λσ) = D(ρ‖σ)`. -/ theorem petz_recovery_iff (Λ : KrausChannel n m) {ρ σ : DensityMatrix n} (h : ρ.SupportLE σ) : petz σ Λ (Λ.toDM ρ).val = ρ.val ↔ relEntropy (Λ.toDM ρ) (Λ.toDM σ) = relEntropy ρ σ := ⟨relEntropy_eq_of_petz_recovery Λ h, petz_equality_recovery Λ h⟩ /-- **Petz recovery identity for every state.** For every channel `Λ : M_n → M_m` and every state `σ`, `petz σ Λ (Λσ) = σ`, also when `Λσ` is singular (the Petz map then uses the generalised inverse square root of `Λσ`). The faithful case is `petz_recovery_of_posDef`. -/ theorem petz_recovery (Λ : KrausChannel n m) (σ : DensityMatrix n) : petz σ Λ (Λ.toDM σ).val = σ.val := (petz_recovery_iff Λ σ.supportLE_refl).mpr (by rw [relEntropy_self_eq_zero, relEntropy_self_eq_zero]) /-- The Petz map takes values supported in `supp σ`: if `petz σ Λ X = ρ` for some `X`, then `ρ.SupportLE σ`. -/ theorem DensityMatrix.supportLE_of_petz_eq (Λ : KrausChannel n m) {ρ σ : DensityMatrix n} {X : Matrix m m ℂ} (h : petz σ Λ X = ρ.val) : ρ.SupportLE σ := by intro v hv have hsq : CFC.sqrt σ.val *ᵥ v = 0 := by have h2 : star (CFC.sqrt σ.val *ᵥ v) ⬝ᵥ (CFC.sqrt σ.val *ᵥ v) = 0 := by rw [Matrix.star_mulVec, ← Matrix.dotProduct_mulVec, Matrix.mulVec_mulVec, conjTranspose_cfcSqrt, CFC.sqrt_mul_sqrt_self σ.val σ.posSemidef.nonneg, hv, dotProduct_zero] exact dotProduct_star_self_eq_zero.mp h2 rw [← h, petz, ← Matrix.mulVec_mulVec, hsq, Matrix.mulVec_zero] /-- **Petz's theorem without the support hypothesis.** For every channel `Λ : M_n → M_m` and all states `ρ, σ`: the Petz map recovers `ρ` from `Λρ` if and only if `supp ρ ⊆ supp σ` and `D(Λρ‖Λσ) = D(ρ‖σ)`. (Without `supp ρ ⊆ supp σ` both relative entropies can be `⊤`, e.g. for the identity channel, while the Petz map never recovers `ρ`.) -/ theorem petz_recovery_iff_supportLE_and_relEntropy_eq (Λ : KrausChannel n m) {ρ σ : DensityMatrix n} : petz σ Λ (Λ.toDM ρ).val = ρ.val ↔ ρ.SupportLE σ ∧ relEntropy (Λ.toDM ρ) (Λ.toDM σ) = relEntropy ρ σ := ⟨fun h => ⟨DensityMatrix.supportLE_of_petz_eq Λ h, (petz_recovery_iff Λ (DensityMatrix.supportLE_of_petz_eq Λ h)).mp h⟩, fun h => (petz_recovery_iff Λ h.1).mpr h.2⟩ end OperatorEntropy