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

Kwas/Erdos1094Window.lean

36 lines2 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 1094: Window (continues namespace Erdos1093). -/
  3. namespace Erdos1093
  4. /-- Interval lemma. `p` prime in `(k/2, k]` and `N * p ≤ n < N * p + k - p` imply `p ∣ C(n, k)`. -/
  5. theorem dvd_choose_of_window {n k N p : ℕ} (hp : p.Prime) (hp2 : k < 2 * p) (hpk : p ≤ k)
  6. (hNp : N * p ≤ n) (hlow : n + p < N * p + k) : p ∣ n.choose k := by
  7. by_contra hnd
  8. have hpass := (not_dvd_choose_iff_passes hp k n).1 hnd
  9. have hk0 : k ≠ 0 := by have := hp.two_le; omega
  10. rw [passes_step hp.two_le n hk0] at hpass
  11. have h1 := hpass.1
  12. have hkmod : k % p = k - p := by
  13. rw [Nat.mod_eq_sub_mod hpk, Nat.mod_eq_of_lt (by omega)]
  14. have hdiv : N ≤ n / p := (Nat.le_div_iff_mul_le hp.pos).2 hNp
  15. have hdm := Nat.mod_add_div n p
  16. have hm : p * N ≤ p * (n / p) := Nat.mul_le_mul_left p hdiv
  17. have hc : N * p = p * N := Nat.mul_comm N p
  18. omega
  19. /-- An exception of Erdős 1094 has no prime in any window `((n - k)/(N - 1), n/N]` inside `(k/2, k]`. -/
  20. theorem exc_no_window {n k N p : ℕ} (he : (n, k) ∈ Exc) (hp : p.Prime) (hp2 : k < 2 * p)
  21. (hpk : p ≤ k) (hNp : N * p ≤ n) (hlow : n + p < N * p + k) : False := by
  22. have hd := dvd_choose_of_window hp hp2 hpk hNp hlow
  23. have hle := Nat.minFac_le_of_dvd hp.two_le hd
  24. have h3 : (n.choose k).minFac > max (n / k) k := he.2.2
  25. have := le_max_right (n / k) k
  26. omega
  27. end Erdos1093
  28. #print axioms Erdos1093.dvd_choose_of_window
  29. #print axioms Erdos1093.exc_no_window