| 1 | module |
| 2 | |
| 3 | public import Mathlib |
| 4 | |
| 5 | @[expose] public section |
| 6 | |
| 7 | /-! |
| 8 | # Erdős 424: definitions used by the tools |
| 9 | -/ |
| 10 | |
| 11 | set_option linter.style.header false |
| 12 | open Finset |
| 13 | |
| 14 | namespace E424 |
| 15 | |
| 16 | /-- `n^{-it}` as `exp(-(t log n) i)`. -/ |
| 17 | noncomputable def nit (n : ℕ) (t : ℝ) : ℂ := Complex.exp (-(t * Real.log n : ℝ) * Complex.I) |
| 18 | |
| 19 | /-- `e(x) = exp(2πix)`. -/ |
| 20 | noncomputable def ee (x : ℝ) : ℂ := Complex.exp ((2 * Real.pi * x : ℝ) * Complex.I) |
| 21 | |
| 22 | /-- Every prime factor of `n` exceeds `z`. (`0` is never rough for `z ≥ 2`, `1` always is.) -/ |
| 23 | def Rough (z : ℝ) (n : ℕ) : Prop := ∀ p : ℕ, p.Prime → p ∣ n → z < p |
| 24 | |
| 25 | /-- The primes of `(u, v]` (`0 ≤ u`). -/ |
| 26 | noncomputable def primesIoc (u v : ℝ) : Finset ℕ := (Ioc ⌊u⌋₊ ⌊v⌋₊).filter Nat.Prime |
| 27 | |
| 28 | /-- The triangle kernel `ψ_Q(u) = Q (1 - Q|u|)_+`. -/ |
| 29 | noncomputable def tri (Q u : ℝ) : ℝ := Q * max 0 (1 - Q * |u|) |
| 30 | |
| 31 | end E424 |
| 32 | |