OptimalDecisionRule.lean
1module23public import SubentropyCertificates.GuessingAttainment45/-! A finite measurement with a decision rule is a labelled guessing6measurement after merging outcomes. This identifies its operational7success with an element of the set defining pGuess. -/8@[expose] public section9noncomputable section10set_option autoImplicit false11open Matrix12open scoped BigOperators ComplexOrder MatrixOrder13namespace SubentropyCertificates.PosteriorStability14open D5.S3.Quantum.Foundation.FiniteStateChannel15open D5.S3.Quantum.Subentropy.GuessingProbability16open SubentropyCertificates.MeasurementPosterior17open SubentropyCertificates.Discrimination18variable {X B Y : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype Y]1920/-- Every decision rule on arbitrary finite outcomes gives a feasible21labelled guessing POVM. -/22theorem decisionSuccess_le_pGuess (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x,p x=1)23 (ρ : X → DensityState B) (F : Y → Matrix B B ℂ)24 (hF : ∀ y,(F y).PosSemidef) (hsF : ∑ y,F y=1) (selected : Y → X) :25 decisionSuccess p ρ F selected ≤ pGuess p ρ := by26 let M (x : X) := ∑ y,if selected y=x then F y else 027 have hM (x : X) : (M x).PosSemidef := by28 apply Matrix.posSemidef_sum29 intro y _30 split_ifs <;> first | exact hF y | exact Matrix.PosSemidef.zero31 have hsum : ∑ x,M x=1 := by simpa [M,Finset.sum_comm (s := (Finset.univ : Finset X))] using hsF32 apply le_csSup (pGuess_bounds p hp hs ρ).2.133 refine ⟨M,hM,hsum,?_⟩34 unfold successProbability decisionSuccess jointProbability35 simp only [M,Matrix.sum_mul,Matrix.trace_sum,Complex.re_sum,Finset.mul_sum]36 rw [Finset.sum_comm (s := (Finset.univ : Finset X))]37 apply Finset.sum_congr rfl38 intro y _39 symm40 rw [Finset.sum_eq_single (selected y)]41 · simp42 · intro x _ hx43 simp [Ne.symm hx]44 · simp4546/-- If some rule attains the quantum optimum for a given POVM, then47every posterior MAP choice on its positive-probability outcomes attains it. -/48theorem map_rule_optimal (p : X → ℝ) (hp : ∀ x,0 ≤ p x) (hs : ∑ x,p x=1)49 (ρ : X → DensityState B) (F : Y → Matrix B B ℂ)50 (hF : ∀ y,(F y).PosSemidef) (hsF : ∑ y,F y=1) (selected : Y → X)51 (hMAP : ∀ y,0 < outcomeProbability p ρ (F y) →52 ∀ x, posterior p ρ (F y) x ≤ posterior p ρ (F y) (selected y))53 (hopt : ∃ rule : Y → X,decisionSuccess p ρ F rule = pGuess p ρ) :54 decisionSuccess p ρ F selected = pGuess p ρ := by55 refine le_antisymm (decisionSuccess_le_pGuess p hp hs ρ F hF hsF selected) ?_56 obtain ⟨rule,hr⟩ := hopt57 rw [← hr]58 apply Finset.sum_le_sum59 intro y _60 rw [← weighted_posterior p hp ρ _ (hF y),← weighted_posterior p hp ρ _ (hF y)]61 have hq := outcomeProbability_nonneg p hp ρ (F y) (hF y)62 rcases hq.eq_or_lt with hz | hpos63 · simp [← hz]64 · exact mul_le_mul_of_nonneg_left (hMAP y hpos (rule y)) hq6566/-- On every positive-mass outcome an optimal rule actually reports a67MAP label. In particular this holds for identity reporting at an optimal68labelled guessing POVM. -/69theorem optimal_rule_is_map (p : X → ℝ) (hp : ∀ x,0 ≤ p x) (hs : ∑ x,p x=1)70 (ρ : X → DensityState B) (F : Y → Matrix B B ℂ) (hF : ∀ y,(F y).PosSemidef)71 (hsF : ∑ y,F y=1) (rule : Y → X) (hr : decisionSuccess p ρ F rule = pGuess p ρ)72 (y : Y) (hy : 0 < outcomeProbability p ρ (F y)) (x : X) :73 posterior p ρ (F y) x ≤ posterior p ρ (F y) (rule y) := by74 classical75 let changeAt (z : Y) := if z=y then x else rule z76 have h := decisionSuccess_le_pGuess p hp hs ρ F hF hsF changeAt77 rw [← hr] at h78 unfold decisionSuccess at h79 rw [← Finset.sum_erase_add _ _ (Finset.mem_univ y),80 ← Finset.sum_erase_add _ (fun z => jointProbability p ρ (F z) (rule z)) (Finset.mem_univ y)] at h81 have same : ∑ z ∈ Finset.univ.erase y,jointProbability p ρ (F z) (changeAt z) =82 ∑ z ∈ Finset.univ.erase y,jointProbability p ρ (F z) (rule z) := by83 apply Finset.sum_congr rfl84 intro z hz85 simp [changeAt,(Finset.mem_erase.mp hz).1]86 rw [same,add_le_add_iff_left] at h87 have hj : jointProbability p ρ (F y) x ≤ jointProbability p ρ (F y) (rule y) := by88 simpa [changeAt] using h89 exact div_le_div_of_nonneg_right hj hy.le9091end SubentropyCertificates.PosteriorStability
Axioms used
Choose a statement to see which axioms its proof uses.