cfahlgren1/math / lean /OAI /Combinatorics /EditApproximation /Refinement /ComputedSourceAddressBits.lean
cfahlgren1's picture
download
raw
3.17 kB
import OAI.Combinatorics.EditApproximation.Refinement.ComputedNumericalParameters
import OAI.Combinatorics.EditApproximation.Geometry.ParameterLocalAsymptotics
namespace OAI
/-! The actual uniform source-range address fits in one logarithmic input
word eventually. The coefficient can be any fixed natural number. -/
namespace EditApproximation
open Filter
open scoped Topology
theorem computed_sourceAddressBits_div_height_tendsto (C : ℕ) :
Tendsto (fun N =>
((C * (coarseExponent (inputSmallLog N) + 1) * Nat.size (inputHeight N) + 1 : ℕ) : ℝ) /
inputHeight N) atTop (𝓝 0) := by
have hupper := (smallLog_polynomial_div_height_tendsto 2).const_mul (4 * (C : ℝ) + 1)
simp only [mul_zero] at hupper
apply squeeze_zero' (Eventually.of_forall fun N => div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)) _ hupper
filter_upwards [eventually_ge_atTop 1] with N hN
have he := (inputSmallLog_bounds N hN).1
have hp := coarseExponent_le_smallLog N
have hell : 1 ≤ inputSmallLog N := Nat.one_le_two_pow
have hs : Nat.size (inputHeight N) = heightExponent N + 1 := by
simp only [inputHeight, Nat.size_pow]
have hsmall : (1 : ℝ) ≤ inputSmallLog N := by exact_mod_cast hell
have hpR : (coarseExponent (inputSmallLog N) : ℝ) + 1 ≤ 2 * inputSmallLog N := by
exact_mod_cast (show coarseExponent (inputSmallLog N) + 1 ≤ 2 * inputSmallLog N by omega)
have hsR : (Nat.size (inputHeight N) : ℝ) ≤ 2 * inputSmallLog N := by
exact_mod_cast (show Nat.size (inputHeight N) ≤ 2 * inputSmallLog N by omega)
have hproduct := mul_le_mul hpR hsR (Nat.cast_nonneg _) (by positivity : (0 : ℝ) ≤ 2 * inputSmallLog N)
have hscaled := mul_le_mul_of_nonneg_left hproduct (Nat.cast_nonneg C : (0 : ℝ) ≤ C)
have hnum : ((C * (coarseExponent (inputSmallLog N) + 1) * Nat.size (inputHeight N) + 1 : ℕ) : ℝ) ≤
(4 * (C : ℝ) + 1) * (inputSmallLog N : ℝ) ^ 2 := by
push_cast
nlinarith only [hscaled, hsmall, sq_nonneg ((inputSmallLog N : ℝ) - 1)]
have h := div_le_div_of_nonneg_right hnum (Nat.cast_nonneg (inputHeight N) : (0 : ℝ) ≤ inputHeight N)
simpa only [mul_div_assoc] using h
theorem computed_sourceAddressBits_le_height (C : ℕ) :
∀ᶠ N in atTop,
C * (coarseExponent (inputSmallLog N) + 1) * Nat.size (inputHeight N) + 1 ≤ inputHeight N := by
filter_upwards [(computed_sourceAddressBits_div_height_tendsto C).eventually
(eventually_lt_nhds (by norm_num : (0 : ℝ) < 1))] with N h
have hH : (0 : ℝ) < inputHeight N := by
exact_mod_cast Nat.two_pow_pos (heightExponent N)
have hlt := (div_lt_one hH).mp h
exact_mod_cast hlt.le
theorem computed_localOnlineMassBound_word :
∀ᶠ N in atTop,
Nat.size (localOnlineMassBound (integerParameters N).M (integerParameters N).P (inputHeight N)) ≤
inputHeight N := by
filter_upwards [computed_sourceAddressBits_le_height 8000,
inputHeight_real_tendsto.eventually (eventually_ge_atTop 64)] with N hbits hH
have hHnat : 64 ≤ inputHeight N := by exact_mod_cast hH
exact (computed_localOnlineMassBound_bits N hHnat).trans hbits
end EditApproximation
end OAI

Xet Storage Details

Size:
3.17 kB
·
Xet hash:
72396ed3e743fd7b315406e7b54fb875cf6a85fd9fe6bd78af6cdb01cb280f12

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.