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

tactic: apply div_lt_floor _
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ ↑N ^ (↑(nValue N))⁻¹ / rexp 1 < ↑(dValue N)
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 2 / (1 - 2 / rexp 1) ≤ ↑N ^ (↑(nValue N))⁻¹

tactic: rw [← log_le_log_iff, log_rpow, mul_comm, ← div_eq_mul_inv]
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 2 / (1 - 2 / rexp 1) ≤ ↑N ^ (↑(nValue N))⁻¹
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) ≤ log ↑N / ↑(nValue N)

case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < ↑N

case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 2 / (1 - 2 / rexp 1)

case h₁
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < ↑N ^ (↑(nValue N))⁻¹

tactic: positivity
state_before: case h₁
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < ↑N ^ (↑(nValue N))⁻¹
state_after: no goals

tactic: apply le_trans _ (div_le_div_of_nonneg_left _ _ (ceil_lt_mul _).le)
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) ≤ log ↑N / ↑(nValue N)
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) ≤ log ↑N / (1.38 * √(log ↑N))

α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 ≤ log ↑N

α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < ↑⌈√(log ↑N)⌉₊

α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 50 / 19 ≤ √(log ↑N)

tactic: apply le_sqrt_of_sq_le
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 50 / 19 ≤ √(log ↑N)
state_after: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ (50 / 19) ^ 2 ≤ log ↑N

tactic: have : (12 : ℕ) * log 2 ≤ log N := by
  rw [← log_rpow zero_lt_two, rpow_natCast]
  exact log_le_log (by positivity) (mod_cast hN)
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ (50 / 19) ^ 2 ≤ log ↑N
state_after: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ (50 / 19) ^ 2 ≤ log ↑N

tactic: refine le_trans ?_ this
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ (50 / 19) ^ 2 ≤ log ↑N
state_after: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ (50 / 19) ^ 2 ≤ ↑12 * log 2

tactic: rw [← div_le_iff']
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ (50 / 19) ^ 2 ≤ ↑12 * log 2
state_after: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ (50 / 19) ^ 2 / ↑12 ≤ log 2

case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ 0 < ↑12

tactic: rw [mul_comm, ← div_div, div_sqrt, le_div_iff]
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) ≤ log ↑N / (1.38 * √(log ↑N))
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) * 1.38 ≤ √(log ↑N)

α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 1.38

tactic: norm_num
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) * 1.38 ≤ √(log ↑N)
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) * (69 / 50) ≤ √(log ↑N)

tactic: exact le_sqrt_log hN
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 / (1 - 2 / rexp 1)) * (69 / 50) ≤ √(log ↑N)
state_after: no goals

tactic: norm_num1
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 1.38
state_after: no goals

tactic: apply log_nonneg
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 ≤ log ↑N
state_after: case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 ≤ ↑N

tactic: rw [one_le_cast]
state_before: case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 ≤ ↑N
state_after: case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 ≤ N

tactic: exact hN.trans' (by norm_num1)
state_before: case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 ≤ N
state_after: no goals

tactic: norm_num1
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 ≤ 4096
state_after: no goals

tactic: rw [cast_pos, lt_ceil, cast_zero, Real.sqrt_pos]
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < ↑⌈√(log ↑N)⌉₊
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < log ↑N

tactic: refine log_pos ?_
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < log ↑N
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 < ↑N

tactic: rw [one_lt_cast]
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 < ↑N
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 < N

tactic: exact hN.trans_lt' (by norm_num1)
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 < N
state_after: no goals

tactic: norm_num1
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 1 < 4096
state_after: no goals

tactic: rw [← log_rpow zero_lt_two, rpow_natCast]
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ ↑12 * log 2 ≤ log ↑N
state_after: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 ^ 12) ≤ log ↑N

tactic: exact log_le_log (by positivity) (mod_cast hN)
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ log (2 ^ 12) ≤ log ↑N
state_after: no goals

tactic: positivity
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 2 ^ 12
state_after: no goals

tactic: exact log_two_gt_d9.le.trans' (by norm_num1)
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ (50 / 19) ^ 2 / ↑12 ≤ log 2
state_after: no goals

tactic: norm_num1
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ (50 / 19) ^ 2 / ↑12 ≤ 0.6931471803
state_after: no goals

tactic: norm_num1
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
this : ↑12 * log 2 ≤ log ↑N
⊢ 0 < ↑12
state_after: no goals

tactic: rw [cast_pos]
state_before: case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < ↑N
state_after: case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < N

tactic: exact hN.trans_lt' (by norm_num1)
state_before: case hx
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < N
state_after: no goals

tactic: norm_num1
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 4096
state_after: no goals

tactic: refine div_pos zero_lt_two ?_
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 2 / (1 - 2 / rexp 1)
state_after: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 1 - 2 / rexp 1

tactic: rw [sub_pos, div_lt_one (exp_pos _)]
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 0 < 1 - 2 / rexp 1
state_after: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 2 < rexp 1

tactic: exact lt_of_le_of_lt (by norm_num1) exp_one_gt_d9
state_before: case h
α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 2 < rexp 1
state_after: no goals

tactic: norm_num1
state_before: α : Type u_1
β : Type u_2
n d k N : ℕ
x : Fin n → ℕ
hN : 4096 ≤ N
⊢ 2 ≤ 2.7182818283
state_after: no goals