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

Theorem prmdc 12502
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 9740 . . . . . . 7 ¬ 1 ∈ (ℤ‘2)
2 eleq1 2269 . . . . . . 7 (𝑁 = 1 → (𝑁 ∈ (ℤ‘2) ↔ 1 ∈ (ℤ‘2)))
31, 2mtbiri 677 . . . . . 6 (𝑁 = 1 → ¬ 𝑁 ∈ (ℤ‘2))
43orim1i 762 . . . . 5 ((𝑁 = 1 ∨ 𝑁 ∈ (ℤ‘2)) → (¬ 𝑁 ∈ (ℤ‘2) ∨ 𝑁 ∈ (ℤ‘2)))
54orcomd 731 . . . 4 ((𝑁 = 1 ∨ 𝑁 ∈ (ℤ‘2)) → (𝑁 ∈ (ℤ‘2) ∨ ¬ 𝑁 ∈ (ℤ‘2)))
6 elnn1uz2 9741 . . . 4 (𝑁 ∈ ℕ ↔ (𝑁 = 1 ∨ 𝑁 ∈ (ℤ‘2)))
7 df-dc 837 . . . 4 (DECID 𝑁 ∈ (ℤ‘2) ↔ (𝑁 ∈ (ℤ‘2) ∨ ¬ 𝑁 ∈ (ℤ‘2)))
85, 6, 73imtr4i 201 . . 3 (𝑁 ∈ ℕ → DECID 𝑁 ∈ (ℤ‘2))
9 2z 9413 . . . . . 6 2 ∈ ℤ
109a1i 9 . . . . 5 (𝑁 ∈ ℕ → 2 ∈ ℤ)
11 nnz 9404 . . . . . 6 (𝑁 ∈ ℕ → 𝑁 ∈ ℤ)
12 peano2zm 9423 . . . . . 6 (𝑁 ∈ ℤ → (𝑁 − 1) ∈ ℤ)
1311, 12syl 14 . . . . 5 (𝑁 ∈ ℕ → (𝑁 − 1) ∈ ℤ)
1410, 13fzfigd 10589 . . . 4 (𝑁 ∈ ℕ → (2...(𝑁 − 1)) ∈ Fin)
15 elfzelz 10160 . . . . . . . . 9 (𝑥 ∈ (2...(𝑁 − 1)) → 𝑥 ∈ ℤ)
1615adantl 277 . . . . . . . 8 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑥 ∈ ℤ)
17 1red 8100 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 1 ∈ ℝ)
18 2re 9119 . . . . . . . . . 10 2 ∈ ℝ
1918a1i 9 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 2 ∈ ℝ)
2016zred 9508 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑥 ∈ ℝ)
21 1le2 9258 . . . . . . . . . 10 1 ≤ 2
2221a1i 9 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 1 ≤ 2)
23 elfzle1 10162 . . . . . . . . . 10 (𝑥 ∈ (2...(𝑁 − 1)) → 2 ≤ 𝑥)
2423adantl 277 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 2 ≤ 𝑥)
2517, 19, 20, 22, 24letrd 8209 . . . . . . . 8 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 1 ≤ 𝑥)
26 elnnz1 9408 . . . . . . . 8 (𝑥 ∈ ℕ ↔ (𝑥 ∈ ℤ ∧ 1 ≤ 𝑥))
2716, 25, 26sylanbrc 417 . . . . . . 7 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑥 ∈ ℕ)
2811adantr 276 . . . . . . 7 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → 𝑁 ∈ ℤ)
29 dvdsdc 12159 . . . . . . 7 ((𝑥 ∈ ℕ ∧ 𝑁 ∈ ℤ) → DECID 𝑥𝑁)
3027, 28, 29syl2anc 411 . . . . . 6 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → DECID 𝑥𝑁)
31 dcn 844 . . . . . 6 (DECID 𝑥𝑁DECID ¬ 𝑥𝑁)
3230, 31syl 14 . . . . 5 ((𝑁 ∈ ℕ ∧ 𝑥 ∈ (2...(𝑁 − 1))) → DECID ¬ 𝑥𝑁)
3332ralrimiva 2580 . . . 4 (𝑁 ∈ ℕ → ∀𝑥 ∈ (2...(𝑁 − 1))DECID ¬ 𝑥𝑁)
34 dcfi 7095 . . . 4 (((2...(𝑁 − 1)) ∈ Fin ∧ ∀𝑥 ∈ (2...(𝑁 − 1))DECID ¬ 𝑥𝑁) → DECID𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁)
3514, 33, 34syl2anc 411 . . 3 (𝑁 ∈ ℕ → DECID𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁)
368, 35dcand 935 . 2 (𝑁 ∈ ℕ → DECID (𝑁 ∈ (ℤ‘2) ∧ ∀𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁))
37 isprm3 12490 . . 3 (𝑁 ∈ ℙ ↔ (𝑁 ∈ (ℤ‘2) ∧ ∀𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁))
3837dcbii 842 . 2 (DECID 𝑁 ∈ ℙ ↔ DECID (𝑁 ∈ (ℤ‘2) ∧ ∀𝑥 ∈ (2...(𝑁 − 1)) ¬ 𝑥𝑁))
3936, 38sylibr 134 1 (𝑁 ∈ ℕ → DECID 𝑁 ∈ ℙ)
Colors of variables: wff set class
Syntax hints:  ¬ wn 3  wi 4  wa 104  wo 710  DECID wdc 836   = wceq 1373  wcel 2177  wral 2485   class class class wbr 4048  cfv 5277  (class class class)co 5954  Fincfn 6837  cr 7937  1c1 7939  cle 8121  cmin 8256  cn 9049  2c2 9100  cz 9385  cuz 9661  ...cfz 10143  cdvds 12148  cprime 12479
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 615  ax-in2 616  ax-io 711  ax-5 1471  ax-7 1472  ax-gen 1473  ax-ie1 1517  ax-ie2 1518  ax-8 1528  ax-10 1529  ax-11 1530  ax-i12 1531  ax-bndl 1533  ax-4 1534  ax-17 1550  ax-i9 1554  ax-ial 1558  ax-i5r 1559  ax-13 2179  ax-14 2180  ax-ext 2188  ax-coll 4164  ax-sep 4167  ax-nul 4175  ax-pow 4223  ax-pr 4258  ax-un 4485  ax-setind 4590  ax-iinf 4641  ax-cnex 8029  ax-resscn 8030  ax-1cn 8031  ax-1re 8032  ax-icn 8033  ax-addcl 8034  ax-addrcl 8035  ax-mulcl 8036  ax-mulrcl 8037  ax-addcom 8038  ax-mulcom 8039  ax-addass 8040  ax-mulass 8041  ax-distr 8042  ax-i2m1 8043  ax-0lt1 8044  ax-1rid 8045  ax-0id 8046  ax-rnegex 8047  ax-precex 8048  ax-cnre 8049  ax-pre-ltirr 8050  ax-pre-ltwlin 8051  ax-pre-lttrn 8052  ax-pre-apti 8053  ax-pre-ltadd 8054  ax-pre-mulgt0 8055  ax-pre-mulext 8056  ax-arch 8057  ax-caucvg 8058
This theorem depends on definitions:  df-bi 117  df-stab 833  df-dc 837  df-3or 982  df-3an 983  df-tru 1376  df-fal 1379  df-nf 1485  df-sb 1787  df-eu 2058  df-mo 2059  df-clab 2193  df-cleq 2199  df-clel 2202  df-nfc 2338  df-ne 2378  df-nel 2473  df-ral 2490  df-rex 2491  df-reu 2492  df-rmo 2493  df-rab 2494  df-v 2775  df-sbc 3001  df-csb 3096  df-dif 3170  df-un 3172  df-in 3174  df-ss 3181  df-nul 3463  df-if 3574  df-pw 3620  df-sn 3641  df-pr 3642  df-op 3644  df-uni 3854  df-int 3889  df-iun 3932  df-br 4049  df-opab 4111  df-mpt 4112  df-tr 4148  df-id 4345  df-po 4348  df-iso 4349  df-iord 4418  df-on 4420  df-ilim 4421  df-suc 4423  df-iom 4644  df-xp 4686  df-rel 4687  df-cnv 4688  df-co 4689  df-dm 4690  df-rn 4691  df-res 4692  df-ima 4693  df-iota 5238  df-fun 5279  df-fn 5280  df-f 5281  df-f1 5282  df-fo 5283  df-f1o 5284  df-fv 5285  df-riota 5909  df-ov 5957  df-oprab 5958  df-mpo 5959  df-1st 6236  df-2nd 6237  df-recs 6401  df-frec 6487  df-1o 6512  df-2o 6513  df-er 6630  df-en 6838  df-fin 6840  df-pnf 8122  df-mnf 8123  df-xr 8124  df-ltxr 8125  df-le 8126  df-sub 8258  df-neg 8259  df-reap 8661  df-ap 8668  df-div 8759  df-inn 9050  df-2 9108  df-3 9109  df-4 9110  df-n0 9309  df-z 9386  df-uz 9662  df-q 9754  df-rp 9789  df-fz 10144  df-fl 10426  df-mod 10481  df-seqfrec 10606  df-exp 10697  df-cj 11203  df-re 11204  df-im 11205  df-rsqrt 11359  df-abs 11360  df-dvds 12149  df-prm 12480
This theorem is referenced by:  pcmptcl  12715  pcmpt  12716  1arith  12740  prminf  12876  lgsval  15531  lgsfvalg  15532  lgsfcl2  15533  lgsval2lem  15537  lgsval4lem  15538  lgsneg  15551  lgsmod  15553  lgsdir  15562  lgsdilem2  15563  lgsdi  15564  lgsne0  15565
  Copyright terms: Public domain W3C validator