ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  prmdc GIF version

Theorem prmdc 12120
Description: Primality is decidable. (Contributed by Jim Kingdon, 30-Sep-2024.)
Assertion
Ref Expression
prmdc (𝑁 ∈ ℕ → DECID 𝑁 ∈ ℙ)

Proof of Theorem prmdc
Dummy variable 𝑥 is distinct from all other variables.
StepHypRef Expression
1 1nuz2 9600 . . . . . . 7 ¬ 1 ∈ (ℤ‘2)
2 eleq1 2240 . . . . . . 7 (𝑁 = 1 → (𝑁 ∈ (ℤ‘2) ↔ 1 ∈ (ℤ‘2)))
31, 2mtbiri 675 . . . . . 6 (𝑁 = 1 → ¬ 𝑁 ∈ (ℤ‘2))
43orim1i 760 . . . . 5 ((𝑁 = 1 ∨ 𝑁 ∈ (ℤ‘2)) → (¬ 𝑁 ∈ (ℤ‘2) ∨ 𝑁 ∈ (ℤ‘2)))
54orcomd 729 . . . 4 ((𝑁 = 1 ∨ 𝑁 ∈ (ℤ‘2)) → (𝑁 ∈ (ℤ‘2) ∨ ¬ 𝑁 ∈ (ℤ‘2)))
6 elnn1uz2 9601 . . . 4 (𝑁 ∈ ℕ ↔ (𝑁 = 1 ∨ 𝑁 ∈ (ℤ‘2)))
7 df-dc 835 . . . 4 (DECID 𝑁 ∈ (ℤ‘2) ↔ (𝑁 ∈ (ℤ‘2) ∨ ¬ 𝑁 ∈ (ℤ‘2)))
85, 6, 73imtr4i 201 . . 3 (𝑁 ∈ ℕ → DECID 𝑁 ∈ (ℤ‘2))
9 2z 9275 . . . . . 6 2 ∈ ℤ
109a1i 9 . . . . 5 (𝑁 ∈ ℕ → 2 ∈ ℤ)
11 nnz 9266 . . . . . 6 (𝑁 ∈ ℕ → 𝑁 ∈ ℤ)
12 peano2zm 9285 . . . . . 6 (𝑁 ∈ ℤ → (𝑁 − 1) ∈ ℤ)
1311, 12syl 14 . . . . 5 (𝑁 ∈ ℕ → (𝑁 − 1) ∈ ℤ)
1410, 13fzfigd 10424 . . . 4 (𝑁 ∈ ℕ → (2...(𝑁 − 1)) ∈ Fin)
15 elfzelz 10018 . . . . . . . . 9 (𝑥 ∈ (2...(𝑁 − 1)) → 𝑥 ∈ ℤ)
1615adantl 277 . . . . . . . 8 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑥 ∈ ℤ)
17 1red 7967 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 1 ∈ ℝ)
18 2re 8983 . . . . . . . . . 10 2 ∈ ℝ
1918a1i 9 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 2 ∈ ℝ)
2016zred 9369 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑥 ∈ ℝ)
21 1le2 9121 . . . . . . . . . 10 1 ≤ 2
2221a1i 9 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 1 ≤ 2)
23 elfzle1 10020 . . . . . . . . . 10 (𝑥 ∈ (2...(𝑁 − 1)) → 2 ≤ 𝑥)
2423adantl 277 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 2 ≤ 𝑥)
2517, 19, 20, 22, 24letrd 8075 . . . . . . . 8 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 1 ≤ 𝑥)
26 elnnz1 9270 . . . . . . . 8 (𝑥 ∈ ℕ ↔ (𝑥 ∈ ℤ ∧ 1 ≤ 𝑥))
2716, 25, 26sylanbrc 417 . . . . . . 7 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑥 ∈ ℕ)
2811adantr 276 . . . . . . 7 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑁 ∈ ℤ)
29 dvdsdc 11796 . . . . . . 7 ((𝑥 ∈ ℕ ∧ 𝑁 ∈ ℤ) → DECID 𝑥𝑁)
3027, 28, 29syl2anc 411 . . . . . 6 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → DECID 𝑥𝑁)
31 dcn 842 . . . . . 6 (DECID 𝑥𝑁DECID ¬ 𝑥𝑁)
3230, 31syl 14 . . . . 5 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → DECID ¬ 𝑥𝑁)
3332ralrimiva 2550 . . . 4 (𝑁 ∈ ℕ → ∀𝑥 ∈ (2...(𝑁 − 1))DECID ¬ 𝑥𝑁)
34 dcfi 6975 . . . 4 (((2...(𝑁 − 1)) ∈ Fin ∧ ∀𝑥 ∈ (2...(𝑁 − 1))DECID ¬ 𝑥𝑁) → DECID𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁)
3514, 33, 34syl2anc 411 . . 3 (𝑁 ∈ ℕ → DECID𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁)
36 dcan2 934 . . 3 (DECID 𝑁 ∈ (ℤ‘2) → (DECID𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁DECID (𝑁 ∈ (ℤ‘2) ∧ ∀𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁)))
378, 35, 36sylc 62 . 2 (𝑁 ∈ ℕ → DECID (𝑁 ∈ (ℤ‘2) ∧ ∀𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁))
38 isprm3 12108 . . 3 (𝑁 ∈ ℙ ↔ (𝑁 ∈ (ℤ‘2) ∧ ∀𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁))
3938dcbii 840 . 2 (DECID 𝑁 ∈ ℙ ↔ DECID (𝑁 ∈ (ℤ‘2) ∧ ∀𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁))
4037, 39sylibr 134 1 (𝑁 ∈ ℕ → DECID 𝑁 ∈ ℙ)
Colors of variables: wff set class
Syntax hints:  ¬ wn 3  wi 4  wa 104  wo 708  DECID wdc 834   = wceq 1353  wcel 2148  wral 2455   class class class wbr 4001  cfv 5213  (class class class)co 5870  Fincfn 6735  cr 7805  1c1 7807  cle 7987  cmin 8122  cn 8913  2c2 8964  cz 9247  cuz 9522  ...cfz 10002  cdvds 11785  cprime 12097
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 614  ax-in2 615  ax-io 709  ax-5 1447  ax-7 1448  ax-gen 1449  ax-ie1 1493  ax-ie2 1494  ax-8 1504  ax-10 1505  ax-11 1506  ax-i12 1507  ax-bndl 1509  ax-4 1510  ax-17 1526  ax-i9 1530  ax-ial 1534  ax-i5r 1535  ax-13 2150  ax-14 2151  ax-ext 2159  ax-coll 4116  ax-sep 4119  ax-nul 4127  ax-pow 4172  ax-pr 4207  ax-un 4431  ax-setind 4534  ax-iinf 4585  ax-cnex 7897  ax-resscn 7898  ax-1cn 7899  ax-1re 7900  ax-icn 7901  ax-addcl 7902  ax-addrcl 7903  ax-mulcl 7904  ax-mulrcl 7905  ax-addcom 7906  ax-mulcom 7907  ax-addass 7908  ax-mulass 7909  ax-distr 7910  ax-i2m1 7911  ax-0lt1 7912  ax-1rid 7913  ax-0id 7914  ax-rnegex 7915  ax-precex 7916  ax-cnre 7917  ax-pre-ltirr 7918  ax-pre-ltwlin 7919  ax-pre-lttrn 7920  ax-pre-apti 7921  ax-pre-ltadd 7922  ax-pre-mulgt0 7923  ax-pre-mulext 7924  ax-arch 7925  ax-caucvg 7926
This theorem depends on definitions:  df-bi 117  df-stab 831  df-dc 835  df-3or 979  df-3an 980  df-tru 1356  df-fal 1359  df-nf 1461  df-sb 1763  df-eu 2029  df-mo 2030  df-clab 2164  df-cleq 2170  df-clel 2173  df-nfc 2308  df-ne 2348  df-nel 2443  df-ral 2460  df-rex 2461  df-reu 2462  df-rmo 2463  df-rab 2464  df-v 2739  df-sbc 2963  df-csb 3058  df-dif 3131  df-un 3133  df-in 3135  df-ss 3142  df-nul 3423  df-if 3535  df-pw 3577  df-sn 3598  df-pr 3599  df-op 3601  df-uni 3809  df-int 3844  df-iun 3887  df-br 4002  df-opab 4063  df-mpt 4064  df-tr 4100  df-id 4291  df-po 4294  df-iso 4295  df-iord 4364  df-on 4366  df-ilim 4367  df-suc 4369  df-iom 4588  df-xp 4630  df-rel 4631  df-cnv 4632  df-co 4633  df-dm 4634  df-rn 4635  df-res 4636  df-ima 4637  df-iota 5175  df-fun 5215  df-fn 5216  df-f 5217  df-f1 5218  df-fo 5219  df-f1o 5220  df-fv 5221  df-riota 5826  df-ov 5873  df-oprab 5874  df-mpo 5875  df-1st 6136  df-2nd 6137  df-recs 6301  df-frec 6387  df-1o 6412  df-2o 6413  df-er 6530  df-en 6736  df-fin 6738  df-pnf 7988  df-mnf 7989  df-xr 7990  df-ltxr 7991  df-le 7992  df-sub 8124  df-neg 8125  df-reap 8526  df-ap 8533  df-div 8624  df-inn 8914  df-2 8972  df-3 8973  df-4 8974  df-n0 9171  df-z 9248  df-uz 9523  df-q 9614  df-rp 9648  df-fz 10003  df-fl 10263  df-mod 10316  df-seqfrec 10439  df-exp 10513  df-cj 10842  df-re 10843  df-im 10844  df-rsqrt 10998  df-abs 10999  df-dvds 11786  df-prm 12098
This theorem is referenced by:  pcmptcl  12330  pcmpt  12331  1arith  12355  prminf  12446  lgsval  14187  lgsfvalg  14188  lgsfcl2  14189  lgsval2lem  14193  lgsval4lem  14194  lgsneg  14207  lgsmod  14209  lgsdir  14218  lgsdilem2  14219  lgsdi  14220  lgsne0  14221
  Copyright terms: Public domain W3C validator