BinaryPureStatistic.lean
1module23public import SubentropyCertificates.QuadraticDiscrimination4public import SubentropyCertificates.PinchingGeometry56/-! Exact moments of the weighted difference of two pure-state densities7and the quadratic statistic of their binary ensemble. -/8@[expose] public section9noncomputable section10set_option autoImplicit false11set_option backward.isDefEq.respectTransparency false12open Matrix Set13open scoped BigOperators MatrixOrder ComplexOrder14namespace SubentropyCertificates.Helstrom15open D5.S3.Quantum.Foundation.FiniteStateChannel16open D5.S3.Quantum.Information.PartialTraceMutualInformation17open SubentropyCertificates.Quadratic18open SubentropyCertificates.Discrimination19open SubentropyCertificates.PinchingEquality20variable {D : Type*} [Fintype D] [DecidableEq D]2122def binaryPrior (p : ℝ) : Fin 2 → ℝ := ![p,1-p]2324theorem binary_prior_nonneg {p : ℝ} (hp : p ∈ Icc 0 1) (i : Fin 2) : 0 ≤ binaryPrior p i := by25 fin_cases i <;> simp [binaryPrior,hp.1,sub_nonneg.mpr hp.2]2627theorem binary_prior_sum (p : ℝ) : ∑ i, binaryPrior p i = 1 := by28 simp [binaryPrior,Fin.sum_univ_two]2930def difference (p : ℝ) (ρ : Fin 2 → DensityState D) :=31 weighted (binaryPrior p) ρ 0 - weighted (binaryPrior p) ρ 13233theorem difference_hermitian {p : ℝ} (hp : p ∈ Icc 0 1) (ρ : Fin 2 → DensityState D) :34 (difference p ρ).IsHermitian :=35 ((density_posSemidef (ρ 0)).smul hp.1).isHermitian.sub36 ((density_posSemidef (ρ 1)).smul (sub_nonneg.mpr hp.2)).isHermitian3738theorem difference_trace (p : ℝ) (ρ : Fin 2 → DensityState D) :39 (difference p ρ).trace.re = 2*p-1 := by40 have ht (i : Fin 2) : (CStarMatrix.ofMatrix.symm (ρ i).1).trace = 1 := (ρ i).2.241 simp [difference,weighted,binaryPrior,Matrix.trace_sub,Matrix.trace_smul,ht,Complex.real_smul]42 ring4344def purePair (v w : D → ℂ) (hv : ∑ i, star (v i)*v i=1) (hw : ∑ i, star (w i)*w i=1) :45 Fin 2 → DensityState D := ![pureSignal v hv, pureSignal w hw]4647omit [DecidableEq D] in48theorem projector_overlap (v w : D → ℂ) :49 (projector v * projector w).trace.re = ‖amplitude v w‖^2 := by50 have hstar : v ⬝ᵥ star w = star (amplitude v w) := by51 simp [amplitude,dotProduct,star_sum,mul_comm]52 change (vecMulVec v (star v) * vecMulVec w (star w)).trace.re = _53 rw [Matrix.vecMulVec_mul_vecMulVec,Matrix.trace_vecMulVec,dotProduct_smul,smul_eq_mul,hstar]54 change (amplitude v w * star (amplitude v w)).re = _55 rw [Complex.star_def,Complex.mul_conj,Complex.ofReal_re,Complex.normSq_eq_norm_sq]5657omit [DecidableEq D] in58/-- Weighted projector traces are prior products times squared overlaps. -/59private theorem scaled_overlap (a b : ℝ) (v w : D → ℂ) :60 ((a • projector v)*(b • projector w)).trace.re = a*b*‖amplitude v w‖^2 := by61 rw [Matrix.smul_mul,Matrix.mul_smul,Matrix.trace_smul,Matrix.trace_smul]62 simp only [Complex.smul_re,smul_eq_mul,projector_overlap]63 ring6465theorem binary_pure_statistic {p : ℝ} (hp : p ∈ Icc 0 1) (v w : D → ℂ)66 (hv : ∑ i, star (v i)*v i=1) (hw : ∑ i, star (w i)*w i=1) :67 statistic (binaryPrior p) (binary_prior_nonneg hp) (binary_prior_sum p) (purePair v w hv hw) =68 p*(1-p)*‖amplitude v w‖^2 := by69 rw [statistic_eq_unordered]70 simp only [Fin.sum_univ_two,lt_self_iff_false,Fin.zero_lt_one,not_lt_of_ge (Fin.zero_le 1),71 ite_true,ite_false,zero_add,add_zero]72 exact scaled_overlap p (1-p) v w7374theorem difference_second_moment (p : ℝ) (v w : D → ℂ)75 (hv : ∑ i, star (v i)*v i=1) (hw : ∑ i, star (w i)*w i=1) :76 let H := difference p (purePair v w hv hw)77 (H*H).trace.re = p^2 + (1-p)^2 - 2*(p*(1-p)*‖amplitude v w‖^2) := by78 let A := p • projector v79 let B := (1-p) • projector w80 change ((A-B)*(A-B)).trace.re = _81 rw [Matrix.sub_mul,Matrix.mul_sub,Matrix.mul_sub,Matrix.trace_sub,Matrix.trace_sub,Matrix.trace_sub,82 Matrix.trace_mul_comm B A]83 simp only [Complex.sub_re]84 have hᵥ : amplitude v v = 1 := hv85 have hᵥ' : amplitude w w = 1 := hw86 simp only [A,B,scaled_overlap,hᵥ,hᵥ',norm_one,one_pow,mul_one]87 ring8889end SubentropyCertificates.Helstrom
Axioms used
Choose a statement to see which axioms its proof uses.