Pratik Patil

BinaryPureHelstrom.lean

1module23public import SubentropyCertificates.BinaryHelstrom45/-! Section 6.2, eq:binary-quadratic-exact. All normalized amplitude6vectors and all priors in [0,1] are allowed, with no independence assumption. -/7@[expose] public section8noncomputable section9set_option autoImplicit false10set_option backward.isDefEq.respectTransparency false11open Matrix Set12open scoped BigOperators MatrixOrder ComplexOrder13namespace SubentropyCertificates.Helstrom14open SubentropyCertificates.PinchingEquality15open SubentropyCertificates.Discrimination16open D5.S3.Quantum.Foundation.FiniteStateChannel17open D5.S3.Quantum.Information.InputInformationBalance18open SubentropyCertificates.Quadratic19open D5.S3.Quantum.Subentropy.GuessingProbability20variable {D : Type*} [Fintype D] [DecidableEq D]2122private theorem inverse_binary (c : ℝ) : inverse 0 c = (1-Real.sqrt (1-4*c))/2 := by23  rw [inverse_formula]24  norm_num25  ring2627/-- The purity-difference statistic, its inverse lower bound, the optimal28binary error and the trace norm of the Helstrom difference for pure signals. -/29theorem binary_pure_quadratic_exact {p : ℝ} (hp : p ∈ Icc 0 1) (v w : D → ℂ)30    (hv : ∑ i, star (v i)*v i=1) (hw : ∑ i, star (w i)*w i=1) :31    let ρ := purePair v w hv hw32    let s := ‖amplitude v w‖33    let c := statistic (binaryPrior p) (binary_prior_nonneg hp) (binary_prior_sum p) ρ34    let e := 1-pGuess (binaryPrior p) ρ35    c = p*(1-p)*s^2 ∧ inverse 0 c = e ∧36      e = (1-Real.sqrt (1-4*(p*(1-p)*s^2)))/2 ∧37      (∑ i, |(difference_hermitian hp ρ).eigenvalues i|) =38        Real.sqrt (1-4*(p*(1-p)*s^2)) := by39  let ρ := purePair v w hv hw40  let c := p*(1-p)*‖amplitude v w‖^241  let t := ∑ i, |(difference_hermitian hp ρ).eigenvalues i|42  let e := 1-pGuess (binaryPrior p) ρ43  have hstat := binary_pure_statistic hp v w hv hw44  have hlow := (complementary_quadratic_bound 0 (by decide : Fintype.card (Fin 2)=0+2)45    (binaryPrior p) (binary_prior_nonneg hp) (binary_prior_sum p) ρ).1.2.246  change inverse 0 (statistic _ _ _ (purePair v w hv hw)) ≤ e at hlow47  rw [hstat,inverse_binary] at hlow48  have hm := spectral_second_moment (difference_hermitian hp ρ)49  rw [difference_trace, show (difference p ρ * difference p ρ).trace.re = _ from50    difference_second_moment p v w hv hw] at hm51  have hdisc : 1-4*c ≤ t^2 := by52    change 2*(p^2+(1-p)^2-2*c) ≤ t^2+(2*p-1)^2 at hm53    nlinarith54  have ht : 0 ≤ t := Finset.sum_nonneg fun _ _ => abs_nonneg _55  have hroot := Real.sqrt_le_iff.mpr ⟨ht,hdisc⟩56  have hs : pGuess (binaryPrior p) ρ = (1+t)/2 := (binary_helstrom hp ρ).157  have herr : e = (1-Real.sqrt (1-4*c))/2 := by58    apply le_antisymm _ hlow59    dsimp only [e]60    linarith61  refine ⟨hstat,?_,herr,?_⟩62  · change inverse 0 (statistic _ _ _ (purePair v w hv hw)) = e63    rw [hstat,inverse_binary]64    exact herr.symm65  · change t = Real.sqrt (1-4*c)66    dsimp only [e] at herr67    linarith6869/-- At unit overlap the states agree up to phase and the error is the70smaller prior, including the tie at p=1/2. -/71theorem unit_overlap_error {p : ℝ} (hp : p ∈ Icc 0 1) (v w : D → ℂ)72    (hv : ∑ i, star (v i)*v i=1) (hw : ∑ i, star (w i)*w i=1) (h : ‖amplitude v w‖=1) :73    1-pGuess (binaryPrior p) (purePair v w hv hw) = min p (1-p) := by74  rw [(binary_pure_quadratic_exact hp v w hv hw).2.2.1,h]75  rw [show 1-4*(p*(1-p)*(1:ℝ)^2) = (p-(1-p))^2 by ring,Real.sqrt_sq_eq_abs]76  rcases le_total p (1-p) with hl | hl77  · rw [abs_of_nonpos (sub_nonpos.mpr hl),min_eq_left hl]; ring78  · rw [abs_of_nonneg (sub_nonneg.mpr hl),min_eq_right hl]; ring7980theorem zero_prior_errors (v w : D → ℂ) (hv : ∑ i, star (v i)*v i=1)81    (hw : ∑ i, star (w i)*w i=1) :82    1-pGuess (binaryPrior 0) (purePair v w hv hw) = 0 ∧83    1-pGuess (binaryPrior 1) (purePair v w hv hw) = 0 := by84  constructor85  · rw [(binary_pure_quadratic_exact (p := 0) (by constructor <;> norm_num) v w hv hw).2.2.1]86    norm_num87  · rw [(binary_pure_quadratic_exact (p := 1) (by constructor <;> norm_num) v w hv hw).2.2.1]88    norm_num8990theorem orthogonal_pure_error {p : ℝ} (hp : p ∈ Icc 0 1) (v w : D → ℂ)91    (hv : ∑ i, star (v i)*v i=1) (hw : ∑ i, star (w i)*w i=1) (h : amplitude v w=0) :92    1-pGuess (binaryPrior p) (purePair v w hv hw) = 0 := by93  rw [(binary_pure_quadratic_exact hp v w hv hw).2.2.1,h]94  norm_num9596theorem identical_pure_error {p : ℝ} (hp : p ∈ Icc 0 1) (v : D → ℂ)97    (hv : ∑ i, star (v i)*v i=1) :98    1-pGuess (binaryPrior p) (purePair v v hv hv) = min p (1-p) := by99  apply unit_overlap_error hp100  rw [show amplitude v v = 1 from hv,norm_one]101102private theorem pure_representation (σ : DensityState D) (hσ : IsPure σ) :103    ∃ (v : D → ℂ) (hv : ∑ i, star (v i)*v i=1), σ = pureSignal v hv := by104  obtain ⟨v,hv⟩ := hσ105  have htr := σ.2.2106  change ∑ i, σ.1 i i = 1 at htr107  simp only [hv] at htr108  have hn : ∑ i, star (v i)*v i=1 := by simpa only [mul_comm] using htr109  refine ⟨v,hn,Subtype.ext ?_⟩110  ext i j111  exact hv i j112113/-- An equivalent statement for bundled pure density states, with no114choice of amplitude or phase in the hypotheses or conclusion. -/115theorem binary_pure_density_exact {p : ℝ} (hp : p ∈ Icc 0 1) (ρ : Fin 2 → DensityState D)116    (hρ : ∀ i, IsPure (ρ i)) :117    let c := statistic (binaryPrior p) (binary_prior_nonneg hp) (binary_prior_sum p) ρ118    let s₂ := ((CStarMatrix.ofMatrix.symm (ρ 0).1) * (CStarMatrix.ofMatrix.symm (ρ 1).1)).trace.re119    c = p*(1-p)*s₂ ∧ inverse 0 c = 1-pGuess (binaryPrior p) ρ ∧120      1-pGuess (binaryPrior p) ρ = (1-Real.sqrt (1-4*(p*(1-p)*s₂)))/2 := by121  obtain ⟨v,hv,h₀⟩ := pure_representation (ρ 0) (hρ 0)122  obtain ⟨w,hw,h₁⟩ := pure_representation (ρ 1) (hρ 1)123  have hpair : ρ = purePair v w hv hw := by124    funext i; fin_cases i <;> first | exact h₀ | exact h₁125  subst ρ126  have h := binary_pure_quadratic_exact hp v w hv hw127  change _ = p*(1-p)*(projector v * projector w).trace.re ∧ _ ∧128    _ = (1-Real.sqrt (1-4*(p*(1-p)*(projector v * projector w).trace.re)))/2129  rw [projector_overlap]130  exact ⟨h.1,h.2.1,h.2.2.1⟩131132end SubentropyCertificates.Helstrom

Axioms used

Choose a statement to see which axioms its proof uses.