Theorem: Behrend.exists_large_sphere
File: Mathlib/Combinatorics/Additive/Behrend.lean

tactic: obtain ⟨k, -, hk⟩ := exists_large_sphere_aux n d
state_before: α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k N : ℕ
x : Fin n✝ → ℕ
n d : ℕ
⊢ ∃ k, ↑d ^ ↑n / ↑(n * d ^ 2) ≤ ↑(card (sphere n d k))

tactic: refine' ⟨k, _⟩
state_before: case intro.intro
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
⊢ ∃ k, ↑d ^ ↑n / ↑(n * d ^ 2) ≤ ↑(card (sphere n d k))

tactic: obtain rfl | hn := n.eq_zero_or_pos
state_before: case intro.intro
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
⊢ ↑d ^ ↑n / ↑(n * d ^ 2) ≤ ↑(card (sphere n d k))

tactic: obtain rfl | hd := d.eq_zero_or_pos
state_before: case intro.intro.inr
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
⊢ ↑d ^ ↑n / ↑(n * d ^ 2) ≤ ↑(card (sphere n d k))

tactic: rw [rpow_nat_cast, ← cast_pow]
state_before: case intro.intro.inr.inr
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ ↑d ^ ↑n / ↑(n * d ^ 2) ≤ ↑(card (sphere n d k))

tactic: refine' (div_le_div_of_le_left _ _ _).trans hk
state_before: case intro.intro.inr.inr
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ ↑(d ^ n) / ↑(n * d ^ 2) ≤ ↑(card (sphere n d k))

tactic: simp only [← le_sub_iff_add_le', cast_mul, ← mul_sub, cast_pow, cast_sub hd, sub_sq, one_pow,
  cast_one, mul_one, sub_add, sub_sub_self]
state_before: case intro.intro.inr.inr.refine'_3
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ ↑(n * (d - 1) ^ 2) + 1 ≤ ↑(n * d ^ 2)

tactic: apply one_le_mul_of_one_le_of_one_le
state_before: case intro.intro.inr.inr.refine'_3
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ 1 ≤ ↑n * (2 * ↑d * ↑(succ 0) - ↑(succ 0) ^ 2)

tactic: rw [← one_eq_succ_zero, _root_.le_sub_iff_add_le]
state_before: case intro.intro.inr.inr.refine'_3.hb
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ 1 ≤ 2 * ↑d * ↑(succ 0) - ↑(succ 0) ^ 2

tactic: norm_num
state_before: case intro.intro.inr.inr.refine'_3.hb
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ 1 + ↑1 ^ 2 ≤ 2 * ↑d * ↑1

tactic: exact one_le_cast.2 hd
state_before: case intro.intro.inr.inr.refine'_3.hb
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ 1 ≤ d

tactic: simp
state_before: case intro.intro.inl
α : Type ?u.568071
β : Type ?u.568074
n d✝ k✝ N : ℕ
x : Fin n → ℕ
d k : ℕ
hk : ↑(d ^ 0) / (↑(0 * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere 0 d k))
⊢ ↑d ^ ↑0 / ↑(0 * d ^ 2) ≤ ↑(card (sphere 0 d k))

tactic: simp
state_before: case intro.intro.inr.inl
α : Type ?u.568071
β : Type ?u.568074
n✝ d k✝ N : ℕ
x : Fin n✝ → ℕ
n k : ℕ
hn : n > 0
hk : ↑(0 ^ n) / (↑(n * (0 - 1) ^ 2) + 1) ≤ ↑(card (sphere n 0 k))
⊢ ↑0 ^ ↑n / ↑(n * 0 ^ 2) ≤ ↑(card (sphere n 0 k))

tactic: exact cast_nonneg _
state_before: case intro.intro.inr.inr.refine'_1
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ 0 ≤ ↑(d ^ n)

tactic: exact cast_add_one_pos _
state_before: case intro.intro.inr.inr.refine'_2
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ 0 < ↑(n * (d - 1) ^ 2) + 1

tactic: rwa [one_le_cast]
state_before: case intro.intro.inr.inr.refine'_3.ha
α : Type ?u.568071
β : Type ?u.568074
n✝ d✝ k✝ N : ℕ
x : Fin n✝ → ℕ
n d k : ℕ
hk : ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(card (sphere n d k))
hn : n > 0
hd : d > 0
⊢ 1 ≤ ↑n