BinaryLogIntervals.lean
1module23public import SubentropyCertificates.RationalLogEvaluation4public import SubentropyCertificates.OverlapCurves56/-! Two-sided rational bounds for the binary curve, including finite witnesses7for the crossings and table entries in the arXiv manuscript. -/8@[expose] public section9open Set10namespace SubentropyCertificates.BinaryIntervals11open SubentropyCertificates.LogEnclosure SubentropyCertificates.ClassicalCurve12open SubentropyCertificates.BinarySpectra SubentropyCertificates.SmallOverlap1314def lower (n k : ℕ) (x : ℚ) : ℚ := logLower n (2^k*x) - k*logUpper n 215def upper (n k : ℕ) (x : ℚ) : ℚ := logUpper n (2^k*x) - k*logLower n 216def phiLo (n k : ℕ) (u : ℚ) : ℚ :=17 (u^2*lower n k u - (1-u)^2*upper n 1 (1-u))/(1-2*u)18def phiHi (n k : ℕ) (u : ℚ) : ℚ :=19 (u^2*upper n k u - (1-u)^2*lower n 1 (1-u))/(1-2*u)2021theorem binary_interval (n k : ℕ) {u : ℚ} (h0 : 0 < u) (h1 : u < 1/2)22 (hu : 1 ≤ 2^k*u) : (phiLo n k u : ℝ) ≤ phi 0 u ∧ phi 0 u ≤ (phiHi n k u : ℝ) := by23 have hx : 0 < (u:ℝ) := by exact_mod_cast h024 have hxr : (u:ℝ) < 1/2 := by25 have hr : (u:ℝ) < ((1/2:ℚ):ℝ) := Rat.cast_lt.mpr h126 simpa using hr27 have hd : 0 < 1-2*(u:ℝ) := by linarith28 have h := scaled_log_bounds n k h0 hu29 have h' := scaled_log_bounds n 1 (x:=1-u) (by linarith) (by norm_num; linarith)30 change (lower n k u : ℝ) ≤ _ ∧ _ ≤ (upper n k u : ℝ) at h31 change (lower n 1 (1-u) : ℝ) ≤ _ ∧ _ ≤ (upper n 1 (1-u) : ℝ) at h'32 rw [Rat.cast_sub,Rat.cast_one] at h'33 rw [binary_curve_log ⟨hx,hxr⟩]34 unfold phiLo phiHi35 push_cast36 constructor37 · apply div_le_div_of_nonneg_right _ hd.le38 linarith [mul_le_mul_of_nonneg_left h.1 (sq_nonneg (u:ℝ)),39 mul_le_mul_of_nonneg_left h'.2 (sq_nonneg (1-(u:ℝ)))]40 · apply div_le_div_of_nonneg_right _ hd.le41 linarith [mul_le_mul_of_nonneg_left h.2 (sq_nonneg (u:ℝ)),42 mul_le_mul_of_nonneg_left h'.1 (sq_nonneg (1-(u:ℝ)))]4344/-- Rational sign test for the crossover. The argument is the signal overlap s. -/45theorem comparison_interval (n k j : ℕ) {s : ℚ} (hs : 0 < s) (hs' : s < 1)46 (hk : 1 ≤ 2^k*((1-s)/2)) (hj : 1 ≤ 2^j*(s^2/4)) :47 (logLower n 2 - 1/2 - phiHi n k ((1-s)/2) - phiHi n j (s^2/4) : ℚ) ≤48 conditionalCurve s - phi 0 ((s:ℝ)^2/4) ∧49 conditionalCurve s - phi 0 ((s:ℝ)^2/4) ≤50 (logUpper n 2 - 1/2 - phiLo n k ((1-s)/2) - phiLo n j (s^2/4) : ℚ) := by51 have h0 := binary_interval n k (u:=(1-s)/2) (by linarith) (by linarith) hk52 have h1 := binary_interval n j (u:=s^2/4) (by positivity) (by nlinarith [sq_lt_sq' (by linarith : -1<s) hs']) hj53 have hl := rational_log_bounds n (y := 2) (by norm_num)54 have he := phi_uniform_endpoint 055 norm_num [uniformError,harmonic_succ,harmonic_zero] at he56 unfold conditionalCurve57 push_cast at h0 h1 hl ⊢58 constructor <;> linarith [h0.1,h0.2,h1.1,h1.2,hl.1,hl.2]5960end SubentropyCertificates.BinaryIntervals
Axioms used
Choose a statement to see which axioms its proof uses.