TernaryIntervals.lean
1module2public import SubentropyCertificates.TernaryCurveFormula3public import SubentropyCertificates.BinaryLogIntervals45/-! Exact interval arithmetic for the three repeated-coordinate spectra in each row. -/6@[expose] public section7open Set8namespace SubentropyCertificates.TernaryIntervals9open SubentropyCertificates.ClassicalCurve SubentropyCertificates.BinaryIntervals10open SubentropyCertificates.LogEnclosure1112def weight (b : ℚ) := (1-2*b)^3 / (1-3*b)^213def correction (b : ℚ) := b^2/(1-3*b)14def lo (n k : ℕ) (b : ℚ) :=15 -(weight b)*upper n 1 (1-2*b) + (weight b-1)*lower n k b + correction b16def hi (n k : ℕ) (b : ℚ) :=17 -(weight b)*lower n 1 (1-2*b) + (weight b-1)*upper n k b + correction b1819theorem ternary_interval (n k : ℕ) {b : ℚ} (hb : 0 < b) (hsmall : b < 1/3)20 (hlarge : 1 ≤ 2*(1-2*b)) (hscale : 1 ≤ 2^k*b) (hw : 1 ≤ weight b) :21 (lo n k b : ℝ) ≤ phi 1 (2*(b:ℝ)) ∧ phi 1 (2*(b:ℝ)) ≤ (hi n k b : ℝ) := by22 have hb' : 0 < (b:ℝ) := by exact_mod_cast hb23 have hs : (b:ℝ) < 1/3 := by simpa using (Rat.cast_lt (K:=ℝ)).mpr hsmall24 have h := scaled_log_bounds n k hb hscale25 have ha := scaled_log_bounds n 1 (x:=1-2*b) (by linarith) (by simpa using hlarge)26 change (lower n k b : ℝ) ≤ _ ∧ _ ≤ (upper n k b : ℝ) at h27 change (lower n 1 (1-2*b) : ℝ) ≤ _ ∧ _ ≤ (upper n 1 (1-2*b) : ℝ) at ha28 have he : 1-2*(b:ℝ)-(b:ℝ) = 1-3*(b:ℝ) := by ring29 have hwr : (weight b : ℝ) = (1-2*(b:ℝ))^3/(1-3*(b:ℝ))^2 := by unfold weight; push_cast; rfl30 have hcr : (correction b : ℝ) = (b:ℝ)^2/(1-3*(b:ℝ)) := by unfold correction; push_cast; rfl31 have hw' : (1:ℝ) ≤ (weight b : ℝ) := by exact_mod_cast hw32 have hl := ternary_curve_log hb' hs33 dsimp only at hl34 rw [he,← hwr,← hcr] at hl35 have hcast : ((1-2*b:ℚ):ℝ) = 1-2*(b:ℝ) := by push_cast; rfl36 rw [hcast] at ha37 rw [hl]38 unfold lo hi39 push_cast40 constructor41 · linarith [mul_le_mul_of_nonneg_left ha.2 (by linarith : 0≤(weight b:ℝ)),42 mul_le_mul_of_nonneg_left h.1 (sub_nonneg.mpr hw')]43 · linarith [mul_le_mul_of_nonneg_left ha.1 (by linarith : 0≤(weight b:ℝ)),44 mul_le_mul_of_nonneg_left h.2 (sub_nonneg.mpr hw')]4546end SubentropyCertificates.TernaryIntervals
Axioms used
Choose a statement to see which axioms its proof uses.