Lean / janjarosz05/0kwas / Erdos1093Family.lean
Lean readerKwas/Erdos1093Family.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Kwas.Erdos1093, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import Kwas.Erdos1093/-! Erdős Problem 1093: the binomial coefficients `C(M_k + k - 1, k)`, where`M_k = ∏_{p ≤ k} p ^ (⌊log_p k⌋ + 1)`, are divisible by every prime `p ≤ k`.So none of them is "good" (all prime factors `> k`), and their deficiency is undefined. This is the familyproposed in arXiv:2609.25042v1 as an infinite family of good coefficients of deficiency one; the author withdrewthat paper (v2, 2 November 2026), stating that its Theorem 1.1 does not hold. -/namespace Erdos1093/-- If `p ^ r ∣ M` and `0 < k < p ^ r`, then `p ∣ C(M + k - 1, k)`.Proof: `C(n, k) * k = C(n, k - 1) * (n - k + 1)` with `n - k + 1 = M`. -/theorem dvd_choose_of_pow_dvd {p r M k : ℕ} (hp : p.Prime) (hM : p ^ r ∣ M) (hk0 : 0 < k)(hk : k < p ^ r) : p ∣ (M + k - 1).choose k := byobtain ⟨j, rfl⟩ : ∃ j, k = j + 1 := ⟨k - 1, by omega⟩have e : M + (j + 1) - 1 = M + j := by omegarw [e]by_contra hndhave hcop : Nat.Coprime (p ^ r) ((M + j).choose (j + 1)) :=Nat.Coprime.pow_left r ((Nat.Prime.coprime_iff_not_dvd hp).2 hnd)have h := Nat.choose_succ_right_eq (M + j) jhave hdvd : p ^ r ∣ (M + j).choose (j + 1) * (j + 1) := byrw [h, Nat.add_sub_cancel]exact Dvd.dvd.mul_left hM _have h2 : p ^ r ∣ j + 1 := hcop.dvd_of_dvd_mul_left hdvdhave := Nat.le_of_dvd (by omega) h2omega/-- `M_k = ∏_{p ≤ k, p prime} p ^ (⌊log_p k⌋ + 1)`. -/def bigM (k : ℕ) : ℕ := ∏ p ∈ (Finset.range (k + 1)).filter Nat.Prime, p ^ (Nat.log p k + 1)/-- Every prime `p ≤ k` divides `C(M_k + k - 1, k)`. -/theorem prime_dvd_choose_bigM {k p : ℕ} (hk : 0 < k) (hp : p.Prime) (hpk : p ≤ k) :p ∣ (bigM k + k - 1).choose k := byrefine dvd_choose_of_pow_dvd (r := Nat.log p k + 1) hp ?_ hk (Nat.lt_pow_succ_log_self hp.one_lt k)exact Finset.dvd_prod_of_mem (fun q => q ^ (Nat.log q k + 1))(Finset.mem_filter.2 ⟨Finset.mem_range.2 (by omega), hp⟩)/-- For every `k ≥ 2` the coefficient `C(M_k + k - 1, k)` is even. -/theorem two_dvd_choose_bigM {k : ℕ} (hk : 2 ≤ k) : 2 ∣ (bigM k + k - 1).choose k :=prime_dvd_choose_bigM (by omega) Nat.prime_two hk/-- For every `k ≥ 2` the least prime factor of `C(M_k + k - 1, k)` is `2 ≤ k`: the coefficient is not good. -/theorem minFac_choose_bigM {k : ℕ} (hk : 2 ≤ k) : ((bigM k + k - 1).choose k).minFac = 2 :=(Nat.minFac_eq_two_iff _).2 (two_dvd_choose_bigM hk)/-- No `k ≥ 2` gives a coefficient `C(M_k + k - 1, k)` all of whose prime factors exceed `k`. -/theorem not_good_choose_bigM {k : ℕ} (hk : 2 ≤ k) :¬ ∀ q : ℕ, q.Prime → q ∣ (bigM k + k - 1).choose k → k < q := byintro hhave := h 2 Nat.prime_two (two_dvd_choose_bigM hk)omega/-- More generally, `M_k` is never one of the `k` terms `n, n - 1, …, n - k + 1` of a coefficient `C(n, k)`with no prime factor `≤ k`, whatever its position in the window: a prime power `p ^ e > k` with `p ≤ k`cannot divide a term (`prime_pow_le_of_dvd_term`), and `2 ^ (⌊log₂ k⌋ + 1)` divides `M_k`. -/theorem bigM_ne_term {n k i : ℕ} (hk : 2 ≤ k)(hadm : ∀ q : ℕ, q.Prime → q ≤ k → ¬ q ∣ n.choose k) (hi : i < k) (hin : i ≤ n) :n - i ≠ bigM k := byintro hhave hd : 2 ^ (Nat.log 2 k + 1) ∣ n - i := byrw [h]exact Finset.dvd_prod_of_mem (fun q => q ^ (Nat.log q k + 1))(Finset.mem_filter.2 ⟨Finset.mem_range.2 (by omega), Nat.prime_two⟩)have h1 := prime_pow_le_of_dvd_term hadm hi hin Nat.prime_two hk hdhave h2 := Nat.lt_pow_succ_log_self (by norm_num : 1 < 2) komega/-- The smallest case: `M_2 = 4` and `C(5, 2) = 10`. -/theorem bigM_two : bigM 2 = 4 ∧ (bigM 2 + 2 - 1).choose 2 = 10 := by decide +kernelend Erdos1093#print axioms Erdos1093.dvd_choose_of_pow_dvd#print axioms Erdos1093.prime_dvd_choose_bigM#print axioms Erdos1093.not_good_choose_bigM#print axioms Erdos1093.bigM_ne_term#print axioms Erdos1093.bigM_two