Lean / janjarosz05/0kwas / Erdos1093Family.lean
Lean reader

Kwas/Erdos1093Family.lean

80 lines8 declarationsno sorryimports Kwas.Erdos1093

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.

  1. import Kwas.Erdos1093
  2. /-! Erdős Problem 1093: the binomial coefficients `C(M_k + k - 1, k)`, where
  3. `M_k = ∏_{p ≤ k} p ^ (⌊log_p k⌋ + 1)`, are divisible by every prime `p ≤ k`.
  4. So none of them is "good" (all prime factors `> k`), and their deficiency is undefined. This is the family
  5. proposed in arXiv:2609.25042v1 as an infinite family of good coefficients of deficiency one; the author withdrew
  6. that paper (v2, 2 November 2026), stating that its Theorem 1.1 does not hold. -/
  7. namespace Erdos1093
  8. /-- If `p ^ r ∣ M` and `0 < k < p ^ r`, then `p ∣ C(M + k - 1, k)`.
  9. Proof: `C(n, k) * k = C(n, k - 1) * (n - k + 1)` with `n - k + 1 = M`. -/
  10. theorem dvd_choose_of_pow_dvd {p r M k : ℕ} (hp : p.Prime) (hM : p ^ r ∣ M) (hk0 : 0 < k)
  11. (hk : k < p ^ r) : p ∣ (M + k - 1).choose k := by
  12. obtain ⟨j, rfl⟩ : ∃ j, k = j + 1 := ⟨k - 1, by omega⟩
  13. have e : M + (j + 1) - 1 = M + j := by omega
  14. rw [e]
  15. by_contra hnd
  16. have hcop : Nat.Coprime (p ^ r) ((M + j).choose (j + 1)) :=
  17. Nat.Coprime.pow_left r ((Nat.Prime.coprime_iff_not_dvd hp).2 hnd)
  18. have h := Nat.choose_succ_right_eq (M + j) j
  19. have hdvd : p ^ r ∣ (M + j).choose (j + 1) * (j + 1) := by
  20. rw [h, Nat.add_sub_cancel]
  21. exact Dvd.dvd.mul_left hM _
  22. have h2 : p ^ r ∣ j + 1 := hcop.dvd_of_dvd_mul_left hdvd
  23. have := Nat.le_of_dvd (by omega) h2
  24. omega
  25. /-- `M_k = ∏_{p ≤ k, p prime} p ^ (⌊log_p k⌋ + 1)`. -/
  26. def bigM (k : ℕ) : ℕ := ∏ p ∈ (Finset.range (k + 1)).filter Nat.Prime, p ^ (Nat.log p k + 1)
  27. /-- Every prime `p ≤ k` divides `C(M_k + k - 1, k)`. -/
  28. theorem prime_dvd_choose_bigM {k p : ℕ} (hk : 0 < k) (hp : p.Prime) (hpk : p ≤ k) :
  29. p ∣ (bigM k + k - 1).choose k := by
  30. refine dvd_choose_of_pow_dvd (r := Nat.log p k + 1) hp ?_ hk (Nat.lt_pow_succ_log_self hp.one_lt k)
  31. exact Finset.dvd_prod_of_mem (fun q => q ^ (Nat.log q k + 1))
  32. (Finset.mem_filter.2 ⟨Finset.mem_range.2 (by omega), hp⟩)
  33. /-- For every `k ≥ 2` the coefficient `C(M_k + k - 1, k)` is even. -/
  34. theorem two_dvd_choose_bigM {k : ℕ} (hk : 2 ≤ k) : 2 ∣ (bigM k + k - 1).choose k :=
  35. prime_dvd_choose_bigM (by omega) Nat.prime_two hk
  36. /-- For every `k ≥ 2` the least prime factor of `C(M_k + k - 1, k)` is `2 ≤ k`: the coefficient is not good. -/
  37. theorem minFac_choose_bigM {k : ℕ} (hk : 2 ≤ k) : ((bigM k + k - 1).choose k).minFac = 2 :=
  38. (Nat.minFac_eq_two_iff _).2 (two_dvd_choose_bigM hk)
  39. /-- No `k ≥ 2` gives a coefficient `C(M_k + k - 1, k)` all of whose prime factors exceed `k`. -/
  40. theorem not_good_choose_bigM {k : ℕ} (hk : 2 ≤ k) :
  41. ¬ ∀ q : ℕ, q.Prime → q ∣ (bigM k + k - 1).choose k → k < q := by
  42. intro h
  43. have := h 2 Nat.prime_two (two_dvd_choose_bigM hk)
  44. omega
  45. /-- More generally, `M_k` is never one of the `k` terms `n, n - 1, …, n - k + 1` of a coefficient `C(n, k)`
  46. with no prime factor `≤ k`, whatever its position in the window: a prime power `p ^ e > k` with `p ≤ k`
  47. cannot divide a term (`prime_pow_le_of_dvd_term`), and `2 ^ (⌊log₂ k⌋ + 1)` divides `M_k`. -/
  48. theorem bigM_ne_term {n k i : ℕ} (hk : 2 ≤ k)
  49. (hadm : ∀ q : ℕ, q.Prime → q ≤ k → ¬ q ∣ n.choose k) (hi : i < k) (hin : i ≤ n) :
  50. n - i ≠ bigM k := by
  51. intro h
  52. have hd : 2 ^ (Nat.log 2 k + 1) ∣ n - i := by
  53. rw [h]
  54. exact Finset.dvd_prod_of_mem (fun q => q ^ (Nat.log q k + 1))
  55. (Finset.mem_filter.2 ⟨Finset.mem_range.2 (by omega), Nat.prime_two⟩)
  56. have h1 := prime_pow_le_of_dvd_term hadm hi hin Nat.prime_two hk hd
  57. have h2 := Nat.lt_pow_succ_log_self (by norm_num : 1 < 2) k
  58. omega
  59. /-- The smallest case: `M_2 = 4` and `C(5, 2) = 10`. -/
  60. theorem bigM_two : bigM 2 = 4 ∧ (bigM 2 + 2 - 1).choose 2 = 10 := by decide +kernel
  61. end Erdos1093
  62. #print axioms Erdos1093.dvd_choose_of_pow_dvd
  63. #print axioms Erdos1093.prime_dvd_choose_bigM
  64. #print axioms Erdos1093.not_good_choose_bigM
  65. #print axioms Erdos1093.bigM_ne_term
  66. #print axioms Erdos1093.bigM_two