File: Mathlib/Combinatorics/Additive/AP/Three/Behrend.lean

full_name: threeAPFree_frontier
code: /-- The frontier of a closed strictly convex set only contains trivial arithmetic progressions.
The idea is that an arithmetic progression is contained on a line and the frontier of a strictly
convex set does not contain lines. -/
lemma threeAPFree_frontier {𝕜 E : Type*} [LinearOrderedField 𝕜] [TopologicalSpace E]
    [AddCommMonoid E] [Module 𝕜 E] {s : Set E} (hs₀ : IsClosed s) (hs₁ : StrictConvex 𝕜 s) :
    ThreeAPFree (frontier s) 
goal: ThreeAPFree (frontier s)

full_name: threeAPFree_sphere
code: lemma threeAPFree_sphere {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [StrictConvexSpace ℝ E] (x : E) (r : ℝ) : ThreeAPFree (sphere x r) 
goal: ThreeAPFree (Metric.sphere x r)

full_name: Behrend.box
code: /-- The box `{0, ..., d - 1}^n` as a `Finset`. -/
def box (n d : ℕ) : Finset (Fin n → ℕ) 
goal: Finset (Fin n → ℕ)

full_name: Behrend.mem_box
code: theorem mem_box : x ∈ box n d ↔ ∀ i, x i < d 
goal: x ∈ Behrend.box n d ↔ ∀ (i : Fin n), x i < d

full_name: Behrend.card_box
code: @[simp]
theorem card_box : (box n d).card = d ^ n 
goal: (Behrend.box n d).card = d ^ n

full_name: Behrend.box_zero
code: @[simp]
theorem box_zero : box (n + 1) 0 = ∅ 
goal: Behrend.box (n + 1) 0 = ∅

full_name: Behrend.sphere
code: /-- The intersection of the sphere of radius `√k` with the integer points in the positive
quadrant. -/
def sphere (n d k : ℕ) : Finset (Fin n → ℕ) 
goal: Finset (Fin n → ℕ)

full_name: Behrend.sphere_zero_subset
code: theorem sphere_zero_subset : sphere n d 0 ⊆ 0 
goal: Behrend.sphere n d 0 ⊆ 0

full_name: Behrend.sphere_zero_right
code: @[simp]
theorem sphere_zero_right (n k : ℕ) : sphere (n + 1) 0 k = ∅ 
goal: Behrend.sphere (n + 1) 0 k = ∅

full_name: Behrend.sphere_subset_box
code: theorem sphere_subset_box : sphere n d k ⊆ box n d 
goal: Behrend.sphere n d k ⊆ Behrend.box n d

full_name: Behrend.norm_of_mem_sphere
code: theorem norm_of_mem_sphere {x : Fin n → ℕ} (hx : x ∈ sphere n d k) :
    ‖(WithLp.equiv 2 _).symm ((↑) ∘ x : Fin n → ℝ)‖ = √↑k 
goal: ‖(WithLp.equiv 2 (Fin n → ℝ)).symm (Nat.cast ∘ x)‖ = √↑k

full_name: Behrend.sphere_subset_preimage_metric_sphere
code: theorem sphere_subset_preimage_metric_sphere : (sphere n d k : Set (Fin n → ℕ)) ⊆
    (fun x : Fin n → ℕ => (WithLp.equiv 2 _).symm ((↑) ∘ x : Fin n → ℝ)) ⁻¹'
      Metric.sphere (0 : PiLp 2 fun _ : Fin n => ℝ) (√↑k) 
goal: ↑(Behrend.sphere n d k) ⊆ (fun x => (WithLp.equiv 2 (Fin n → ℝ)).symm (Nat.cast ∘ x)) ⁻¹' Metric.sphere 0 √↑k

full_name: Behrend.map_apply
code: /-- The map that appears in Behrend's bound on Roth numbers. -/
@[simps]
def map (d : ℕ) : (Fin n → ℕ) →+ ℕ 
goal: (Behrend.map d) a = ∑ i : Fin n, a i * d ^ ↑i

full_name: Behrend.map
code: /-- The map that appears in Behrend's bound on Roth numbers. -/
@[simps]
def map (d : ℕ) : (Fin n → ℕ) →+ ℕ 
goal: (Fin n → ℕ) →+ ℕ

full_name: Behrend.map_zero
code: theorem map_zero (d : ℕ) (a : Fin 0 → ℕ) : map d a = 0 
goal: (Behrend.map d) a = 0

full_name: Behrend.map_succ
code: theorem map_succ (a : Fin (n + 1) → ℕ) :
    map d a = a 0 + (∑ x : Fin n, a x.succ * d ^ (x : ℕ)) * d 
goal: (Behrend.map d) a = a 0 + (∑ x : Fin n, a x.succ * d ^ ↑x) * d

full_name: Behrend.map_succ'
code: theorem map_succ' (a : Fin (n + 1) → ℕ) : map d a = a 0 + map d (a ∘ Fin.succ) * d 
goal: (Behrend.map d) a = a 0 + (Behrend.map d) (a ∘ Fin.succ) * d

full_name: Behrend.map_monotone
code: theorem map_monotone (d : ℕ) : Monotone (map d : (Fin n → ℕ) → ℕ) 
goal: Monotone ⇑(Behrend.map d)

full_name: Behrend.map_mod
code: theorem map_mod (a : Fin n.succ → ℕ) : map d a % d = a 0 % d 
goal: (Behrend.map d) a % d = a 0 % d

full_name: Behrend.map_eq_iff
code: theorem map_eq_iff {x₁ x₂ : Fin n.succ → ℕ} (hx₁ : ∀ i, x₁ i < d) (hx₂ : ∀ i, x₂ i < d) :
    map d x₁ = map d x₂ ↔ x₁ 0 = x₂ 0 ∧ map d (x₁ ∘ Fin.succ) = map d (x₂ ∘ Fin.succ) 
goal: (Behrend.map d) x₁ = (Behrend.map d) x₂ ↔
  x₁ 0 = x₂ 0 ∧ (Behrend.map d) (x₁ ∘ Fin.succ) = (Behrend.map d) (x₂ ∘ Fin.succ)

full_name: Behrend.map_injOn
code: theorem map_injOn : {x : Fin n → ℕ | ∀ i, x i < d}.InjOn (map d) 
goal: Set.InjOn ⇑(Behrend.map d) {x | ∀ (i : Fin n), x i < d}

full_name: Behrend.map_le_of_mem_box
code: theorem map_le_of_mem_box (hx : x ∈ box n d) :
    map (2 * d - 1) x ≤ ∑ i : Fin n, (d - 1) * (2 * d - 1) ^ (i : ℕ) 
goal: (Behrend.map (2 * d - 1)) x ≤ ∑ i : Fin n, (d - 1) * (2 * d - 1) ^ ↑i

full_name: Behrend.threeAPFree_sphere
code: nonrec theorem threeAPFree_sphere : ThreeAPFree (sphere n d k : Set (Fin n → ℕ)) 
goal: ThreeAPFree ↑(Behrend.sphere n d k)

full_name: Behrend.threeAPFree_image_sphere
code: theorem threeAPFree_image_sphere :
    ThreeAPFree ((sphere n d k).image (map (2 * d - 1)) : Set ℕ) 
goal: ThreeAPFree ↑(Finset.image (⇑(Behrend.map (2 * d - 1))) (Behrend.sphere n d k))

full_name: Behrend.sum_sq_le_of_mem_box
code: theorem sum_sq_le_of_mem_box (hx : x ∈ box n d) : ∑ i : Fin n, x i ^ 2 ≤ n * (d - 1) ^ 2 
goal: ∑ i : Fin n, x i ^ 2 ≤ n * (d - 1) ^ 2

full_name: Behrend.sum_eq
code: theorem sum_eq : (∑ i : Fin n, d * (2 * d + 1) ^ (i : ℕ)) = ((2 * d + 1) ^ n - 1) / 2 
goal: ∑ i : Fin n, d * (2 * d + 1) ^ ↑i = ((2 * d + 1) ^ n - 1) / 2

full_name: Behrend.sum_lt
code: theorem sum_lt : (∑ i : Fin n, d * (2 * d + 1) ^ (i : ℕ)) < (2 * d + 1) ^ n 
goal: ∑ i : Fin n, d * (2 * d + 1) ^ ↑i < (2 * d + 1) ^ n

full_name: Behrend.card_sphere_le_rothNumberNat
code: theorem card_sphere_le_rothNumberNat (n d k : ℕ) :
    (sphere n d k).card ≤ rothNumberNat ((2 * d - 1) ^ n) 
goal: (Behrend.sphere n d k).card ≤ rothNumberNat ((2 * d - 1) ^ n)

full_name: Behrend.exists_large_sphere_aux
code: theorem exists_large_sphere_aux (n d : ℕ) : ∃ k ∈ range (n * (d - 1) ^ 2 + 1),
    (↑(d ^ n) / ((n * (d - 1) ^ 2 :) + 1) : ℝ) ≤ (sphere n d k).card 
goal: ∃ k ∈ Finset.range (n * (d - 1) ^ 2 + 1), ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(Behrend.sphere n d k).card

full_name: Behrend.exists_large_sphere
code: theorem exists_large_sphere (n d : ℕ) :
    ∃ k, ((d ^ n :) / (n * d ^ 2 :) : ℝ) ≤ (sphere n d k).card 
goal: ∃ k, ↑(d ^ n) / ↑(n * d ^ 2) ≤ ↑(Behrend.sphere n d k).card

full_name: Behrend.bound_aux'
code: theorem bound_aux' (n d : ℕ) : ((d ^ n :) / (n * d ^ 2 :) : ℝ) ≤ rothNumberNat ((2 * d - 1) ^ n) 
goal: ↑(d ^ n) / ↑(n * d ^ 2) ≤ ↑(rothNumberNat ((2 * d - 1) ^ n))

full_name: Behrend.bound_aux
code: theorem bound_aux (hd : d ≠ 0) (hn : 2 ≤ n) :
    (d ^ (n - 2 :) / n : ℝ) ≤ rothNumberNat ((2 * d - 1) ^ n) 
goal: ↑d ^ (n - 2) / ↑n ≤ ↑(rothNumberNat ((2 * d - 1) ^ n))

full_name: Behrend.log_two_mul_two_le_sqrt_log_eight
code: theorem log_two_mul_two_le_sqrt_log_eight : log 2 * 2 ≤ √(log 8) 
goal: Real.log 2 * 2 ≤ √(Real.log 8)

full_name: Behrend.two_div_one_sub_two_div_e_le_eight
code: theorem two_div_one_sub_two_div_e_le_eight : 2 / (1 - 2 / exp 1) ≤ 8 
goal: 2 / (1 - 2 / rexp 1) ≤ 8

full_name: Behrend.le_sqrt_log
code: theorem le_sqrt_log (hN : 4096 ≤ N) : log (2 / (1 - 2 / exp 1)) * (69 / 50) ≤ √(log ↑N) 
goal: Real.log (2 / (1 - 2 / rexp 1)) * (69 / 50) ≤ √(Real.log ↑N)

full_name: Behrend.exp_neg_two_mul_le
code: theorem exp_neg_two_mul_le {x : ℝ} (hx : 0 < x) : exp (-2 * x) < exp (2 - ⌈x⌉₊) / ⌈x⌉₊ 
goal: rexp (-2 * x) < rexp (2 - ↑⌈x⌉₊) / ↑⌈x⌉₊

full_name: Behrend.div_lt_floor
code: theorem div_lt_floor {x : ℝ} (hx : 2 / (1 - 2 / exp 1) ≤ x) : x / exp 1 < (⌊x / 2⌋₊ : ℝ) 
goal: x / rexp 1 < ↑⌊x / 2⌋₊

full_name: Behrend.ceil_lt_mul
code: theorem ceil_lt_mul {x : ℝ} (hx : 50 / 19 ≤ x) : (⌈x⌉₊ : ℝ) < 1.38 * x 
goal: ↑⌈x⌉₊ < 1.38 * x

full_name: Behrend.nValue
code: /-- The (almost) optimal value of `n` in `Behrend.bound_aux`. -/
noncomputable def nValue (N : ℕ) : ℕ 
goal: ℕ

full_name: Behrend.dValue
code: /-- The (almost) optimal value of `d` in `Behrend.bound_aux`. -/
noncomputable def dValue (N : ℕ) : ℕ 
goal: ℕ

full_name: Behrend.nValue_pos
code: theorem nValue_pos (hN : 2 ≤ N) : 0 < nValue N 
goal: 0 < Behrend.nValue N

full_name: Behrend.three_le_nValue
code: theorem three_le_nValue (hN : 64 ≤ N) : 3 ≤ nValue N 
goal: 3 ≤ Behrend.nValue N

full_name: Behrend.dValue_pos
code: theorem dValue_pos (hN₃ : 8 ≤ N) : 0 < dValue N 
goal: 0 < Behrend.dValue N

full_name: Behrend.le_N
code: theorem le_N (hN : 2 ≤ N) : (2 * dValue N - 1) ^ nValue N ≤ N 
goal: (2 * Behrend.dValue N - 1) ^ Behrend.nValue N ≤ N

full_name: Behrend.bound
code: theorem bound (hN : 4096 ≤ N) : (N : ℝ) ^ (nValue N : ℝ)⁻¹ / exp 1 < dValue N 
goal: ↑N ^ (↑(Behrend.nValue N))⁻¹ / rexp 1 < ↑(Behrend.dValue N)

full_name: Behrend.roth_lower_bound_explicit
code: theorem roth_lower_bound_explicit (hN : 4096 ≤ N) :
    (N : ℝ) * exp (-4 * √(log N)) < rothNumberNat N 
goal: ↑N * rexp (-4 * √(Real.log ↑N)) < ↑(rothNumberNat N)

full_name: Behrend.exp_four_lt
code: theorem exp_four_lt : exp 4 < 64 
goal: rexp 4 < 64

full_name: Behrend.four_zero_nine_six_lt_exp_sixteen
code: theorem four_zero_nine_six_lt_exp_sixteen : 4096 < exp 16 
goal: 4096 < rexp 16

full_name: Behrend.lower_bound_le_one'
code: theorem lower_bound_le_one' (hN : 2 ≤ N) (hN' : N ≤ 4096) :
    (N : ℝ) * exp (-4 * √(log N)) ≤ 1 
goal: ↑N * rexp (-4 * √(Real.log ↑N)) ≤ 1

full_name: Behrend.lower_bound_le_one
code: theorem lower_bound_le_one (hN : 1 ≤ N) (hN' : N ≤ 4096) :
    (N : ℝ) * exp (-4 * √(log N)) ≤ 1 
goal: ↑N * rexp (-4 * √(Real.log ↑N)) ≤ 1

full_name: Behrend.roth_lower_bound
code: theorem roth_lower_bound : (N : ℝ) * exp (-4 * √(log N)) ≤ rothNumberNat N 
goal: ↑N * rexp (-4 * √(Real.log ↑N)) ≤ ↑(rothNumberNat N)