cfahlgren1's picture
download
raw
2.35 kB
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Algebra.Order.Archimedean.Basic
import Mathlib.Analysis.Complex.Norm
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.FieldSimp
namespace OAI
namespace SevenEighths.Parameters
theorem compensated_geometry {d : ℝ} (_hd0 : 0 ≤ d) (hd1 : d ≤ 1 / 6) :
(1 / 2 : ℝ) ≤ 5 / 6 - 2 * d ∧
3 / 16 ≤ 17 / 48 - d ∧
5 / 16 ≤ 23 / 48 - d ∧
1 / 12 ≤ 23 / 48 - d - 11 * (1 / 8) / 6 ∧
(17 / 48 : ℝ) / 2 + (1 / 8) / 12 = 3 / 16 := by
constructor
· linarith
constructor
· linarith
constructor
· linarith
constructor
· linarith
· norm_num
theorem exists_height_cutoff {dmin allowance A : ℝ}
(hd : 0 < dmin) (ha : 0 < allowance) (hA : 0 ≤ A) :
∃ τ : ℝ, 0 < τ ∧ τ < dmin / 100 ∧
A * τ < dmin * allowance / 100 := by
have hden : 0 < 200 * (1 + A) := by positivity
let τ := min (dmin / 200) (dmin * allowance / (200 * (1 + A)))
have ht : 0 < τ := lt_min (by positivity) (by positivity)
have h1 : τ ≤ dmin / 200 := min_le_left _ _
have h2 : τ ≤ dmin * allowance / (200 * (1 + A)) := min_le_right _ _
have h2' : τ * (200 * (1 + A)) ≤ dmin * allowance :=
(le_div_iff₀ hden).mp h2
refine ⟨τ, ht, by linarith, ?_⟩
have hp : 0 < dmin * allowance := mul_pos hd ha
nlinarith
theorem exists_tail_order {τ B saving : ℝ} (hτ : 0 < τ) :
∃ N : ℕ, B - τ * N < -saving := by
obtain ⟨N, hN⟩ := exists_nat_gt ((B + saving) / τ)
have h := (div_lt_iff₀ hτ).mp hN
exact ⟨N, by nlinarith⟩
theorem cumulative_frequency_bound {ι : Type*} (s : Finset ι)
(frequency : ι → ℝ) {T : ℝ} (hT : 0 ≤ T)
(hfreq : ∀ i ∈ s, |frequency i| ≤ T / (4 * s.card)) :
|∑ i ∈ s, frequency i| ≤ T / 4 := by
by_cases hs : s.card = 0
· have he : s = ∅ := Finset.card_eq_zero.mp hs
simp only [he, Finset.sum_empty, abs_zero]
positivity
· have hc : (s.card : ℝ) ≠ 0 := by exact_mod_cast hs
calc
|∑ i ∈ s, frequency i| ≤ ∑ i ∈ s, |frequency i| :=
Finset.abs_sum_le_sum_abs _ _
_ ≤ ∑ _i ∈ s, T / (4 * s.card) := Finset.sum_le_sum hfreq
_ = T / 4 := by simp only [Finset.sum_const, nsmul_eq_mul]; field_simp
end SevenEighths.Parameters
end OAI

Xet Storage Details

Size:
2.35 kB
·
Xet hash:
8460ba242d60ee64ae48729b07c2e28c1f0f3c3de67b83b938dabbdbb9a2efe2

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