module public import SubentropyCertificates.AncillaFactorSpectrum public import SubentropyCertificates.AncillaIntegralLimit public import SubentropyCertificates.AncillaStateDifference /-! The large-ancilla purity limit of Corollary 26. -/ @[expose] public section noncomputable section open Filter Matrix MeasureTheory Set open scoped Topology BigOperators Kronecker ComplexOrder MatrixOrder namespace SubentropyCertificates.AncillaLimit open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (density_posSemidef productState) open D5.S3.Quantum.Information.OrthogonalRecordEntropy (recordState mixtureState) open D5.S3.Quantum.Subentropy.Basic (matrixSubentropy) open D5.S3.Quantum.Subentropy.ClassicalQuantumGram (conditionalSubentropy) open SubentropyCertificates.BinarySpectra (densityMatrix) open SubentropyCertificates.Representations (determinantIntegrand reciprocal_determinant_integral) open SubentropyCertificates.SpectralContinuity (maximallyMixed) open SubentropyCertificates.Quadratic (purity statistic) private theorem spectrum_sum_one {D : Type*} [Fintype D] [DecidableEq D] (σ : DensityState D) : ∑ i, (density_posSemidef σ).isHermitian.eigenvalues i = 1 := by have h := congrArg Complex.re (density_posSemidef σ).isHermitian.trace_eq_sum_eigenvalues.symm have ht : (densityMatrix σ).trace = 1 := σ.2.2 simpa [densityMatrix] using h.trans (congrArg Complex.re ht) private theorem tensor_subentropy_representation {D : Type*} [Fintype D] [DecidableEq D] (σ : DensityState D) (k : ℕ) : let M := densityMatrix σ ⊗ₖ densityMatrix (maximallyMixed (Fin (k + 1))) IntegrableOn (determinantIntegrand M) (Ioi 0) ∧ matrixSubentropy M = ∫ t in Ioi (0 : ℝ), determinantIntegrand M t := by let ν := maximallyMixed (Fin (k + 1)) apply reciprocal_determinant_integral _ ((density_posSemidef σ).kronecker (density_posSemidef ν)) rw [Matrix.trace_kronecker, show (densityMatrix σ).trace = 1 from σ.2.2, show (densityMatrix ν).trace = 1 from ν.2.2, mul_one] /-- For any two density matrices, even of different dimensions, tensoring both with I/K identifies their scaled subentropy difference in the limit with half the purity difference. -/ theorem replicated_state_difference_tendsto {D E : Type*} [Fintype D] [DecidableEq D] [Fintype E] [DecidableEq E] (R : DensityState D) (A : DensityState E) : Tendsto (fun k : ℕ ↦ ((k + 1 : ℕ) : ℝ) * (matrixSubentropy (densityMatrix R ⊗ₖ densityMatrix (maximallyMixed (Fin (k + 1)))) - matrixSubentropy (densityMatrix A ⊗ₖ densityMatrix (maximallyMixed (Fin (k + 1)))))) atTop (𝓝 ((purity A - purity R) / 2)) := by let w := (density_posSemidef A).isHermitian.eigenvalues let v := (density_posSemidef R).isHermitian.eigenvalues have h := replicated_difference_integral_tendsto w v (density_posSemidef A).eigenvalues_nonneg (density_posSemidef R).eigenvalues_nonneg (spectrum_sum_one A) (spectrum_sum_one R) change Tendsto _ atTop (𝓝 (((∑ i, (density_posSemidef A).isHermitian.eigenvalues i ^ 2) - ∑ i, (density_posSemidef R).isHermitian.eigenvalues i ^ 2) / 2)) at h rw [sum_eigenvalues_sq_eq_purity A, sum_eigenvalues_sq_eq_purity R] at h apply h.congr' (.of_forall fun k ↦ ?_) have hR := tensor_subentropy_representation R k have hA := tensor_subentropy_representation A k rw [hR.2, hA.2, ← integral_sub hR.1 hA.1, ← integral_const_mul] apply setIntegral_congr_fun measurableSet_Ioi intro t _ dsimp only rw [determinantIntegrand_replicated (densityMatrix R) (density_posSemidef R) k t, determinantIntegrand_replicated (densityMatrix A) (density_posSemidef A) k t] dsimp only [w, v] ring /-- For every finite CQ ensemble, the ancilla dimension times the extended conditional subentropy tends to the ensemble's quadratic statistic. The dimension ranges over k+1. -/ theorem uniform_ancilla_conditional_tendsto {X B : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B) : Tendsto (fun k : ℕ ↦ ((k + 1 : ℕ) : ℝ) * conditionalSubentropy p hp hs (fun x ↦ productState (ρ x) (maximallyMixed (Fin (k + 1))))) atTop (𝓝 (statistic p hp hs ρ)) := by simp_rw [conditional_product_eq_state_difference] exact replicated_state_difference_tendsto (recordState p hp hs ρ) (mixtureState p hp hs ρ) end SubentropyCertificates.AncillaLimit