module public import SubentropyCertificates.CalibratedGram import all SubentropyCertificates.MarginalEigenbasisTable import all D5.S3.Quantum.Subentropy.ClassicalQuantumGram /-! The extended conditional subentropy as a difference for the original joint and average states. -/ @[expose] public section noncomputable section open Matrix open scoped Kronecker BigOperators namespace SubentropyCertificates.AncillaLimit open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (productState) open D5.S3.Quantum.Information.OrthogonalRecordEntropy (recordState mixtureState) open D5.S3.Quantum.Subentropy.ClassicalQuantumGram (conditionalSubentropy record_entries) open D5.S3.Quantum.Subentropy.Basic (matrixSubentropy) open SubentropyCertificates.BinarySpectra (densityMatrix) open SubentropyCertificates.ConditionalContinuity (ancillaBlocks sum_ancillaBlocks) /-- Regrouping the joint state lets both subentropies use a single ancillary tensor factor. -/ theorem conditional_product_eq_state_difference {X B C : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype C] [DecidableEq C] (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B) (ν : DensityState C) : conditionalSubentropy p hp hs (fun x ↦ productState (ρ x) ν) = matrixSubentropy (densityMatrix (recordState p hp hs ρ) ⊗ₖ densityMatrix ν) - matrixSubentropy (densityMatrix (mixtureState p hp hs ρ) ⊗ₖ densityMatrix ν) := by let σ := fun x ↦ productState (ρ x) ν let e := (Equiv.prodAssoc X B C).symm have hrec : densityMatrix (recordState p hp hs σ) = ((densityMatrix (recordState p hp hs ρ)) ⊗ₖ densityMatrix ν).submatrix e e := by ext ⟨x,b,c⟩ ⟨y,d,j⟩ change _ = densityMatrix (recordState p hp hs ρ) (x,b) (y,d) * densityMatrix ν c j rw [show densityMatrix (recordState p hp hs σ) (x,b,c) (y,d,j) = _ from record_entries p hp hs σ (x,b,c) (y,d,j), show densityMatrix (recordState p hp hs ρ) (x,b) (y,d) = _ from record_entries p hp hs ρ (x,b) (y,d)] by_cases h : x = y · subst y simp only [ite_true] exact (mul_assoc (p x : ℂ) (densityMatrix (ρ x) b d) (densityMatrix ν c j)).symm · simp [h] have hmix : densityMatrix (mixtureState p hp hs σ) = densityMatrix (mixtureState p hp hs ρ) ⊗ₖ densityMatrix ν := by change (∑ x, p x • (densityMatrix (ρ x) ⊗ₖ densityMatrix ν)) = (∑ x, p x • densityMatrix (ρ x)) ⊗ₖ densityMatrix ν rw [← sum_ancillaBlocks] simp only [ancillaBlocks, smul_kronecker] change matrixSubentropy (densityMatrix (recordState p hp hs σ)) - matrixSubentropy (densityMatrix (mixtureState p hp hs σ)) = _ rw [hrec, QubitDeficit.reindex_subentropy, hmix] end SubentropyCertificates.AncillaLimit