NearPureBinary.lean
1module23public import SubentropyCertificates.EqualPriorSubentropy4public import Mathlib.Analysis.SpecialFunctions.Log.Deriv56/-! The binary expansion at a pure spectrum in Section 3.3. -/7@[expose] public section8noncomputable section9open Set Filter Asymptotics10open scoped Topology11namespace SubentropyCertificates.NearPureBinary12open SubentropyCertificates.ClassicalCurve SubentropyCertificates.BinarySpectra1314/-- A uniform remainder estimate retaining the endpoint logarithm. -/15theorem binary_near_pure_remainder {u : ℝ} (hu : u ∈ Ioo 0 (1/4)) :16 |phi 0 u - (u + u^2 * (Real.log u + 1/2))| ≤17 (8 + 4 * |Real.log u|) * u^3 := by18 have h0 := hu.119 have h1 := hu.220 have hp : 0 < 1 - u := by linarith21 have hd : 0 < 1 - 2*u := by linarith22 let r := u + u^2/2 + Real.log (1-u)23 have hr : |r| ≤ 2*u^3 := by24 have h := Real.abs_log_sub_add_sum_range_le25 (x := u) (by rw [abs_of_pos h0]; linarith) 226 norm_num [Finset.sum_range_succ, abs_of_pos h0] at h27 refine h.trans ((div_le_iff₀ hp).2 ?_)28 nlinarith [mul_nonneg (pow_nonneg h0.le 3) (show 0 ≤ 1-2*u by linarith)]29 have hs : (1-u)^2 ≤ 1 := by30 nlinarith [mul_nonneg h0.le (show 0 ≤ 2-u by linarith)]31 have hp0 : 0 ≤ u^3 := pow_nonneg h0.le _32 have he : phi 0 u - (u + u^2*(Real.log u+1/2)) =33 (-(1-u)^2*r + u^3*(1+u/2+2*Real.log u)) / (1-2*u) := by34 rw [binary_curve_log ⟨h0,by linarith⟩]35 dsimp [r]36 apply (eq_div_iff hd.ne').237 rw [sub_mul, div_mul_cancel₀ _ hd.ne']38 ring39 have ha : |-(1-u)^2*r| ≤ 2*u^3 := by40 rw [abs_mul, abs_neg, abs_of_nonneg (sq_nonneg _)]41 calc42 _ ≤ 1 * |r| := mul_le_mul_of_nonneg_right hs (abs_nonneg _)43 _ ≤ _ := by simpa using hr44 have hc : |1 + u/2 + 2*Real.log u| ≤ 2 + 2*|Real.log u| := by45 calc46 _ ≤ |1 + u/2| + |2*Real.log u| := abs_add_le _ _47 _ ≤ _ := by48 rw [abs_of_pos (by linarith : 0 < 1+u/2), abs_mul, abs_of_pos (by norm_num : (0:ℝ)<2)]49 linarith50 have hb := mul_le_mul_of_nonneg_left hc hp051 rw [he, abs_div, abs_of_pos hd]52 apply (div_le_iff₀ hd).253 calc54 _ ≤ _ := abs_add_le _ _55 _ ≤ 2*u^3 + u^3*(2+2*|Real.log u|) := by56 rw [abs_mul (u^3), abs_of_nonneg hp0]57 exact add_le_add ha hb58 _ ≤ (8+4*|Real.log u|)*u^3*(1-2*u) := by59 have hh := mul_nonneg (show 0 ≤ (8+4*|Real.log u|)*u^3 by positivity)60 (show 0 ≤ 1-2*u-1/2 by linarith)61 linarith6263/-- Equation (sharp), with the stated second-order coefficient and logarithmic remainder. -/64theorem binary_curve_near_pure_expansion :65 (fun u : ℝ ↦ phi 0 u - (u + u^2*(Real.log u+1/2))) =O[𝓝[>] (0:ℝ)]66 (fun u ↦ u^3 * |Real.log u|) := by67 refine isBigO_iff.mpr ⟨12, ?_⟩68 have hs : ∀ᶠ u : ℝ in 𝓝[>] 0, u ∈ Ioo 0 (min (1/4) (Real.exp (-1))) :=69 Ioo_mem_nhdsGT_of_mem ⟨le_rfl, lt_min (by norm_num) (Real.exp_pos _)⟩70 filter_upwards [hs] with u hu71 have he := (lt_min_iff.mp hu.2).272 have hl := Real.log_le_log hu.1 he.le73 rw [Real.log_exp] at hl74 have hlarge : 1 ≤ |Real.log u| := by linarith [neg_abs_le (Real.log u)]75 rw [Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (pow_nonneg hu.1.le _) (abs_nonneg _))]76 apply (binary_near_pure_remainder ⟨hu.1,(lt_min_iff.mp hu.2).1⟩).trans77 nlinarith [mul_nonneg (pow_nonneg hu.1.le 3) (sub_nonneg.mpr hlarge)]7879/-- Classical subentropy of the literal two-coordinate probability vector in (sharp). -/80theorem binary_near_pure_expansion :81 (fun u : ℝ ↦ classicalSubentropy ![1-u,u] - (u + u^2*(Real.log u+1/2))) =O[𝓝[>] (0:ℝ)]82 (fun u ↦ u^3 * |Real.log u|) := by83 have h (u : ℝ) : classicalSubentropy ![1-u,u] = phi 0 u := by84 unfold phi classicalSubentropy D5.S3.Quantum.Subentropy.Basic.matrixSubentropy85 apply MeasureTheory.setIntegral_congr_fun measurableSet_Ioi86 intro t ht87 rw [D5.S3.Quantum.Subentropy.Basic.kernel_diagonal _ t ht.ne',88 D5.S3.Quantum.Subentropy.Basic.kernel_diagonal _ t ht.ne']89 simp [extremalVector, Fin.prod_univ_two, Fintype.prod_option]90 simpa only [h] using binary_curve_near_pure_expansion9192end SubentropyCertificates.NearPureBinary
Axioms used
Choose a statement to see which axioms its proof uses.