module public import SubentropyCertificates.CalibratedDefinitions import all SubentropyCertificates.MarginalEigenbasisTable /-! Convexity of the pinching gain after tensoring with an independent ancillary state. -/ @[expose] public section noncomputable section open Matrix open scoped BigOperators ComplexOrder MatrixOrder Kronecker namespace SubentropyCertificates.AncillaCalibration open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (density_posSemidef) open D5.S3.Quantum.Subentropy.Basic (matrixSubentropy) open D5.S3.Quantum.Subentropy.ClassicalQuantumGram (blockPinch) open D5.S3.Quantum.Subentropy.PinchingGap (actual_pinching_gap_laws) open SubentropyCertificates.BinarySpectra (densityMatrix) variable {X B C : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype C] [DecidableEq C] /-- Tensoring with a fixed density is affine and leaves the label register unchanged. Thus pinching the enlarged matrix gives a nonnegative gain convex in the original matrix. -/ theorem calibrated_gap_laws (ν : DensityState C) (i₀ : X × (B × C)) : ConvexOn ℝ {G : Matrix (X × B) (X × B) ℂ | G.PosSemidef ∧ G.trace = 1} (calibratedGap ν) ∧ ∀ G : Matrix (X × B) (X × B) ℂ, G.PosSemidef → G.trace = 1 → 0 ≤ calibratedGap ν G := by let e := (Equiv.prodAssoc X B C).symm let extend (G : Matrix (X × B) (X × B) ℂ) := (G ⊗ₖ densityMatrix ν).submatrix e e let gain (H : Matrix (X × (B × C)) (X × (B × C)) ℂ) := matrixSubentropy (blockPinch H) - matrixSubentropy H have hstate (G : Matrix (X × B) (X × B) ℂ) (hG : G.PosSemidef) (ht : G.trace = 1) : (extend G).PosSemidef ∧ (extend G).trace = 1 := by refine ⟨(hG.kronecker (density_posSemidef ν)).submatrix e, ?_⟩ rw [show (extend G).trace = (G ⊗ₖ densityMatrix ν).trace from QubitDeficit.reindex_trace _ e, Matrix.trace_kronecker, ht, one_mul] exact ν.2.2 have hgain (G : Matrix (X × B) (X × B) ℂ) : gain (extend G) = calibratedGap ν G := by have hpinch : blockPinch (extend G) = extend (blockPinch G) := by ext ⟨x,b,c⟩ ⟨y,d,f⟩ change (if x = y then G (x,b) (y,d) * densityMatrix ν c f else 0) = (if x = y then G (x,b) (y,d) else 0) * densityMatrix ν c f by_cases h : x = y <;> simp [h] simp only [gain, hpinch, extend, QubitDeficit.reindex_subentropy, calibratedGap] constructor · refine ⟨(actual_pinching_gap_laws (i₀.1, i₀.2.1)).1.1, ?_⟩ intro A hA B' hB a b ha hb hab have h := (actual_pinching_gap_laws i₀).1.2 (hstate A hA.1 hA.2) (hstate B' hB.1 hB.2) ha hb hab change gain (a • extend A + b • extend B') ≤ a • gain (extend A) + b • gain (extend B') at h have hlin : extend (a • A + b • B') = a • extend A + b • extend B' := by simp only [extend, Matrix.add_kronecker, Matrix.smul_kronecker, Matrix.submatrix_add, Matrix.submatrix_smul] rfl simpa only [← hlin, hgain] using h · intro G hG ht rw [← hgain] exact (actual_pinching_gap_laws i₀).2 _ (hstate G hG ht).1 (hstate G hG ht).2 end SubentropyCertificates.AncillaCalibration