EqualPriorSubentropy.lean
1module2public import SubentropyCertificates.EqualPriorSpectra3public import D5.S3.Quantum.Subentropy.SpectralFormula45/-! Section 6.2, eq:binary_example, from the exact spectra of the classical6record and the average signal state. -/7@[expose] public section8noncomputable section9set_option autoImplicit false10set_option backward.isDefEq.respectTransparency false11open Matrix Set MeasureTheory12open scoped BigOperators ComplexOrder MatrixOrder13namespace SubentropyCertificates.BinarySpectra14open SubentropyCertificates.ClassicalCurve15open SubentropyCertificates.Helstrom16open SubentropyCertificates.PinchingEquality17open D5.S3.Quantum.Foundation.FiniteStateChannel18open D5.S3.Quantum.Information.PartialTraceMutualInformation19open D5.S3.Quantum.Information.OrthogonalRecordEntropy20open D5.S3.Quantum.Subentropy.Basic21open D5.S3.Quantum.Subentropy.ClassicalQuantumGram22open D5.S3.Quantum.Subentropy.GuessingProbability23variable {D : Type*} [Fintype D] [DecidableEq D]2425private theorem diagonal_hermitian (a b : ℝ) : (diagonal ![(a:ℂ),(b:ℂ)]).IsHermitian := by26 apply Matrix.isHermitian_diagonal_of_self_adjoint27 ext i28 fin_cases i <;> simp2930private theorem pair_subentropy (u : ℝ) :31 matrixSubentropy (diagonal ![((1-u:ℝ):ℂ),(u:ℂ)]) = phi 0 u := by32 have h : ![((1-u:ℝ):ℂ),(u:ℂ)] = fun i => ((![1-u,u] i : ℝ) : ℂ) := by33 funext i; fin_cases i <;> rfl34 rw [h]35 unfold phi classicalSubentropy matrixSubentropy36 apply setIntegral_congr_fun measurableSet_Ioi37 intro t ht38 rw [kernel_diagonal _ t ht.ne',kernel_diagonal _ t ht.ne']39 simp [extremalVector,Fin.prod_univ_two,Fintype.prod_option]4041private theorem phi_half : phi 0 (1/2) = Real.log 2-1/2 := by42 have h := phi_uniform_endpoint 043 norm_num [uniformError,harmonic_succ,harmonic_zero] at h44 linarith4546/-- Conditional subentropy is the uniform binary value minus the binary47curve at (1-s)/2, throughout the closed overlap interval. The equal-prior48Helstrom error is included as in the same display in the paper. -/49theorem equal_prior_conditional_subentropy (v w : D → ℂ) (hv : amplitude v v=1)50 (hw : amplitude w w=1) :51 let ρ := purePair v w hv hw52 let s := ‖amplitude v w‖53 conditionalSubentropy halfPrior halfPrior_nonneg halfPrior_sum ρ =54 Real.log 2-1/2-phi 0 ((1-s)/2) ∧55 1-pGuess halfPrior ρ = (1-Real.sqrt (1-s^2))/2 := by56 let ρ := purePair v w hv hw57 let J := recordState halfPrior halfPrior_nonneg halfPrior_sum ρ58 let A := mixtureState halfPrior halfPrior_nonneg halfPrior_sum ρ59 let s := ‖amplitude v w‖60 let u := (1-s)/261 obtain ⟨hJ,hA⟩ := equal_prior_spectra v w hv hw62 have hhalf : 1-(1/2:ℝ) = 1/2 := by norm_num63 have hplus : 1-u = (1+s)/2 := by dsimp [u]; ring64 have hj : subentropy J = phi 0 (1/2) := by65 rw [← pair_subentropy,hhalf]66 apply subentropy_eq_of_nonzeroSpectrum (density_posSemidef J).isHermitian (diagonal_hermitian _ _)67 rw [diagonal_pair_spectrum]68 change nonzeroSpectrum (densityMatrix J) = _69 rw [show nonzeroSpectrum (densityMatrix J) = _ from hJ]70 norm_num71 symm72 apply Multiset.filter_eq_self.mpr73 intro z hz74 obtain rfl := Multiset.mem_singleton.mp hz75 norm_num76 have ha : subentropy A = phi 0 u := by77 rw [← pair_subentropy,hplus]78 apply subentropy_eq_of_nonzeroSpectrum (density_posSemidef A).isHermitian (diagonal_hermitian _ _)79 rw [diagonal_pair_spectrum]80 exact hA81 constructor82 · change subentropy J-subentropy A = _83 rw [hj,ha,phi_half]84 · have h := (binary_pure_quadratic_exact (p := 1/2) (by constructor <;> norm_num)85 v w hv hw).2.2.186 convert h using 187 ring_nf8889theorem conditional_at_orthogonal (v w : D → ℂ) (hv : amplitude v v=1)90 (hw : amplitude w w=1) (h : amplitude v w=0) :91 conditionalSubentropy halfPrior halfPrior_nonneg halfPrior_sum (purePair v w hv hw) = 0 := by92 rw [(equal_prior_conditional_subentropy v w hv hw).1,h,norm_zero,sub_zero,phi_half,sub_self]9394theorem conditional_at_unit_overlap (v w : D → ℂ) (hv : amplitude v v=1)95 (hw : amplitude w w=1) (h : ‖amplitude v w‖=1) :96 conditionalSubentropy halfPrior halfPrior_nonneg halfPrior_sum (purePair v w hv hw) =97 Real.log 2-1/2 := by98 rw [(equal_prior_conditional_subentropy v w hv hw).1,h,sub_self,zero_div,phi_zero,sub_zero]99100/-- Every overlap parameter in the unit interval occurs already for two101qubit signals, including the two endpoints. -/102theorem realize_overlap {s : ℝ} (hs : s ∈ Icc 0 1) :103 ∃ v w : Fin 2 → ℂ, amplitude v v=1 ∧ amplitude w w=1 ∧ ‖amplitude v w‖=s := by104 let v : Fin 2 → ℂ := ![1,0]105 let w : Fin 2 → ℂ := ![(s:ℂ),(Real.sqrt (1-s^2):ℂ)]106 have hr := Real.sq_sqrt (show 0 ≤ 1-s^2 by nlinarith [hs.1,hs.2,mul_nonneg hs.1 (sub_nonneg.mpr hs.2)])107 refine ⟨v,w,?_,?_,?_⟩108 · simp [v,amplitude,dotProduct,Fin.sum_univ_two]109 · have h : s*s+Real.sqrt (1-s^2)*Real.sqrt (1-s^2)=1 := by nlinarith110 simpa [w,amplitude,dotProduct,Fin.sum_univ_two] using congrArg Complex.ofReal h111 · simp [v,w,amplitude,dotProduct,Fin.sum_univ_two,abs_of_nonneg hs.1]112113/-- The elementary logarithmic form of the binary curve on the open114interval, where the two eigenvalues are positive and distinct. -/115theorem binary_curve_log {u : ℝ} (hu : u ∈ Ioo 0 (1/2)) :116 phi 0 u = -((1-u)^2 * Real.log (1-u) - u^2 * Real.log u)/(1-2*u) := by117 let p : Fin 2 → ℝ := ![1-u,u]118 have hp (i : Fin 2) : 0 < p i := by119 fin_cases i <;> simp [p] <;> linarith [hu.1,hu.2]120 have hs : ∑ i, p i = 1 := by simp [p,Fin.sum_univ_two]121 have hi : Function.Injective p := by122 intro i j h123 have hne : 1-u ≠ u := by linarith [hu.2]124 fin_cases i <;> fin_cases j125 · rfl126 · exact (hne h).elim127 · exact (hne h.symm).elim128 · rfl129 have h := D5.S3.Quantum.Subentropy.SpectralFormula.matrixSubentropy_diagonal_eq_distinct_formula p hp hs hi130 have hre : (fun i => (p i : ℂ)) = ![((1-u:ℝ):ℂ),(u:ℂ)] := by131 funext i; fin_cases i <;> rfl132 rw [hre,pair_subentropy] at h133 have h₀ : (Finset.univ : Finset (Fin 2)).erase 0 = {1} := by decide134 have h₁ : (Finset.univ : Finset (Fin 2)).erase 1 = {0} := by decide135 rw [h,Fin.sum_univ_two,h₀,h₁]136 simp only [Finset.prod_singleton,Fintype.card_fin]137 change -((1-u)^2*Real.log (1-u)/(1-u-u) + u^2*Real.log u/(u-(1-u))) = _138 rw [show 1-u-u = 1-2*u by ring,show u-(1-u) = -(1-2*u) by ring,div_neg]139 ring140141/-- For 0 < s < 1 the formula may also be written entirely in terms of142the two spectral values and their logarithms. -/143theorem conditional_overlap_log (v w : D → ℂ) (hv : amplitude v v=1) (hw : amplitude w w=1)144 (hs : ‖amplitude v w‖ ∈ Ioo 0 1) :145 let s := ‖amplitude v w‖146 let a := (1+s)/2147 let b := (1-s)/2148 conditionalSubentropy halfPrior halfPrior_nonneg halfPrior_sum (purePair v w hv hw) =149 Real.log 2-1/2 + (a^2*Real.log a-b^2*Real.log b)/s := by150 dsimp only151 let s := ‖amplitude v w‖152 have hu : (1-s)/2 ∈ Ioo 0 (1/2:ℝ) := by153 constructor <;> dsimp [s] <;> linarith [hs.1,hs.2]154 rw [(equal_prior_conditional_subentropy v w hv hw).1,binary_curve_log hu,155 show 1-(1-s)/2 = (1+s)/2 by ring,show 1-2*((1-s)/2) = s by ring]156 ring157158end SubentropyCertificates.BinarySpectra
Axioms used
Choose a statement to see which axioms its proof uses.