SharpGuessingBound.lean
1module23public import SubentropyCertificates.LinearDiscrimination4public import SubentropyCertificates.ZeroConditional56/-! The manuscript's Sharp guessing bound (thm:guess). With n=m+2 labels the7paper's curve is `phi m` and its error endpoint is `uniformError m`.8The final theorem also states the one-label conclusion. -/9@[expose] public section10noncomputable section11set_option autoImplicit false12set_option backward.isDefEq.respectTransparency false13open Set14open scoped BigOperators15namespace SubentropyCertificates.Discrimination16open D5.S3.Quantum.Foundation.FiniteStateChannel17open D5.S3.Quantum.Subentropy.ClassicalQuantumGram18open D5.S3.Quantum.Subentropy.GuessingProbability19open SubentropyCertificates.ClassicalCurve20open SubentropyCertificates.ZeroConditional2122variable {X B : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B]2324/-- The original ensemble supplies e and q in the paper theorem below.25Attainment and optimality quantify over other ensembles on the same spaces. -/26structure SharpGuessingConclusion (m : ℕ) (p : X → ℝ) (ρ : X → DensityState B)27 (e q : ℝ) : Prop where28 error_range : e ∈ Icc 0 (uniformError m)29 bounds : 0 ≤ q ∧ q ≤ phi m e ∧ phi m e ≤ e ∧ e ≤ -Real.log (pGuess p ρ)30 attainable : ∀ r ∈ Icc 0 (uniformError m),31 ∃ (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (hsw : ∑ x, w x = 1) (σ : X → DensityState B),32 1 - pGuess w σ = r ∧ conditionalSubentropy w hw hsw σ = phi m r33 positive_equality : 0 < e → (q = phi m e ↔ extremalPureEnsemble m p ρ e)34 zero_conditional : q = 0 ↔ e = 035 zero_error : e = 0 ↔ orthogonalSupports p ρ36 strict_tangent : 0 < e → phi m e < e37 optimal_coefficient : ∀ c : ℝ,38 (∀ (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (hsw : ∑ x, w x = 1) (σ : X → DensityState B),39 conditionalSubentropy w hw hsw σ ≤ c * (1 - pGuess w σ)) ↔ 1 ≤ c4041/-- Relabel the attaining identical-pure ensemble onto any given n-element42label type X. The signal dimension is also fixed. -/43theorem curve_attainable_on_labels [Nonempty B] (m : ℕ) (hn : Fintype.card X = m + 2)44 (r : ℝ) (hr : r ∈ Icc 0 (uniformError m)) :45 ∃ (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B),46 1 - pGuess p ρ = r ∧ conditionalSubentropy p hp hs ρ = phi m r := by47 classical48 let f : X ≃ Option (Fin (m + 1)) := Fintype.equivOfCardEq (by simp [hn, Nat.add_assoc])49 let w := extremalVector m r ∘ f50 have hw := simplex_reindex _ (extremal_probability_admissible m hr) f51 let i := f.symm none52 have hi : w i = 1 - r := by simp [w, i, extremalVector]53 have hmax (x : X) : w x ≤ w i := by54 simpa only [w, i, Function.comp_apply, Equiv.apply_symm_apply] using55 extremal_none_largest m hr (f x)56 let b₀ : B := Classical.arbitrary B57 let v (b : B) : ℂ := if b = b₀ then 1 else 058 have hv : ∑ b, star (v b) * v b = 1 := by simp [v]59 refine ⟨w, hw.1, hw.2, fun _ => pureSignal v hv, ?_, ?_⟩60 · rw [pGuess_identical w hw.1 hw.2 (pureSignal v hv) i hmax, hi]61 ring62 · exact (conditional_identical_pure w hw.1 hw.2 v hv).trans63 (classical_subentropy_reindex (extremalVector m r) f)6465theorem single_label_guessing (hn : Fintype.card X = 1)66 (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B) :67 1 - pGuess p ρ = 0 ∧ conditionalSubentropy p hp hs ρ = 0 := by68 have horth : orthogonalSupports p ρ := fun x y hxy =>69 (hxy (Fintype.card_le_one_iff.mp hn.le x y)).elim70 have hz := zero_conditional_equivalences p hp hs ρ71 have hone := hz.2.1.mpr horth72 exact ⟨sub_eq_zero.mpr hone.symm, hz.1.mpr hone⟩7374private theorem curve_le_its_error (m : ℕ) {e : ℝ} (he : e ∈ Icc 0 (uniformError m)) :75 phi m e ≤ e := by76 rcases he.1.eq_or_lt with hz | hpos77 · rw [← hz, phi_zero]78 · exact (phi_lt_error m hpos (he.2.trans (uniformError_mem m).2)).le7980/-- The Sharp guessing bound, including all equality, optimality and boundary81clauses, for any finite normalized ensemble. For two or more labels the named82fields of `SharpGuessingConclusion` follow the order of the paper. -/83theorem sharp_guessing_bound (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1)84 (ρ : X → DensityState B) :85 let n := Fintype.card X86 let e := 1 - pGuess p ρ87 let q := conditionalSubentropy p hp hs ρ88 (2 ≤ n → SharpGuessingConclusion (n - 2) p ρ e q) ∧ (n = 1 → e = 0 ∧ q = 0) := by89 refine ⟨?_, fun hn => single_label_guessing hn p hp hs ρ⟩90 intro hn91 let m := Fintype.card X - 292 have hcard : Fintype.card X = m + 2 := by dsimp [m]; omega93 have hX : Nonempty X := Fintype.card_pos_iff.mp (by omega)94 have : Nonempty B := by95 by_contra h96 have : IsEmpty B := not_nonempty_iff.mp h97 have ht := (ρ (Classical.choice hX)).2.298 simp [Matrix.trace] at ht99 have hb := optimal_discrimination_bound m hcard p hp hs ρ100 have hz := zero_conditional_equivalences p hp hs ρ101 have he0 : 1 - pGuess p ρ = 0 ↔ pGuess p ρ = 1 := sub_eq_zero.trans eq_comm102 refine {103 error_range := hb.2.2104 bounds := ⟨hb.1, hb.2.1, curve_le_its_error m hb.2.2, (pGuess_bounds p hp hs ρ).2.2.2.2.1⟩105 attainable := curve_attainable_on_labels m hcard106 positive_equality := sharp_equality_iff_of_positive_error m hcard p hp hs ρ107 zero_conditional := hz.1.trans he0.symm108 zero_error := he0.trans hz.2.1109 strict_tangent := fun h => phi_lt_error m h (hb.2.2.2.trans (uniformError_mem m).2)110 optimal_coefficient := ?_ }111 intro c112 constructor113 · intro hall114 by_contra! hc115 obtain ⟨r, hr, _, hadm, hlt⟩ := smaller_coefficient_fails_near_zero m hc zero_lt_one116 obtain ⟨w, hw, hsw, σ, he, hq⟩ := curve_attainable_on_labels (X := X) (B := B)117 m hcard r ⟨hr.le, hadm⟩118 have h := hall w hw hsw σ119 rw [he, hq] at h120 exact h.not_gt hlt121 · intro hc w hw hsw σ122 have h := optimal_discrimination_bound m hcard w hw hsw σ123 exact (h.2.1.trans (curve_le_its_error m h.2.2)).trans (le_mul_of_one_le_left h.2.2.1 hc)124125end SubentropyCertificates.Discrimination
Axioms used
Choose a statement to see which axioms its proof uses.