import Kwas.Erdos1094Below1 import Kwas.Erdos1094Below2 import Kwas.Erdos1094Below3 import Kwas.Erdos1094Below4 /-! Erdős Problem 1094: the half `n < k ^ 2` for `k ≤ 1000`, assembled from the kernel runs of `Kwas.Erdos1094Below1` … `Kwas.Erdos1094Below4` (generated by `reports/erdos1094_criteria/gen_below.py 1000 10 530,730,875`; continues namespace Erdos1093). -/ namespace Erdos1093 /-- **The half `n < k ^ 2` for `k ≤ 1000`.** Every exception `(n, k)` of Erdős problem 1094 with `k ≤ 1000` and `n < k ^ 2` is one of the 14 known exceptions (in fact one of the 13 of `below13`). -/ theorem exc_below_sq {n k : ℕ} (hk : k ≤ 1000) (hn : n < k * k) (he : (n, k) ∈ Exc) : (n, k) ∈ known14 := by have hk2 : 2 ≤ k := by obtain ⟨h0, h2, -⟩ := he by_contra hc have h1 : k = 1 := by omega subst h1 omega rcases Nat.lt_or_ge k 12 with h | h · exact exc_of_chkFrom_len belowData2 2 10 belowData2_ok belowData2_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 22 with h | h · exact exc_of_chkFrom_len belowData12 12 10 belowData12_ok belowData12_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 32 with h | h · exact exc_of_chkFrom_len belowData22 22 10 belowData22_ok belowData22_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 42 with h | h · exact exc_of_chkFrom_len belowData32 32 10 belowData32_ok belowData32_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 52 with h | h · exact exc_of_chkFrom_len belowData42 42 10 belowData42_ok belowData42_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 62 with h | h · exact exc_of_chkFrom_len belowData52 52 10 belowData52_ok belowData52_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 72 with h | h · exact exc_of_chkFrom_len belowData62 62 10 belowData62_ok belowData62_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 82 with h | h · exact exc_of_chkFrom_len belowData72 72 10 belowData72_ok belowData72_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 92 with h | h · exact exc_of_chkFrom_len belowData82 82 10 belowData82_ok belowData82_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 102 with h | h · exact exc_of_chkFrom_len belowData92 92 10 belowData92_ok belowData92_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 112 with h | h · exact exc_of_chkFrom_len belowData102 102 10 belowData102_ok belowData102_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 122 with h | h · exact exc_of_chkFrom_len belowData112 112 10 belowData112_ok belowData112_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 132 with h | h · exact exc_of_chkFrom_len belowData122 122 10 belowData122_ok belowData122_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 142 with h | h · exact exc_of_chkFrom_len belowData132 132 10 belowData132_ok belowData132_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 152 with h | h · exact exc_of_chkFrom_len belowData142 142 10 belowData142_ok belowData142_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 162 with h | h · exact exc_of_chkFrom_len belowData152 152 10 belowData152_ok belowData152_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 172 with h | h · exact exc_of_chkFrom_len belowData162 162 10 belowData162_ok belowData162_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 182 with h | h · exact exc_of_chkFrom_len belowData172 172 10 belowData172_ok belowData172_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 192 with h | h · exact exc_of_chkFrom_len belowData182 182 10 belowData182_ok belowData182_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 202 with h | h · exact exc_of_chkFrom_len belowData192 192 10 belowData192_ok belowData192_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 212 with h | h · exact exc_of_chkFrom_len belowData202 202 10 belowData202_ok belowData202_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 222 with h | h · exact exc_of_chkFrom_len belowData212 212 10 belowData212_ok belowData212_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 232 with h | h · exact exc_of_chkFrom_len belowData222 222 10 belowData222_ok belowData222_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 242 with h | h · exact exc_of_chkFrom_len belowData232 232 10 belowData232_ok belowData232_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 252 with h | h · exact exc_of_chkFrom_len belowData242 242 10 belowData242_ok belowData242_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 262 with h | h · exact exc_of_chkFrom_len belowData252 252 10 belowData252_ok belowData252_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 272 with h | h · exact exc_of_chkFrom_len belowData262 262 10 belowData262_ok belowData262_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 282 with h | h · exact exc_of_chkFrom_len belowData272 272 10 belowData272_ok belowData272_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 292 with h | h · exact exc_of_chkFrom_len belowData282 282 10 belowData282_ok belowData282_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 302 with h | h · exact exc_of_chkFrom_len belowData292 292 10 belowData292_ok belowData292_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 312 with h | h · exact exc_of_chkFrom_len belowData302 302 10 belowData302_ok belowData302_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 322 with h | h · exact exc_of_chkFrom_len belowData312 312 10 belowData312_ok belowData312_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 332 with h | h · exact exc_of_chkFrom_len belowData322 322 10 belowData322_ok belowData322_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 342 with h | h · exact exc_of_chkFrom_len belowData332 332 10 belowData332_ok belowData332_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 352 with h | h · exact exc_of_chkFrom_len belowData342 342 10 belowData342_ok belowData342_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 362 with h | h · exact exc_of_chkFrom_len belowData352 352 10 belowData352_ok belowData352_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 372 with h | h · exact exc_of_chkFrom_len belowData362 362 10 belowData362_ok belowData362_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 382 with h | h · exact exc_of_chkFrom_len belowData372 372 10 belowData372_ok belowData372_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 392 with h | h · exact exc_of_chkFrom_len belowData382 382 10 belowData382_ok belowData382_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 402 with h | h · exact exc_of_chkFrom_len belowData392 392 10 belowData392_ok belowData392_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 412 with h | h · exact exc_of_chkFrom_len belowData402 402 10 belowData402_ok belowData402_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 422 with h | h · exact exc_of_chkFrom_len belowData412 412 10 belowData412_ok belowData412_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 432 with h | h · exact exc_of_chkFrom_len belowData422 422 10 belowData422_ok belowData422_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 442 with h | h · exact exc_of_chkFrom_len belowData432 432 10 belowData432_ok belowData432_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 452 with h | h · exact exc_of_chkFrom_len belowData442 442 10 belowData442_ok belowData442_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 462 with h | h · exact exc_of_chkFrom_len belowData452 452 10 belowData452_ok belowData452_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 472 with h | h · exact exc_of_chkFrom_len belowData462 462 10 belowData462_ok belowData462_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 482 with h | h · exact exc_of_chkFrom_len belowData472 472 10 belowData472_ok belowData472_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 492 with h | h · exact exc_of_chkFrom_len belowData482 482 10 belowData482_ok belowData482_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 502 with h | h · exact exc_of_chkFrom_len belowData492 492 10 belowData492_ok belowData492_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 512 with h | h · exact exc_of_chkFrom_len belowData502 502 10 belowData502_ok belowData502_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 522 with h | h · exact exc_of_chkFrom_len belowData512 512 10 belowData512_ok belowData512_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 531 with h | h · exact exc_of_chkFrom_len belowData522 522 9 belowData522_ok belowData522_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 541 with h | h · exact exc_of_chkFrom_len belowData531 531 10 belowData531_ok belowData531_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 551 with h | h · exact exc_of_chkFrom_len belowData541 541 10 belowData541_ok belowData541_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 561 with h | h · exact exc_of_chkFrom_len belowData551 551 10 belowData551_ok belowData551_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 571 with h | h · exact exc_of_chkFrom_len belowData561 561 10 belowData561_ok belowData561_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 581 with h | h · exact exc_of_chkFrom_len belowData571 571 10 belowData571_ok belowData571_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 591 with h | h · exact exc_of_chkFrom_len belowData581 581 10 belowData581_ok belowData581_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 601 with h | h · exact exc_of_chkFrom_len belowData591 591 10 belowData591_ok belowData591_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 611 with h | h · exact exc_of_chkFrom_len belowData601 601 10 belowData601_ok belowData601_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 621 with h | h · exact exc_of_chkFrom_len belowData611 611 10 belowData611_ok belowData611_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 631 with h | h · exact exc_of_chkFrom_len belowData621 621 10 belowData621_ok belowData621_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 641 with h | h · exact exc_of_chkFrom_len belowData631 631 10 belowData631_ok belowData631_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 651 with h | h · exact exc_of_chkFrom_len belowData641 641 10 belowData641_ok belowData641_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 661 with h | h · exact exc_of_chkFrom_len belowData651 651 10 belowData651_ok belowData651_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 671 with h | h · exact exc_of_chkFrom_len belowData661 661 10 belowData661_ok belowData661_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 681 with h | h · exact exc_of_chkFrom_len belowData671 671 10 belowData671_ok belowData671_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 691 with h | h · exact exc_of_chkFrom_len belowData681 681 10 belowData681_ok belowData681_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 701 with h | h · exact exc_of_chkFrom_len belowData691 691 10 belowData691_ok belowData691_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 711 with h | h · exact exc_of_chkFrom_len belowData701 701 10 belowData701_ok belowData701_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 721 with h | h · exact exc_of_chkFrom_len belowData711 711 10 belowData711_ok belowData711_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 731 with h | h · exact exc_of_chkFrom_len belowData721 721 10 belowData721_ok belowData721_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 741 with h | h · exact exc_of_chkFrom_len belowData731 731 10 belowData731_ok belowData731_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 751 with h | h · exact exc_of_chkFrom_len belowData741 741 10 belowData741_ok belowData741_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 761 with h | h · exact exc_of_chkFrom_len belowData751 751 10 belowData751_ok belowData751_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 771 with h | h · exact exc_of_chkFrom_len belowData761 761 10 belowData761_ok belowData761_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 781 with h | h · exact exc_of_chkFrom_len belowData771 771 10 belowData771_ok belowData771_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 791 with h | h · exact exc_of_chkFrom_len belowData781 781 10 belowData781_ok belowData781_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 801 with h | h · exact exc_of_chkFrom_len belowData791 791 10 belowData791_ok belowData791_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 811 with h | h · exact exc_of_chkFrom_len belowData801 801 10 belowData801_ok belowData801_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 821 with h | h · exact exc_of_chkFrom_len belowData811 811 10 belowData811_ok belowData811_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 831 with h | h · exact exc_of_chkFrom_len belowData821 821 10 belowData821_ok belowData821_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 841 with h | h · exact exc_of_chkFrom_len belowData831 831 10 belowData831_ok belowData831_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 851 with h | h · exact exc_of_chkFrom_len belowData841 841 10 belowData841_ok belowData841_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 861 with h | h · exact exc_of_chkFrom_len belowData851 851 10 belowData851_ok belowData851_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 871 with h | h · exact exc_of_chkFrom_len belowData861 861 10 belowData861_ok belowData861_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 876 with h | h · exact exc_of_chkFrom_len belowData871 871 5 belowData871_ok belowData871_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 886 with h | h · exact exc_of_chkFrom_len belowData876 876 10 belowData876_ok belowData876_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 896 with h | h · exact exc_of_chkFrom_len belowData886 886 10 belowData886_ok belowData886_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 906 with h | h · exact exc_of_chkFrom_len belowData896 896 10 belowData896_ok belowData896_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 916 with h | h · exact exc_of_chkFrom_len belowData906 906 10 belowData906_ok belowData906_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 926 with h | h · exact exc_of_chkFrom_len belowData916 916 10 belowData916_ok belowData916_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 936 with h | h · exact exc_of_chkFrom_len belowData926 926 10 belowData926_ok belowData926_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 946 with h | h · exact exc_of_chkFrom_len belowData936 936 10 belowData936_ok belowData936_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 956 with h | h · exact exc_of_chkFrom_len belowData946 946 10 belowData946_ok belowData946_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 966 with h | h · exact exc_of_chkFrom_len belowData956 956 10 belowData956_ok belowData956_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 976 with h | h · exact exc_of_chkFrom_len belowData966 966 10 belowData966_ok belowData966_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 986 with h | h · exact exc_of_chkFrom_len belowData976 976 10 belowData976_ok belowData976_len (by omega) (by omega) he hn rcases Nat.lt_or_ge k 996 with h | h · exact exc_of_chkFrom_len belowData986 986 10 belowData986_ok belowData986_len (by omega) (by omega) he hn exact exc_of_chkFrom_len belowData996 996 5 belowData996_ok belowData996_len (by omega) (by omega) he hn /-- For `k ≤ 1000` and `n < k ^ 2`: `(n, k)` is an exception iff it is one of the 14 known ones. -/ theorem exc_iff_below_sq {n k : ℕ} (hk : k ≤ 1000) (hn : n < k * k) : (n, k) ∈ Exc ↔ (n, k) ∈ known14 := ⟨fun he => exc_below_sq hk hn he, fun h => known14_subset h⟩ /-- For `29 ≤ k ≤ 1000` and every `n` with `2k ≤ n < k ^ 2` some prime `p ≤ k` divides `C(n, k)`. The range `k + 2 ≤ n < 2k`, which is also needed for `g(k) ≥ k ^ 2`, is in `Kwas.Erdos1094Low` (`exists_prime_dvd_choose_lt_sq`). -/ theorem exists_prime_dvd_choose_below_sq {n k : ℕ} (h29 : 29 ≤ k) (hk : k ≤ 1000) (h2 : 2 * k ≤ n) (hn : n < k * k) : ∃ p : ℕ, p.Prime ∧ p ≤ k ∧ p ∣ n.choose k := by refine exists_prime_dvd_of_not_exc (by omega) h2 hn fun he => ?_ have hmem := exc_below_sq hk hn he have h28 : k ≤ 28 := known14_k_le _ hmem omega end Erdos1093 #print axioms Erdos1093.exc_below_sq #print axioms Erdos1093.exc_iff_below_sq #print axioms Erdos1093.exists_prime_dvd_choose_below_sq