BinarySharpPriors.lean
1module23public import SubentropyCertificates.MaximalCoupling4public import SubentropyCertificates.QuantumEquality56/-! Two-label priors, padded by zero on a prescribed finite alphabet. -/7@[expose] public section8noncomputable section9open Matrix Set MeasureTheory10open scoped BigOperators1112namespace SubentropyCertificates.ConditionalContinuity13open D5.S3.Quantum.Subentropy.Basic14open SubentropyCertificates.ClassicalCurve15open SubentropyCertificates.Continuity (totalVariation)16open SubentropyCertificates.QuantumEquality (pointMass pointMass_probability pointMass_subentropy)1718variable {X : Type*} [Fintype X] [DecidableEq X]1920/-- The prior with masses 1-e and e on the designated labels and zero elsewhere. -/21def binaryPrior (a b : X) (e : ℝ) (x : X) : ℝ :=22 if x = a then 1 - e else if x = b then e else 02324private theorem sum_on_pair (a b : X) (hab : a ≠ b) (f : X → ℝ)25 (h : ∀ x, x ≠ a → x ≠ b → f x = 0) : (∑ x, f x) = f a + f b := by26 calc27 _ = ∑ x ∈ ({a,b} : Finset X), f x := by28 symm29 apply Finset.sum_subset (Finset.subset_univ _)30 intro x _ hx31 simp only [Finset.mem_insert, Finset.mem_singleton, not_or] at hx32 exact h x hx.1 hx.233 _ = _ := by simp [hab]3435/-- The determinant factors outside the two occupied labels are one, so the subentropy36is the binary curve in every ambient dimension. -/37theorem binaryPrior_subentropy (a b : X) (hab : a ≠ b) (e : ℝ) :38 classicalSubentropy (binaryPrior a b e) = phi 0 e := by39 unfold phi classicalSubentropy matrixSubentropy40 apply setIntegral_congr_fun measurableSet_Ioi41 intro t ht42 rw [kernel_diagonal _ t ht.ne', kernel_diagonal _ t ht.ne']43 congr 144 let f (x : X) := t / (t + binaryPrior a b e x)45 change (∏ x, f x) = _46 calc47 _ = ∏ x ∈ ({a,b} : Finset X), f x := by48 symm49 apply Finset.prod_subset (Finset.subset_univ _)50 intro x _ hx51 simp only [Finset.mem_insert, Finset.mem_singleton, not_or] at hx52 simp [f, binaryPrior, hx.1, hx.2, ht.ne']53 _ = _ := by simp [f, binaryPrior, hab, hab.symm, Fintype.prod_option, extremalVector]5455/-- The two priors have total variation distance e and subentropy difference Φ₂(e). -/56theorem binaryPrior_pair (a b : X) (hab : a ≠ b) {e : ℝ} (he : e ∈ Icc 0 1) :57 pointMass a ∈ probabilitySimplex X ∧ binaryPrior a b e ∈ probabilitySimplex X ∧58 totalVariation (pointMass a) (binaryPrior a b e) = e ∧59 classicalSubentropy (pointMass a) = 0 ∧ classicalSubentropy (binaryPrior a b e) = phi 0 e := by60 refine ⟨pointMass_probability a, ⟨?_, ?_⟩, ?_, pointMass_subentropy a,61 binaryPrior_subentropy a b hab e⟩62 · intro x63 by_cases hxa : x = a64 · simp [binaryPrior, hxa, he.2]65 · simp only [binaryPrior, ite_eq_right hxa]66 split67 · exact he.168 · exact le_rfl69 · rw [sum_on_pair a b hab _ (fun x hxa hxb ↦ by simp [binaryPrior, hxa, hxb])]70 simp [binaryPrior, hab.symm]71 · unfold totalVariation72 rw [sum_on_pair a b hab _ (fun x hxa hxb ↦ by simp [pointMass, binaryPrior, hxa, hxb])]73 simp [pointMass, binaryPrior, hab.symm, abs_of_nonneg he.1]7475end SubentropyCertificates.ConditionalContinuity
Axioms used
Choose a statement to see which axioms its proof uses.