internlm/Lean-Github huggingface dataset:
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
⊢ ∏ p ∈ Finset.range (2 * n / 3 + 1), p ^ n.centralBinom.factorization p =
    ∏ p ∈ Finset.range (2 * n + 1), p ^ n.centralBinom.factorization p
Tactic:
apply Finset.prod_subset
Proof state after:
case h
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
⊢ Finset.range (2 * n / 3 + 1) ⊆ Finset.range (2 * n + 1)

case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
⊢ ∀ x ∈ Finset.range (2 * n + 1), x ∉ Finset.range (2 * n / 3 + 1) → x ^ n.centralBinom.factorization x = 1
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
⊢ ∀ x ∈ Finset.range (2 * n + 1), x ∉ Finset.range (2 * n / 3 + 1) → x ^ n.centralBinom.factorization x = 1
Tactic:
intro x hx h2x
Proof state after:
case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
x : ℕ
hx : x ∈ Finset.range (2 * n + 1)
h2x : x ∉ Finset.range (2 * n / 3 + 1)
⊢ x ^ n.centralBinom.factorization x = 1
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
x : ℕ
hx : x ∈ Finset.range (2 * n + 1)
h2x : x ∉ Finset.range (2 * n / 3 + 1)
⊢ x ^ n.centralBinom.factorization x = 1
Tactic:
rw [Finset.mem_range, Nat.lt_succ_iff] at hx h2x
Proof state after:
case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
x : ℕ
hx : x ≤ 2 * n
h2x : ¬x ≤ 2 * n / 3
⊢ x ^ n.centralBinom.factorization x = 1
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
x : ℕ
hx : x ≤ 2 * n
h2x : ¬x ≤ 2 * n / 3
⊢ x ^ n.centralBinom.factorization x = 1
Tactic:
rw [not_le, div_lt_iff_lt_mul' three_pos, mul_comm x] at h2x
Proof state after:
case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
⊢ x ^ n.centralBinom.factorization x = 1
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
⊢ x ^ n.centralBinom.factorization x = 1
Tactic:
replace no_prime := not_exists.mp no_prime x
Proof state after:
case hf
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : ¬(x.Prime ∧ n < x ∧ x ≤ 2 * n)
⊢ x ^ n.centralBinom.factorization x = 1
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : ¬(x.Prime ∧ n < x ∧ x ≤ 2 * n)
⊢ x ^ n.centralBinom.factorization x = 1
Tactic:
rw [← and_assoc, not_and', not_and_or, not_lt] at no_prime
Proof state after:
case hf
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : x ≤ 2 * n → ¬x.Prime ∨ x ≤ n
⊢ x ^ n.centralBinom.factorization x = 1
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : x ≤ 2 * n → ¬x.Prime ∨ x ≤ n
⊢ x ^ n.centralBinom.factorization x = 1
Tactic:
cases' no_prime hx with h h
Proof state after:
case hf.inl
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : x ≤ 2 * n → ¬x.Prime ∨ x ≤ n
h : ¬x.Prime
⊢ x ^ n.centralBinom.factorization x = 1

case hf.inr
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : x ≤ 2 * n → ¬x.Prime ∨ x ≤ n
h : x ≤ n
⊢ x ^ n.centralBinom.factorization x = 1
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case h
n : ℕ
n_large : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
⊢ Finset.range (2 * n / 3 + 1) ⊆ Finset.range (2 * n + 1)
Tactic:
exact Finset.range_subset.2 (add_le_add_right (Nat.div_le_self _ _) _)
Proof state after:
no goals
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf.inl
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : x ≤ 2 * n → ¬x.Prime ∨ x ≤ n
h : ¬x.Prime
⊢ x ^ n.centralBinom.factorization x = 1
Tactic:
rw [factorization_eq_zero_of_non_prime n.centralBinom h, Nat.pow_zero]
Proof state after:
no goals
Theorem: chapter02.centralBinom_factorization_small
Proof state before:
case hf.inr
n : ℕ
n_large : 2 < n
x : ℕ
hx : x ≤ 2 * n
h2x : 2 * n < 3 * x
no_prime : x ≤ 2 * n → ¬x.Prime ∨ x ≤ n
h : x ≤ n
⊢ x ^ n.centralBinom.factorization x = 1
Tactic:
rw [factorization_centralBinom_of_two_mul_self_lt_three_mul n_large h h2x, Nat.pow_zero]
Proof state after:
no goals
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Tactic:
have n_pos : 0 < n := (Nat.zero_le _).trans_lt n_big
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Tactic:
have n2_pos : 1 ≤ 2 * n := mul_pos (zero_lt_two' ℕ) n_pos
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Tactic:
let S := (Finset.range (2 * n / 3 + 1)).filter Nat.Prime
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Tactic:
let f x := x ^ n.centralBinom.factorization x
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Tactic:
have : ∏ x : ℕ in S, f x = ∏ x : ℕ in Finset.range (2 * n / 3 + 1), f x := by
  refine' Finset.prod_filter_of_ne fun p _ h => _
  contrapose! h
  dsimp [f]
  rw [factorization_eq_zero_of_non_prime n.centralBinom h, _root_.pow_zero]
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ (∏ x ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S, f x) * ∏ x ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S, f x ≤
    (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)
Tactic:
apply mul_le_mul'
Proof state after:
case h₁
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ x ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S, f x ≤ (2 * n) ^ (2 * n).sqrt

case h₂
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ x ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S, f x ≤ 4 ^ (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
⊢ ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
Tactic:
refine' Finset.prod_filter_of_ne fun p _ h => _
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
p : ℕ
x✝ : p ∈ Finset.range (2 * n / 3 + 1)
h : f p ≠ 1
⊢ p.Prime
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
p : ℕ
x✝ : p ∈ Finset.range (2 * n / 3 + 1)
h : f p ≠ 1
⊢ p.Prime
Tactic:
contrapose! h
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
p : ℕ
x✝ : p ∈ Finset.range (2 * n / 3 + 1)
h : ¬p.Prime
⊢ f p = 1
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
p : ℕ
x✝ : p ∈ Finset.range (2 * n / 3 + 1)
h : ¬p.Prime
⊢ f p = 1
Tactic:
dsimp [f]
Proof state after:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
p : ℕ
x✝ : p ∈ Finset.range (2 * n / 3 + 1)
h : ¬p.Prime
⊢ p ^ n.centralBinom.factorization p = 1
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
p : ℕ
x✝ : p ∈ Finset.range (2 * n / 3 + 1)
h : ¬p.Prime
⊢ p ^ n.centralBinom.factorization p = 1
Tactic:
rw [factorization_eq_zero_of_non_prime n.centralBinom h, _root_.pow_zero]
Proof state after:
no goals
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₁
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ x ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S, f x ≤ (2 * n) ^ (2 * n).sqrt
Tactic:
refine' (Finset.prod_le_prod' fun p _ => (_ : f p ≤ 2 * n)).trans _
Proof state after:
case h₁.refine'_1
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
p : ℕ
x✝ : p ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S
⊢ f p ≤ 2 * n

case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ i ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S, 2 * n ≤ (2 * n) ^ (2 * n).sqrt
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ i ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S, 2 * n ≤ (2 * n) ^ (2 * n).sqrt
Tactic:
have : (Finset.Icc 1 (Nat.sqrt (2 * n))).card = Nat.sqrt (2 * n) := by rw [card_Icc, Nat.add_sub_cancel]
Proof state after:
case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
⊢ ∏ i ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S, 2 * n ≤ (2 * n) ^ (2 * n).sqrt
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
⊢ ∏ i ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S, 2 * n ≤ (2 * n) ^ (2 * n).sqrt
Tactic:
rw [Finset.prod_const]
Proof state after:
case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
⊢ (2 * n) ^ (Finset.filter (fun x => x ≤ (2 * n).sqrt) S).card ≤ (2 * n) ^ (2 * n).sqrt
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
⊢ (2 * n) ^ (Finset.filter (fun x => x ≤ (2 * n).sqrt) S).card ≤ (2 * n) ^ (2 * n).sqrt
Tactic:
refine' pow_le_pow_right n2_pos ((Finset.card_le_card fun x hx => _).trans this.le)
Proof state after:
case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
x : ℕ
hx : x ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S
⊢ x ∈ Finset.Icc 1 (2 * n).sqrt
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₁.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
x : ℕ
hx : x ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S
⊢ x ∈ Finset.Icc 1 (2 * n).sqrt
Tactic:
obtain ⟨h1, h2⟩ := Finset.mem_filter.1 hx
Proof state after:
case h₁.refine'_2.intro
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
x : ℕ
hx : x ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S
h1 : x ∈ S
h2 : x ≤ (2 * n).sqrt
⊢ x ∈ Finset.Icc 1 (2 * n).sqrt
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₁.refine'_2.intro
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this✝ : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
this : (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
x : ℕ
hx : x ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S
h1 : x ∈ S
h2 : x ≤ (2 * n).sqrt
⊢ x ∈ Finset.Icc 1 (2 * n).sqrt
Tactic:
exact Finset.mem_Icc.mpr ⟨(Finset.mem_filter.1 h1).2.one_lt.le, h2⟩
Proof state after:
no goals
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₁.refine'_1
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
p : ℕ
x✝ : p ∈ Finset.filter (fun x => x ≤ (2 * n).sqrt) S
⊢ f p ≤ 2 * n
Tactic:
exact pow_factorization_choose_le (mul_pos two_pos n_pos)
Proof state after:
no goals
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ (Finset.Icc 1 (2 * n).sqrt).card = (2 * n).sqrt
Tactic:
rw [card_Icc, Nat.add_sub_cancel]
Proof state after:
no goals
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₂
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ x ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S, f x ≤ 4 ^ (2 * n / 3)
Tactic:
refine' le_trans _ (primorial_le_4_pow (2 * n / 3))
Proof state after:
case h₂
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ x ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S, f x ≤ primorial (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₂
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ x ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S, f x ≤ primorial (2 * n / 3)
Tactic:
refine' (Finset.prod_le_prod' fun p hp => (_ : f p ≤ p)).trans _
Proof state after:
case h₂.refine'_1
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
p : ℕ
hp : p ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S
⊢ f p ≤ p

case h₂.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ i ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S, i ≤ primorial (2 * n / 3)
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₂.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∏ i ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S, i ≤ primorial (2 * n / 3)
Tactic:
refine' Finset.prod_le_prod_of_subset_of_one_le' (Finset.filter_subset _ _) _
Proof state after:
case h₂.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∀ i ∈ Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1)), i ∉ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S → 1 ≤ i
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₂.refine'_2
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
⊢ ∀ i ∈ Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1)), i ∉ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S → 1 ≤ i
Tactic:
exact fun p hp _ => (Finset.mem_filter.1 hp).2.one_lt.le
Proof state after:
no goals
Theorem: chapter02.centralBinom_le_of_no_bertrand_prime
Proof state before:
case h₂.refine'_1
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
p : ℕ
hp : p ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S
⊢ f p ≤ p
Tactic:
obtain ⟨h1, h2⟩ := Finset.mem_filter.1 hp
Proof state after:
case h₂.refine'_1.intro
n : ℕ
n_big : 2 < n
no_prime : ¬∃ p, p.Prime ∧ n < p ∧ p ≤ 2 * n
n_pos : 0 < n
n2_pos : 1 ≤ 2 * n
S : Finset ℕ := Finset.filter Nat.Prime (Finset.range (2 * n / 3 + 1))
f : ℕ → ℕ := fun x => x ^ n.centralBinom.factorization x
this : ∏ x ∈ S, f x = ∏ x ∈ Finset.range (2 * n / 3 + 1), f x
p : ℕ
hp : p ∈ Finset.filter (fun x => ¬x ≤ (2 * n).sqrt) S
h1 : p ∈ S
h2 : ¬p ≤ (2 * n).sqrt
⊢ f p ≤ p