Pratik Patil

QuadraticPosterior.lean

1module23public import SubentropyCertificates.QuadraticStatistic4public import SubentropyCertificates.QuadraticCurve5public import SubentropyCertificates.GuessingAttainment67/-! A bound from the measurement posteriors, followed by optimization8over label-valued measurements. Zero-probability outcomes have weight zero. -/9@[expose] public section10noncomputable section11set_option backward.isDefEq.respectTransparency false12open Matrix Set13open scoped BigOperators MatrixOrder ComplexOrder14namespace SubentropyCertificates.Quadratic15open D5.S3.Quantum.Foundation.FiniteStateChannel16open D5.S3.Quantum.Subentropy.ClassicalQuantumGram17open D5.S3.Quantum.Subentropy.GuessingProbability18open SubentropyCertificates.MeasurementPosterior19open SubentropyCertificates.Discrimination20variable {X B Y : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype Y]2122omit [DecidableEq B] in23private theorem one_piece (H : Matrix (X × B) (X × B) ℂ) (hH : H.PosSemidef)24    (hs : mass H = 1) : offSquare H / 2 ≤ collisionGap (labelMass H) := by25  have h := Finset.sum_le_sum (s := distinctPairs X) (fun z _ => blockSquare_le H hH z)26  change offSquare H ≤ ∑ z ∈ distinctPairs X, labelMass H z.1 * labelMass H z.2 at h27  rw [distinct_sum (fun x z => labelMass H x * labelMass H z)] at h28  simp only [← Finset.mul_sum, sum_labelMass,hs,mul_one,← sq] at h29  unfold collisionGap30  linarith3132omit [DecidableEq B] in33theorem gram_posterior_bound (G : Y → Matrix (X × B) (X × B) ℂ) (hG : ∀ y, (G y).PosSemidef)34    (hs : ∑ y, mass (G y) = 1) :35    offSquare (∑ y, G y)/2 ≤ ∑ y, mass (G y)*collisionGap (labelPosterior (G y)) := by36  let q y := mass (G y)37  let H y := (q y)⁻¹ • G y38  have hq y : 0 ≤ q y := mass_nonneg _ (hG y)39  have hpiece y : q y • H y = G y := by40    by_cases hz : q y=041    · rw [hz,zero_smul,psd_eq_zero_of_mass_zero _ (hG y) hz]42    · simp [H,smul_smul,hz]43  have h := offSquare_mean q hq hs H44  simp_rw [hpiece] at h45  have hu (y : Y) : q y * offSquare (H y) ≤ 2*(q y*collisionGap (labelPosterior (G y))) := by46    by_cases hz : q y=047    · simp [hz]48    have hm : mass (H y) = 1 := by49      simp only [H,mass,Matrix.trace_smul,Complex.smul_re,smul_eq_mul]50      change (q y)⁻¹ * q y = 151      exact inv_mul_cancel₀ hz52    have hl : labelMass (H y) = labelPosterior (G y) := by53      funext x54      rw [show H y = (q y)⁻¹ • G y from rfl, labelMass_smul]55      unfold labelPosterior56      change (q y)⁻¹ * _ = _ / q y57      ring58    have hb := one_piece (H y) ((hG y).smul (inv_nonneg.mpr (hq y))) hm59    rw [hl] at hb60    nlinarith [mul_nonneg (hq y) (sub_nonneg.mpr hb)]61  have ht := h.trans (Finset.sum_le_sum fun y _ => hu y)62  rw [← Finset.mul_sum] at ht63  change _ ≤ ∑ y, q y*_64  linarith6566theorem measurement_collision_bound (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x=1)67    (ρ : X → DensityState B) (F : Y → Matrix B B ℂ)68    (hF : ∀ y, (F y).PosSemidef) (hnorm : ∑ y, F y=1) :69    statistic p hp hs ρ ≤ ∑ y, outcomeProbability p ρ (F y)*collisionGap (posterior p ρ (F y)) := by70  rw [statistic_eq_gram, ← sum_effectGram p ρ F hnorm]71  have h := gram_posterior_bound (fun y => effectGram p ρ (F y))72    (fun y => effectGram_posSemidef p ρ _ (hF y))73    (by simpa only [mass_effectGram p hp ρ] using sum_outcomeProbability p hp hs ρ F hnorm)74  have hb (y : Y) : labelPosterior (effectGram p ρ (F y)) = posterior p ρ (F y) := by75    funext x76    rw [labelPosterior,posterior,labelMass_effectGram p hp ρ,mass_effectGram p hp ρ]77  simpa only [hb,mass_effectGram p hp ρ] using h7879theorem optimal_quadratic_upper (m : ℕ) (hn : Fintype.card X=m+2)80    (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x=1) (ρ : X → DensityState B) :81    statistic p hp hs ρ ≤ curve m (1-pGuess p ρ) := by82  obtain ⟨F,hF,hnorm,hopt⟩ := exists_optimal_povm p hp hs ρ83  let q y := outcomeProbability p ρ (F y)84  let b y := posterior p ρ (F y)85  have hq y : 0 ≤ q y := outcomeProbability_nonneg p hp ρ _ (hF y)86  have hqs : ∑ y, q y=1 := sum_outcomeProbability p hp hs ρ F hnorm87  have hlocal (y : X) : q y*collisionGap (b y) ≤ q y*curve m (1-b y y) := by88    by_cases hz : q y=089    · simp [hz]90    exact mul_le_mul_of_nonneg_left (collision_coordinate m hn (b y)91      (posterior_probability p hp ρ _ (hF y) (lt_of_le_of_ne (hq y) (Ne.symm hz))).2 y) (hq y)92  have h := (measurement_collision_bound p hp hs ρ F hF hnorm).trans93    ((Finset.sum_le_sum (fun y _ => hlocal y)).trans (curve_average m q (fun y => 1-b y y) hq hqs))94  have hsucc (y) : q y*b y y = jointProbability p ρ (F y) y := weighted_posterior p hp ρ (F y) (hF y) y95  simp only [mul_sub,mul_one,Finset.sum_sub_distrib,hsucc,hqs] at h96  exact h.trans_eq (congrArg (fun z => curve m (1-z)) hopt)9798end SubentropyCertificates.Quadratic

Axioms used

Choose a statement to see which axioms its proof uses.