module public import SubentropyCertificates.SubadditivityGram public import SubentropyCertificates.MarginalBounds public import SubentropyCertificates.PinchingRank /-! The accepted subadditivity theorem (thm:sa). The inequality is the pinned upstream theorem. Equality is characterized here using the local pinching equality and spectral refinement certificates. -/ @[expose] public section noncomputable section set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Matrix open scoped BigOperators ComplexOrder MatrixOrder namespace SubentropyCertificates.Subadditivity open D5.S3.Quantum.Foundation.FiniteStateChannel open D5.S3.Quantum.Information.PartialTraceMutualInformation open D5.S3.Quantum.Information.InputInformationBalance open D5.S3.Quantum.Subentropy.Basic open D5.S3.Quantum.Subentropy.PinchingGap open D5.S3.Quantum.Subentropy.Subadditivity open SubentropyCertificates.PinchingEquality open SubentropyCertificates.MeasurementPosterior open SubentropyCertificates.ClassicalCurve variable {X B : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] private theorem zero_of_maximal_positive_gain (G : Matrix (X × B) (X × B) ℂ) (i₀ : X × B) (hG : G.PosSemidef) (ht : G.trace = 1) (hpos : 0 < gain G) (hmax : classicalSubentropy (labelMass G) ≤ gain G) : matrixSubentropy G = 0 := by obtain ⟨w, hw, hs, v, hv, hdec, hub⟩ := spectral_refinement G hG ht i₀.1 have hstates i : (projector (v i)).PosSemidef ∧ (projector (v i)).trace = 1 := by refine ⟨Matrix.posSemidef_vecMulVec_self_star _, ?_⟩ change (∑ k, v i k * star (v i k)) = 1 simpa only [amplitude, dotProduct, Pi.star_apply, mul_comm] using hv i have hlo : gain (∑ i, w i • projector (v i)) ≤ ∑ i, w i * gain (projector (v i)) := (actual_pinching_gap_laws i₀).1.map_sum_le (fun i _ => hw i) hs (fun i _ => hstates i) have hg := congrArg gain hdec obtain ⟨u, hu, hproj⟩ := projector_of_positive_gain_equality i₀ w hw hs v hv (hpos.trans_eq hg) (le_antisymm hlo ((hub.trans hmax).trans_eq hg)) rw [hdec.trans hproj] exact matrixSubentropy_pure u hu /-- Subadditivity, with equality exactly when at least one marginal density matrix has rank one. Both marginal operators are the actual partial traces. -/ theorem subadditivity_with_equality (ρ : DensityState (X × B)) : subentropy ρ ≤ subentropy (marginalRight ρ) + subentropy (marginalLeft ρ) ∧ (subentropy ρ = subentropy (marginalRight ρ) + subentropy (marginalLeft ρ) ↔ IsPure (marginalRight ρ) ∨ IsPure (marginalLeft ρ)) := by have hsa := subentropy_subadditive ρ refine ⟨hsa, ?_⟩ rw [← subentropy_zero_iff_pure, ← subentropy_zero_iff_pure] constructor · intro he by_cases hz : subentropy (marginalRight ρ) = 0 · exact Or.inl hz right have hpos := lt_of_le_of_ne (subentropy_nonnegative (marginalRight ρ)) (Ne.symm hz) have hne : Nonempty (X × B) := by by_contra h have : IsEmpty (X × B) := not_nonempty_iff.mp h have ht := ρ.2.2 simp [Matrix.trace] at ht let i₀ := Classical.choice hne obtain ⟨G, hG, ht, hjoint, hleft, hright⟩ := exists_subadditivity_gram ρ i₀ have hmax : classicalSubentropy (labelMass G) ≤ gain G := by unfold gain linarith only [he, hjoint, hleft, hright] rw [← hleft] exact zero_of_maximal_positive_gain G i₀ hG ht ((hpos.trans_eq hright.symm).trans_le hmax) hmax · intro h have hbounds := marginal_subentropy_bounds ρ rcases h with h | h · linarith only [h, hsa, hbounds.1] · linarith only [h, hsa, hbounds.2] end SubentropyCertificates.Subadditivity