cfahlgren1's picture
download
raw
5.68 kB
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Analysis.Complex.Norm
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Finset.Max
import Mathlib.Algebra.Order.Floor.Semiring
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
namespace OAI
namespace SevenEighths.Detector
theorem exists_small_increment (M : ℕ → ℝ) {n : ℕ} (hn : 0 < n)
{lo hi e : ℝ} (hlo : lo ≤ M 0) (hhi : M n ≤ hi)
(hwidth : hi - lo ≤ n * e) :
∃ i < n, M (i + 1) - M i ≤ e := by
by_contra h
have hinc : ∀ i ∈ Finset.range n, e < M (i + 1) - M i := by
intro i hi
exact lt_of_not_ge (fun hle => h ⟨i, Finset.mem_range.mp hi, hle⟩)
have hs := Finset.sum_lt_sum_of_nonempty (Finset.nonempty_range_iff.mpr (Nat.ne_of_gt hn)) hinc
simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul,
Finset.sum_range_sub] at hs
linarith
theorem buffered_bin_of_rounding {x y a e : ℝ}
(hround : a ≤ x ∧ x < a + e) (hstep : y - x ≤ e) :
a ≤ x ∧ x < a + e ∧ y < a + 2 * e := by
exact ⟨hround.1, hround.2, by linarith [hround.2]⟩
theorem exists_grid_rounding {base x e : ℝ} (he : 0 < e) (hx : base ≤ x) :
∃ k : ℕ, base + e * k ≤ x ∧ x < base + e * k + e := by
let k := ⌊(x - base) / e⌋₊
have hnonneg : 0 ≤ (x - base) / e := div_nonneg (sub_nonneg.mpr hx) he.le
have hlo := Nat.floor_le hnonneg
have hhi := Nat.lt_floor_add_one ((x - base) / e)
have hlo' := (le_div_iff₀ he).mp hlo
have hhi' := (div_lt_iff₀ he).mp hhi
refine ⟨k, ?_, ?_⟩ <;> dsimp [k] <;> nlinarith
theorem exists_buffered_bin (M : ℕ → ℝ) {n : ℕ} (hn : 0 < n)
{e : ℝ} (he : 0 < e)
(hbound : ∀ j ≤ n, (51 / 100 : ℝ) ≤ M j ∧ M j ≤ 1)
(hwidth : (49 / 100 : ℝ) ≤ n * e) :
∃ i < n, ∃ k : ℕ,
let a : ℝ := 51 / 100 + e * k
a ≤ 1 ∧ a ≤ M i ∧ M i < a + e ∧ M (i + 1) < a + 2 * e := by
obtain ⟨i, hi, hstep⟩ := exists_small_increment M hn (e := e)
(hbound 0 (Nat.zero_le _)).1 (hbound n le_rfl).2 (by linarith)
obtain ⟨k, hklo, hkhi⟩ := exists_grid_rounding he (hbound i hi.le).1
refine ⟨i, hi, k, ?_, hklo, hkhi, ?_⟩
· exact hklo.trans (hbound i hi.le).2
· linarith
theorem maximal_zero_of_floor_lt {ι : Type*} (L : ι → ℂ → ℂ)
(zeros : Finset (ι × ℂ)) {floor M : ℝ}
(hzero : ∀ p ∈ zeros, L p.1 p.2 = 0)
(hmax : M ∈ insert floor (zeros.image (fun p => p.2.re)))
(hfloor : floor < M) :
∃ χ ρ, (χ, ρ) ∈ zeros ∧ L χ ρ = 0 ∧ ρ.re = M := by
classical
rcases Finset.mem_insert.mp hmax with h | h
· exact False.elim ((ne_of_gt hfloor) h)
· obtain ⟨⟨χ, ρ⟩, hp, heq⟩ := Finset.mem_image.mp h
exact ⟨χ, ρ, hp, hzero _ hp, heq⟩
theorem simultaneous_saturation {U δ r m ε A B : ℝ}
(hU : 1 < U) (hδ : (1 / 50 : ℝ) ≤ δ) (hε : 0 ≤ ε)
(hA : 0 ≤ A) (hB : 0 ≤ B)
(hprod : U ^ (δ * (r + m) - ε) ≤ A * B)
(hupperA : A ≤ U ^ (δ * r + ε))
(hupperB : B ≤ U ^ (δ * min m (1 - m) + ε)) :
m ≤ 1 / 2 + 75 * ε ∧
U ^ (δ * r - 2 * ε) ≤ A ∧ U ^ (δ * m - 2 * ε) ≤ B := by
have hU0 : 0 < U := by linarith
have hδ0 : 0 ≤ δ := by linarith
have hBcoarse : B ≤ U ^ (δ * m + ε) := by
apply hupperB.trans
exact Real.rpow_le_rpow_of_exponent_le hU.le
(by have h := mul_le_mul_of_nonneg_left (min_le_left m (1 - m)) hδ0; linarith)
have hpupper : A * B ≤ U ^ (δ * r + ε + (δ * min m (1 - m) + ε)) := by
rw [Real.rpow_add hU0]
exact mul_le_mul hupperA hupperB hB (Real.rpow_nonneg hU0.le _)
have hexp := (Real.rpow_le_rpow_left_iff hU).mp (hprod.trans hpupper)
have hlength : m ≤ 1 / 2 + 75 * ε := by
by_cases hm : m ≤ 1 / 2
· linarith
· have hmin : min m (1 - m) = 1 - m := min_eq_right (by linarith)
rw [hmin] at hexp
have hm0 : 0 ≤ m - 1 / 2 := by linarith
have hmul := mul_le_mul_of_nonneg_right hδ hm0
nlinarith
have hlowerA : U ^ (δ * r - 2 * ε) ≤ A := by
have hp : U ^ (δ * r - 2 * ε) * U ^ (δ * m + ε) ≤
A * U ^ (δ * m + ε) := by
calc
_ = U ^ (δ * (r + m) - ε) := by rw [← Real.rpow_add hU0]; congr 1; ring
_ ≤ A * B := hprod
_ ≤ _ := mul_le_mul_of_nonneg_left hBcoarse hA
have hpos := Real.rpow_pos_of_pos hU0 (δ * m + ε)
nlinarith
have hlowerB : U ^ (δ * m - 2 * ε) ≤ B := by
have hp : U ^ (δ * m - 2 * ε) * U ^ (δ * r + ε) ≤
B * U ^ (δ * r + ε) := by
calc
_ = U ^ (δ * (r + m) - ε) := by rw [← Real.rpow_add hU0]; congr 1; ring
_ ≤ A * B := hprod
_ ≤ _ := by simpa [mul_comm] using mul_le_mul_of_nonneg_right hupperA hB
have hpos := Real.rpow_pos_of_pos hU0 (δ * r + ε)
nlinarith
exact ⟨hlength, hlowerA, hlowerB⟩
theorem inverse_length_of_saturation {r m t ε κ : ℝ}
(hsupport : t - κ ≤ r + m) (hplain : m ≤ 1 / 2 + 75 * ε) :
t - 1 / 2 - 75 * ε - κ ≤ r := by linarith
theorem complex_simultaneous_saturation {U δ r m ε : ℝ} {M S : ℂ}
(hU : 1 < U) (hδ : (1 / 50 : ℝ) ≤ δ) (hε : 0 ≤ ε)
(hprod : U ^ (δ * (r + m) - ε) ≤ ‖M * S‖ ^ 2)
(hupperM : ‖M‖ ^ 2 ≤ U ^ (δ * r + ε))
(hupperS : ‖S‖ ^ 2 ≤ U ^ (δ * min m (1 - m) + ε)) :
m ≤ 1 / 2 + 75 * ε ∧
U ^ (δ * r - 2 * ε) ≤ ‖M‖ ^ 2 ∧
U ^ (δ * m - 2 * ε) ≤ ‖S‖ ^ 2 := by
apply simultaneous_saturation hU hδ hε (sq_nonneg _) (sq_nonneg _)
_ hupperM hupperS
simpa only [norm_mul, mul_pow] using hprod
end SevenEighths.Detector
end OAI

Xet Storage Details

Size:
5.68 kB
·
Xet hash:
d50dd7a63b0034b0e70b49c38b207c9e068e00a93257828e43f11f642b0a6a84

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