Pratik Patil

ClassicalContinuity.lean

1module23public import SubentropyCertificates.MaximalCoupling4public import SubentropyCertificates.ClassicalTableGuessing5public import SubentropyCertificates.CurveTangent67/-! Classical part of Theorem 13. The modulus and spectral extremizers are due8to Hanson and Datta. This proof uses the manuscript's maximal-coupling argument. -/9@[expose] public section10noncomputable section11open Set Filter12open scoped BigOperators Topology1314namespace SubentropyCertificates.Continuity15open SubentropyCertificates.ClassicalCurve1617variable {X : Type*} [Fintype X] [DecidableEq X]1819def modulus (m : ℕ) (δ : ℝ) : ℝ := phi m (min δ (uniformError m))2021/-- A maximal coupling turns the subentropy difference into two conditional22subentropies of the same joint law. Either orientation has the same guessing error. -/23theorem classical_continuity_bound (m : ℕ) (hn : Fintype.card X = m + 2)24    (p q : X → ℝ) (hp : p ∈ probabilitySimplex X) (hq : q ∈ probabilitySimplex X) :25    |classicalSubentropy p - classicalSubentropy q| ≤ modulus m (totalVariation p q) := by26  obtain ⟨J, hJ, hr, hc, hdiag, he⟩ := exists_maximal_coupling p q hp hq27  let w := fun u : X × X ↦ J u.1 u.228  have fwd := classical_joint_guessing m hn p q hp J hJ hr hc29  have rev := classical_joint_guessing m hn q p hq (fun i j ↦ J j i) (fun i j ↦ hJ j i) hc hr30  have swap := classical_subentropy_reindex w (Equiv.prodComm X X)31  change classicalSubentropy (fun u : X × X ↦ J u.2 u.1) = classicalSubentropy w at swap32  change 0 ≤ classicalSubentropy w - classicalSubentropy q ∧33    classicalSubentropy w - classicalSubentropy q ≤ _ at fwd34  dsimp only at rev35  rw [swap] at rev36  rw [he] at fwd rev37  have hab : |classicalSubentropy p - classicalSubentropy q| ≤ phi m (totalVariation p q) :=38    abs_le.mpr ⟨by linarith [rev.2, fwd.1], by linarith [fwd.2, rev.1]⟩39  by_cases h : totalVariation p q ≤ uniformError m40  · simpa [modulus, min_eq_left h] using hab41  · have ht : totalVariation p q ∈ Icc 0 1 := by42      refine ⟨div_nonneg (Finset.sum_nonneg (fun i _ ↦ abs_nonneg _)) (by norm_num), ?_⟩43      rw [← he]44      linarith [Finset.sum_nonneg (s := Finset.univ) (fun i _ ↦ hJ i i)]45    simpa [modulus, min_eq_right (le_of_not_ge h)] using hab.trans (phi_le_uniform_max m ht)4647/-- Distance between the explicit extremizer and the point mass at its distinguished label. -/48theorem extremal_totalVariation (m : ℕ) {u : ℝ} (hu : 0 ≤ u) :49    totalVariation (extremalVector m u) (extremalVector m 0) = u := by50  have hd : (0 : ℝ) < (m + 1 : ℕ) := by positivity51  simp only [totalVariation, Fintype.sum_option, extremalVector, sub_zero, zero_div,52    Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]53  rw [show 1 - u - 1 = -u by ring, abs_neg, abs_of_nonneg hu,54    abs_of_nonneg (div_nonneg hu hd.le)]55  field_simp56  ring5758/-- At every allowed radius the point mass and the extremal vector attain the59modulus. Their actual distance stops at the uniform endpoint. -/60theorem classical_modulus_attained (m : ℕ) (hn : Fintype.card X = m + 2)61    {δ : ℝ} (hδ : 0 ≤ δ) :62    ∃ p q : X → ℝ, p ∈ probabilitySimplex X ∧ q ∈ probabilitySimplex X ∧63      totalVariation p q = min δ (uniformError m) ∧64      |classicalSubentropy p - classicalSubentropy q| = modulus m δ := by65  let u := min δ (uniformError m)66  have hu : u ∈ Icc (0 : ℝ) 1 :=67    ⟨le_min hδ (uniformError_mem m).1, (min_le_right ..).trans (uniformError_mem m).2⟩68  let e : X ≃ Option (Fin (m + 1)) := Fintype.equivOfCardEq (by simp [hn, Nat.add_assoc])69  let p := extremalVector m u70  let q := extremalVector m 071  refine ⟨p ∘ e, q ∘ e, simplex_reindex p (extremal_probability m hu) e,72    simplex_reindex q (extremal_probability m (by constructor <;> norm_num)) e, ?_, ?_⟩73  · change (∑ i, |p (e i) - q (e i)|) / 2 = u74    rw [e.sum_comp (fun i ↦ |p i - q i|)]75    exact extremal_totalVariation m hu.176  · rw [classical_subentropy_reindex, classical_subentropy_reindex]77    change |phi m u - phi m 0| = phi m u78    have hm := (phi_strictMono m).monotoneOn79      (show (0 : ℝ) ∈ Icc 0 (uniformError m) from ⟨le_rfl, (uniformError_mem m).1⟩)80      (show u ∈ Icc 0 (uniformError m) from ⟨hu.1, min_le_right ..⟩) hu.181    rw [phi_zero] at hm ⊢82    simp [abs_of_nonneg hm]8384/-- The least upper bound is a maximum, including at zero radius and on the plateau. -/85theorem classical_modulus_isGreatest (m : ℕ) (hn : Fintype.card X = m + 2)86    {δ : ℝ} (hδ : 0 ≤ δ) :87    IsGreatest {v : ℝ | ∃ p q : X → ℝ, p ∈ probabilitySimplex X ∧ q ∈ probabilitySimplex X ∧88      totalVariation p q ≤ δ ∧ v = |classicalSubentropy p - classicalSubentropy q|} (modulus m δ) := by89  obtain ⟨p, q, hp, hq, he, hv⟩ := classical_modulus_attained m hn hδ90  refine ⟨⟨p, q, hp, hq, he.le.trans (min_le_left ..), hv.symm⟩, ?_⟩91  rintro v ⟨a, b, ha, hb, hab, rfl⟩92  have ht : 0 ≤ totalVariation a b :=93    div_nonneg (Finset.sum_nonneg fun i _ ↦ abs_nonneg _) (by norm_num)94  apply (classical_continuity_bound m hn a b ha hb).trans95  exact (phi_strictMono m).monotoneOn96    ⟨le_min ht (uniformError_mem m).1, min_le_right ..⟩97    ⟨le_min hδ (uniformError_mem m).1, min_le_right ..⟩ (min_le_min_right _ hab)9899private theorem uniform_endpoint_pos (m : ℕ) : 0 < uniformError m := by100  have hn : (1 : ℝ) < (m + 2 : ℕ) := by norm_cast; omega101  exact sub_pos.mpr ((div_lt_one (by positivity)).mpr hn)102103/-- Every positive radius has a strictly smaller modulus, including on the plateau. -/104theorem modulus_lt_radius (m : ℕ) {δ : ℝ} (hδ : 0 < δ) : modulus m δ < δ :=105  (phi_lt_error m (lt_min hδ (uniform_endpoint_pos m))106    ((min_le_right ..).trans (uniformError_mem m).2)).trans_le (min_le_left ..)107108/-- The ratio to the radius tends to one in every fixed alphabet of size at least two. -/109theorem modulus_div_radius_tendsto_one (m : ℕ) :110    Tendsto (fun δ ↦ modulus m δ / δ) (𝓝[>] 0) (𝓝 1) := by111  apply (phi_div_error_tendsto_one m).congr'112  filter_upwards [Ioo_mem_nhdsGT_of_mem113    (show (0 : ℝ) ∈ Ico 0 (uniformError m) from ⟨le_rfl, uniform_endpoint_pos m⟩)] with δ hδ114  simp [modulus, min_eq_left hδ.2.le]115116end SubentropyCertificates.Continuity

Axioms used

Choose a statement to see which axioms its proof uses.