module public import SubentropyCertificates.CalibratedTensorGram import all SubentropyCertificates.MarginalEigenbasisTable /-! The calibrated pinching gap on a pure Gram component. The block-column factorization follows the proof of pure_block_pinching in the pinned ClassicalQuantumGram module. Tensor Gram conversion retains the ancillary state. -/ @[expose] public section noncomputable section set_option backward.isDefEq.respectTransparency false open Matrix open scoped BigOperators Kronecker namespace SubentropyCertificates.AncillaCalibration open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Subentropy.Basic (matrixSubentropy) open D5.S3.Quantum.Subentropy.ClassicalQuantumGram (blockPinch) open SubentropyCertificates.BinarySpectra (densityMatrix) open SubentropyCertificates.PinchingEquality (amplitude projector) open SubentropyCertificates.MeasurementPosterior (labelMass) open SubentropyCertificates.QubitDeficit (reindex_subentropy) variable {X B C D : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype C] [DecidableEq C] [Fintype D] [DecidableEq D] private theorem pure_tensor_subentropy (ν : DensityState C) (v : D → ℂ) (hv : amplitude v v = 1) : matrixSubentropy (projector v ⊗ₖ densityMatrix ν) = matrixSubentropy (densityMatrix ν) := by let V : Matrix D Unit ℂ := fun d _ ↦ v d have hl : V.conjTranspose * V = 1 := by ext ⟨⟩ ⟨⟩ simpa only [Matrix.mul_apply, Matrix.conjTranspose_apply, one_apply_eq, V, amplitude, dotProduct, Pi.star_apply] using hv have hr : V * V.conjTranspose = projector v := by ext i j simp [V, Matrix.mul_apply, Matrix.conjTranspose_apply, projector, vecMulVec_apply] let e := Equiv.uniqueProd C Unit have he : (1 : Matrix Unit Unit ℂ) ⊗ₖ densityMatrix ν = (densityMatrix ν).submatrix e e := by ext ⟨⟨⟩,i⟩ ⟨⟨⟩,j⟩ change (1 : Matrix Unit Unit ℂ) () () * densityMatrix ν i j = densityMatrix ν i j simp rw [← hr, ← calibrated_rectangular_gram ν V, hl, he, reindex_subentropy] /-- On a pure Gram component the conditional increase equals the calibrated subentropy of its label masses. The ancillary state may have any rank, and block masses may vanish. -/ theorem calibrated_gap_projector (ν : DensityState C) (v : X × B → ℂ) (hv : amplitude v v = 1) : calibratedGap ν (projector v) = calibratedSubentropy ν (labelMass (projector v)) := by let W : Matrix (X × B) X ℂ := fun i x ↦ if i.1 = x then v i else 0 have hm (x : X) : labelMass (projector v) x = ∑ b, Complex.normSq (v (x,b)) := by simp only [labelMass, projector, vecMulVec_apply, Pi.star_apply, Complex.star_def, Complex.mul_conj, Complex.re_sum, Complex.ofReal_re] have hl : W.conjTranspose * W = diagonal (fun x ↦ (labelMass (projector v) x : ℂ)) := by ext x y by_cases h : x = y · subst y rw [diagonal_apply_eq, hm] simp [W, Matrix.mul_apply, Matrix.conjTranspose_apply, Fintype.sum_prod_type, Complex.normSq_eq_conj_mul_self] · simp [W, Matrix.mul_apply, Matrix.conjTranspose_apply, Fintype.sum_prod_type, h, eq_comm] have hr : W * W.conjTranspose = blockPinch (projector v) := by ext i j by_cases h : i.1 = j.1 · simp [W, Matrix.mul_apply, Matrix.conjTranspose_apply, blockPinch, projector, h, vecMulVec] · simp [W, Matrix.mul_apply, Matrix.conjTranspose_apply, blockPinch, h, eq_comm] rw [calibratedGap, calibratedSubentropy, pure_tensor_subentropy ν v hv, ← hr, ← calibrated_rectangular_gram ν W, hl] end SubentropyCertificates.AncillaCalibration