module public import SubentropyCertificates.CalibratedConcavity public import SubentropyCertificates.MatrixStrongConcavity import all SubentropyCertificates.MixedSegmentRank /-! Strict concavity of matrix subentropy and of the label functional for any ancillary state. -/ @[expose] public section noncomputable section set_option backward.isDefEq.respectTransparency false open Matrix Set open scoped BigOperators MatrixOrder ComplexOrder Kronecker namespace SubentropyCertificates.AncillaCalibration open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (density_posSemidef partialTraceRight partialTraceRight_kronecker) open D5.S3.Quantum.Subentropy.Basic (matrixSubentropy) open SubentropyCertificates.BinarySpectra (densityMatrix) open SubentropyCertificates.ClassicalCurve open SubentropyCertificates.ConditionalContinuity (hsSquared_nonneg_eq_zero) open SubentropyCertificates.StrongConcavity /-- Matrix subentropy is strictly concave on all density matrices, including the boundary. -/ theorem matrixSubentropy_strictConcave {D : Type*} [Fintype D] [DecidableEq D] : StrictConcaveOn ℝ {M : Matrix D D ℂ | M.PosSemidef ∧ M.trace = 1} matrixSubentropy := by constructor · intro M hM N hN a b ha hb hab refine ⟨(hM.1.smul ha).add (hN.1.smul hb), ?_⟩ simp only [trace_add, trace_smul, hM.2, hN.2, ← add_smul, hab, one_smul] intro M hM N hN hne a b ha hb hab have hd : 2 ≤ Fintype.card D := by by_contra! hc have : Subsingleton D := Fintype.card_le_one_iff_subsingleton.mp (by omega) have entry (P : Matrix D D ℂ) (ht : P.trace = 1) (i : D) : P i i = 1 := by change ∑ j, P j j = 1 at ht rwa [Finset.sum_eq_single i (fun j _ hj ↦ (hj (Subsingleton.elim j i)).elim) (fun h ↦ (h (Finset.mem_univ i)).elim)] at ht apply hne ext i j rw [Subsingleton.elim j i, entry M hM.2, entry N hN.2] let T := a • M + b • N have hc := matrix_strong_concavity hd ![a, b] (by intro i; fin_cases i <;> simp [ha.le, hb.le]) (by simpa only [Fin.sum_univ_two, Matrix.cons_val_zero, Matrix.cons_val_one] using hab) ![M, N] (by intro i; fin_cases i <;> simp [hM.1, hN.1]) (by intro i; fin_cases i <;> simp [hM.2, hN.2]) simp only [Fin.sum_univ_two, Matrix.cons_val_zero, Matrix.cons_val_one] at hc change mu (Fintype.card D) / 2 * (a * hsSquared (M - T) + b * hsSquared (N - T)) ≤ matrixSubentropy T - (a * matrixSubentropy M + b * matrixSubentropy N) at hc have hvar : 0 < a * hsSquared (M - T) + b * hsSquared (N - T) := by have h₁ := hsSquared_nonneg_eq_zero (M - T) have h₂ := hsSquared_nonneg_eq_zero (N - T) by_cases hMT : M = T · have hNT : N - T ≠ 0 := fun h ↦ hne (hMT.trans (sub_eq_zero.mp h).symm) exact add_pos_of_nonneg_of_pos (mul_nonneg ha.le h₁.1) (mul_pos hb (lt_of_le_of_ne h₂.1 (fun he ↦ hNT (h₂.2 he.symm)))) · exact add_pos_of_pos_of_nonneg (mul_pos ha (lt_of_le_of_ne h₁.1 (fun he ↦ hMT (sub_eq_zero.mp (h₁.2 he.symm))))) (mul_nonneg hb.le h₂.1) have hcoef : 0 < mu (Fintype.card D) / 2 := by linarith [mu_ge_third hd] exact sub_pos.mp ((mul_pos hcoef hvar).trans_le hc) /-- Strict concavity of the calibrated functional for every ancillary density, including singular ones. Taking the partial trace of the product records the original label probabilities. -/ theorem calibratedSubentropy_strictConcave {X C : Type*} [Fintype X] [DecidableEq X] [Fintype C] [DecidableEq C] (ν : DensityState C) : StrictConcaveOn ℝ (probabilitySimplex X) (calibratedSubentropy ν) := by let D (p : X → ℝ) := (diagonal fun x ↦ (p x : ℂ)) ⊗ₖ densityMatrix ν have ht : (densityMatrix ν).trace = 1 := ν.2.2 have hD {p : X → ℝ} (hp : p ∈ probabilitySimplex X) : (D p).PosSemidef ∧ (D p).trace = 1 := by have hd := diagonal_density hp exact ⟨hd.1.kronecker (density_posSemidef ν), (trace_kronecker _ _).trans (by rw [hd.2, ht, mul_one])⟩ have hinj : Function.Injective D := by intro p q he have recover (r : X → ℝ) : partialTraceRight (D r) = diagonal fun x ↦ (r x : ℂ) := (partialTraceRight_kronecker (diagonal fun x ↦ (r x : ℂ)) (densityMatrix ν)).trans (by rw [ht, one_smul]) have h := (recover p).symm.trans ((congrArg partialTraceRight he).trans (recover q)) funext i simpa using congrArg (fun M : Matrix X X ℂ ↦ (M i i).re) h refine ⟨simplex_convex X, ?_⟩ intro p hp q hq hpq a b ha hb hab have h := matrixSubentropy_strictConcave.2 (hD hp) (hD hq) (hinj.ne hpq) ha hb hab have hd : D (a • p + b • q) = a • D p + b • D q := by simp only [D, Pi.add_apply, Pi.smul_apply, smul_eq_mul, diagonal_affine, add_kronecker, smul_kronecker] change a * (matrixSubentropy (D p) - _) + b * (matrixSubentropy (D q) - _) < matrixSubentropy (D (a • p + b • q)) - matrixSubentropy (densityMatrix ν) rw [hd] change a * matrixSubentropy (D p) + b * matrixSubentropy (D q) < _ at h linarith only [h, congrArg (fun t : ℝ ↦ t * matrixSubentropy (densityMatrix ν)) hab] end SubentropyCertificates.AncillaCalibration