Pratik Patil

PosteriorStability.lean

1module23public import SubentropyCertificates.PermutationVariance4public import SubentropyCertificates.OptimalDecisionRule56/-! Proposition 12 for finite classical–quantum ensembles, with arbitrary7finite measurement outcomes and any choice among posterior MAP ties. -/8@[expose] public section9noncomputable section10set_option autoImplicit false11set_option backward.isDefEq.respectTransparency false12open Matrix13open scoped BigOperators ComplexOrder MatrixOrder14namespace SubentropyCertificates.PosteriorStability15open D5.S3.Quantum.Foundation.FiniteStateChannel16open D5.S3.Quantum.Subentropy.ClassicalQuantumGram17open D5.S3.Quantum.Subentropy.GuessingProbability18open SubentropyCertificates.MeasurementPosterior19open SubentropyCertificates.Discrimination20open SubentropyCertificates.ClassicalCurve21open SubentropyCertificates.StrongConcavity22variable {X B Y : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype Y]2324/-- The mean posterior error of the reported labels on positive-mass outcomes. -/25def measurementError (p : X → ℝ) (ρ : X → DensityState B) (F : Y → Matrix B B ℂ)26    (selected : Y → X) : ℝ :=27  ∑ y ∈ Finset.univ.filter (fun y => 0 < outcomeProbability p ρ (F y)),28    outcomeProbability p ρ (F y)*(1-posterior p ρ (F y) (selected y))2930/-- The mean squared Euclidean deviation from the vector v_j(e) in Proposition 12. -/31def posteriorDeviation (m : ℕ) (p : X → ℝ) (ρ : X → DensityState B)32    (F : Y → Matrix B B ℂ) (selected : Y → X) (e : ℝ) : ℝ :=33  ∑ y ∈ Finset.univ.filter (fun y => 0 < outcomeProbability p ρ (F y)),34    outcomeProbability p ρ (F y)*energy (posterior p ρ (F y)-target m (selected y) e)3536/-- Proposition 12 for any finite POVM. This version works for any decision37rule, in particular for every MAP tie-breaking rule. Here n=card X=m+2. -/38theorem measurement_posterior_stability (m : ℕ) (hn : Fintype.card X=m+2)39    (p : X → ℝ) (hp : ∀ x,0 ≤ p x) (hs : ∑ x,p x=1) (ρ : X → DensityState B)40    (F : Y → Matrix B B ℂ) (hF : ∀ y,(F y).PosSemidef) (hsF : ∑ y,F y=1)41    (selected : Y → X) :42    let e := measurementError p ρ F selected43    let gap := phi m e-conditionalSubentropy p hp hs ρ44    posteriorDeviation m p ρ F selected e ≤ (6-4/(Fintype.card X:ℝ))*gap ∧45      (6-4/(Fintype.card X:ℝ))*gap ≤ 6*gap := by46  let q (y : Y) := outcomeProbability p ρ (F y)47  let b (y : Y) := posterior p ρ (F y)48  let S := Finset.univ.filter (fun y => 0 < q y)49  let e := measurementError p ρ F selected50  let gap := phi m e-conditionalSubentropy p hp hs ρ51  let V := posteriorDeviation m p ρ F selected e52  change V ≤ (6-4/(Fintype.card X:ℝ))*gap ∧ (6-4/(Fintype.card X:ℝ))*gap ≤ 6*gap53  have hq y : 0 ≤ q y := outcomeProbability_nonneg p hp ρ (F y) (hF y)54  have hsum : ∑ y : S,q y=1 := by55    rw [Finset.sum_coe_sort]56    dsimp only [S]57    rw [sum_over_positive q hq q (fun _ hz => hz)]58    exact sum_outcomeProbability p hp hs ρ F hsF59  have hpost (y : S) : b y ∈ probabilitySimplex X :=60    posterior_probability p hp ρ (F y) (hF y) (Finset.mem_filter.mp y.property).261  have herr : ∑ y : S,q y*(1-b y (selected y))=e :=62    S.sum_coe_sort (fun y => q y*(1-b y (selected y)))63  have h := classical_posterior_stability m hn (fun y : S => q y) (fun y => hq y)64    hsum (fun y : S => b y) hpost (fun y : S => selected y) e herr65  rw [S.sum_coe_sort (fun y => q y*energy (b y-target m (selected y) e)),66    S.sum_coe_sort (fun y => q y*classicalSubentropy (b y))] at h67  have hcomp : conditionalSubentropy p hp hs ρ ≤ ∑ y ∈ S,q y*classicalSubentropy (b y) :=68    (measurement_posterior_comparison p hp hs ρ F hF hsF).269  have hgap : mu (Fintype.card X)/2*V ≤ gap := h.trans (sub_le_sub_left hcomp _)70  have hd : 2 ≤ Fintype.card X := by omega71  have hk : 0 < mu (Fintype.card X)/2 := by linarith [variance_coefficient_ge_sixth hd]72  have hV : 0 ≤ V := Finset.sum_nonneg fun y _ => mul_nonneg (hq y)73    (Finset.sum_nonneg fun x _ => sq_nonneg _)74  have hg : 0 ≤ gap := le_trans (mul_nonneg hk.le hV) hgap75  constructor76  · rw [← inverse_variance_coefficient hd,inv_mul_eq_div]77    apply (le_div_iff₀ hk).mpr78    simpa only [mul_comm] using hgap79  · apply mul_le_mul_of_nonneg_right _ hg80    exact sub_le_self _ (by positivity)8182/-- Every optimal finite guessing measurement, with any posterior MAP rule83on positive-probability outcomes. Optimality means that some decision rule84on this measurement attains the operational optimum. -/85theorem optimal_posterior_stability (m : ℕ) (hn : Fintype.card X=m+2)86    (p : X → ℝ) (hp : ∀ x,0 ≤ p x) (hs : ∑ x,p x=1) (ρ : X → DensityState B)87    (F : Y → Matrix B B ℂ) (hF : ∀ y,(F y).PosSemidef) (hsF : ∑ y,F y=1)88    (selected : Y → X) (hMAP : ∀ y,0 < outcomeProbability p ρ (F y) →89      ∀ x,posterior p ρ (F y) x ≤ posterior p ρ (F y) (selected y))90    (hopt : ∃ rule : Y → X,decisionSuccess p ρ F rule=pGuess p ρ) :91    let e := 1-pGuess p ρ92    let gap := phi m e-conditionalSubentropy p hp hs ρ93    measurementError p ρ F selected=e ∧94      posteriorDeviation m p ρ F selected e ≤ (6-4/(Fintype.card X:ℝ))*gap ∧95      (6-4/(Fintype.card X:ℝ))*gap ≤ 6*gap := by96  have he : measurementError p ρ F selected = 1-pGuess p ρ :=97    (posterior_average_error p hp hs ρ F hF hsF selected).trans98      (congrArg (fun s : ℝ => 1-s) (map_rule_optimal p hp hs ρ F hF hsF selected hMAP hopt))99  exact ⟨he,he ▸ measurement_posterior_stability m hn p hp hs ρ F hF hsF selected⟩100101/-- An optimal labelled POVM exists, and the two stability inequalities102hold there with the true minimum error. -/103theorem exists_optimal_povm_stability (m : ℕ) (hn : Fintype.card X=m+2)104    (p : X → ℝ) (hp : ∀ x,0 ≤ p x) (hs : ∑ x,p x=1) (ρ : X → DensityState B) :105    let e := 1-pGuess p ρ106    let gap := phi m e-conditionalSubentropy p hp hs ρ107    ∃ M : X → Matrix B B ℂ, (∀ x,(M x).PosSemidef) ∧ ∑ x,M x=1 ∧108      successProbability p ρ M=pGuess p ρ ∧109      (∀ y,0 < outcomeProbability p ρ (M y) → ∀ x,posterior p ρ (M y) x ≤ posterior p ρ (M y) y) ∧110      measurementError p ρ M id=e ∧111      posteriorDeviation m p ρ M id e ≤ (6-4/(Fintype.card X:ℝ))*gap ∧112      (6-4/(Fintype.card X:ℝ))*gap ≤ 6*gap := by113  obtain ⟨M,hM,hsM,hopt⟩ := exists_optimal_povm p hp hs ρ114  have he : measurementError p ρ M id = 1-pGuess p ρ :=115    (posterior_average_error p hp hs ρ M hM hsM id).trans (congrArg (fun s : ℝ => 1-s) hopt)116  exact ⟨M,hM,hsM,hopt,optimal_rule_is_map p hp hs ρ M hM hsM id hopt,he,117    he ▸ measurement_posterior_stability m hn p hp hs ρ M hM hsM id⟩118119end SubentropyCertificates.PosteriorStability

Axioms used

Choose a statement to see which axioms its proof uses.