CommutingGuessing.lean
1module23public import SubentropyCertificates.OptimalDecisionRule45/-! Guessing a commuting ensemble by reading its common eigenbasis. -/6@[expose] public section7noncomputable section8open Matrix9open scoped BigOperators ComplexOrder MatrixOrder10namespace SubentropyCertificates.CommutingGuessing11open D5.S3.Quantum.Foundation.FiniteStateChannel12open D5.S3.Quantum.Subentropy.GuessingProbability13open SubentropyCertificates.Discrimination SubentropyCertificates.MeasurementPosterior14open SubentropyCertificates.PosteriorStability1516variable {X B : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B]1718omit [Fintype X] [DecidableEq X] in19/-- The diagonal entries of an arbitrary measurement effect suffice for its joint probabilities. -/20theorem joint_of_diagonal (p : X → ℝ) (ρ : X → DensityState B) (T : X → B → ℝ)21 (hw : ∀ x, p x • CStarMatrix.ofMatrix.symm (ρ x).1 = diagonal (fun i ↦ (T x i : ℂ)))22 (M : Matrix B B ℂ) (x : X) :23 jointProbability p ρ M x = ∑ i, (M i i).re * T x i := by24 unfold jointProbability25 calc26 _ = (trace (M * (p x • CStarMatrix.ofMatrix.symm (ρ x).1))).re := by27 simp [Matrix.trace_smul, Complex.real_smul, Complex.mul_re]28 _ = _ := by29 rw [hw]30 simp [Matrix.trace, Matrix.mul_diagonal, Complex.re_sum, Complex.mul_re]3132/-- For a diagonal ensemble, guessing a label that maximizes each column is optimal over all33quantum measurements. -/34theorem basis_guessing_optimal (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x=1)35 (ρ : X → DensityState B) (T : X → B → ℝ)36 (hw : ∀ x, p x • CStarMatrix.ofMatrix.symm (ρ x).1 = diagonal (fun i ↦ (T x i : ℂ)))37 (select : B → X) (best : ∀ i x, T x i ≤ T (select i) i) :38 pGuess p ρ = ∑ i, T (select i) i := by39 let F (i : B) : Matrix B B ℂ := diagonal (fun j ↦ if j=i then 1 else 0)40 have hF (i : B) : (F i).PosSemidef := by41 apply Matrix.PosSemidef.diagonal42 intro j43 by_cases h : j = i <;> simp [h]44 have hsum : ∑ i, F i = 1 := by45 ext j k46 by_cases hj : j=k47 · subst k48 simp [F,Matrix.sum_apply]49 · simp [F,Matrix.sum_apply,hj]50 apply le_antisymm51 · obtain ⟨M,hM,hms,hopt⟩ := exists_optimal_povm p hp hs ρ52 rw [← hopt]53 change ∑ x, jointProbability p ρ (M x) x ≤ _54 simp_rw [joint_of_diagonal p ρ T hw]55 rw [Finset.sum_comm]56 apply Finset.sum_le_sum57 intro i _58 have hz (x : X) : 0 ≤ (M x i i).re := (RCLike.nonneg_iff.mp (hM x).diag_nonneg).159 have hone := congrArg (fun A : Matrix B B ℂ ↦ (A i i).re) hms60 simp only [Matrix.sum_apply, Complex.re_sum, Matrix.one_apply_eq, Complex.one_re] at hone61 calc62 _ ≤ ∑ x, (M x i i).re * T (select i) i := Finset.sum_le_sum63 (fun x _ ↦ mul_le_mul_of_nonneg_left (best i x) (hz x))64 _ = T (select i) i := by rw [← Finset.sum_mul, hone, one_mul]65 · have hc := decisionSuccess_le_pGuess p hp hs ρ F hF hsum select66 unfold decisionSuccess at hc67 simp_rw [joint_of_diagonal p ρ T hw] at hc68 simpa [F, apply_ite, ite_mul] using hc6970end SubentropyCertificates.CommutingGuessing
Axioms used
Choose a statement to see which axioms its proof uses.