MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  dvdsmodexp Structured version   Visualization version   GIF version

Theorem dvdsmodexp 15804
Description: If a positive integer divides another integer, this other integer is equal to its positive powers modulo the positive integer. (Formerly part of the proof for fermltl 16318). (Contributed by Mario Carneiro, 28-Feb-2014.) (Revised by AV, 19-Mar-2022.)
Assertion
Ref Expression
dvdsmodexp ((𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ ∧ 𝑁𝐴) → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁))

Proof of Theorem dvdsmodexp
StepHypRef Expression
1 dvdszrcl 15801 . . 3 (𝑁𝐴 → (𝑁 ∈ ℤ ∧ 𝐴 ∈ ℤ))
2 dvdsmod0 15802 . . . . . . . . 9 ((𝑁 ∈ ℕ ∧ 𝑁𝐴) → (𝐴 mod 𝑁) = 0)
323ad2antl2 1188 . . . . . . . 8 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ 𝑁𝐴) → (𝐴 mod 𝑁) = 0)
43ex 416 . . . . . . 7 ((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) → (𝑁𝐴 → (𝐴 mod 𝑁) = 0))
5 simpl3 1195 . . . . . . . . . . 11 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → 𝐵 ∈ ℕ)
650expd 13692 . . . . . . . . . 10 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → (0↑𝐵) = 0)
76oveq1d 7217 . . . . . . . . 9 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → ((0↑𝐵) mod 𝑁) = (0 mod 𝑁))
8 simpl1 1193 . . . . . . . . . 10 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → 𝐴 ∈ ℤ)
9 0zd 12171 . . . . . . . . . 10 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → 0 ∈ ℤ)
10 nnnn0 12080 . . . . . . . . . . . 12 (𝐵 ∈ ℕ → 𝐵 ∈ ℕ0)
11103ad2ant3 1137 . . . . . . . . . . 11 ((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) → 𝐵 ∈ ℕ0)
1211adantr 484 . . . . . . . . . 10 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → 𝐵 ∈ ℕ0)
13 nnrp 12580 . . . . . . . . . . . 12 (𝑁 ∈ ℕ → 𝑁 ∈ ℝ+)
14133ad2ant2 1136 . . . . . . . . . . 11 ((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) → 𝑁 ∈ ℝ+)
1514adantr 484 . . . . . . . . . 10 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → 𝑁 ∈ ℝ+)
16 simpr 488 . . . . . . . . . . 11 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → (𝐴 mod 𝑁) = 0)
17 0mod 13458 . . . . . . . . . . . 12 (𝑁 ∈ ℝ+ → (0 mod 𝑁) = 0)
1815, 17syl 17 . . . . . . . . . . 11 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → (0 mod 𝑁) = 0)
1916, 18eqtr4d 2777 . . . . . . . . . 10 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → (𝐴 mod 𝑁) = (0 mod 𝑁))
20 modexp 13788 . . . . . . . . . 10 (((𝐴 ∈ ℤ ∧ 0 ∈ ℤ) ∧ (𝐵 ∈ ℕ0𝑁 ∈ ℝ+) ∧ (𝐴 mod 𝑁) = (0 mod 𝑁)) → ((𝐴𝐵) mod 𝑁) = ((0↑𝐵) mod 𝑁))
218, 9, 12, 15, 19, 20syl221anc 1383 . . . . . . . . 9 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → ((𝐴𝐵) mod 𝑁) = ((0↑𝐵) mod 𝑁))
227, 21, 193eqtr4d 2784 . . . . . . . 8 (((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) ∧ (𝐴 mod 𝑁) = 0) → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁))
2322ex 416 . . . . . . 7 ((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) → ((𝐴 mod 𝑁) = 0 → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁)))
244, 23syld 47 . . . . . 6 ((𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ) → (𝑁𝐴 → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁)))
25243exp 1121 . . . . 5 (𝐴 ∈ ℤ → (𝑁 ∈ ℕ → (𝐵 ∈ ℕ → (𝑁𝐴 → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁)))))
2625com24 95 . . . 4 (𝐴 ∈ ℤ → (𝑁𝐴 → (𝐵 ∈ ℕ → (𝑁 ∈ ℕ → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁)))))
2726adantl 485 . . 3 ((𝑁 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (𝑁𝐴 → (𝐵 ∈ ℕ → (𝑁 ∈ ℕ → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁)))))
281, 27mpcom 38 . 2 (𝑁𝐴 → (𝐵 ∈ ℕ → (𝑁 ∈ ℕ → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁))))
29283imp31 1114 1 ((𝑁 ∈ ℕ ∧ 𝐵 ∈ ℕ ∧ 𝑁𝐴) → ((𝐴𝐵) mod 𝑁) = (𝐴 mod 𝑁))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 399  w3a 1089   = wceq 1543  wcel 2110   class class class wbr 5043  (class class class)co 7202  0cc0 10712  cn 11813  0cn0 12073  cz 12159  +crp 12569   mod cmo 13425  cexp 13618  cdvds 15796
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1803  ax-4 1817  ax-5 1918  ax-6 1976  ax-7 2016  ax-8 2112  ax-9 2120  ax-10 2141  ax-11 2158  ax-12 2175  ax-ext 2706  ax-sep 5181  ax-nul 5188  ax-pow 5247  ax-pr 5311  ax-un 7512  ax-cnex 10768  ax-resscn 10769  ax-1cn 10770  ax-icn 10771  ax-addcl 10772  ax-addrcl 10773  ax-mulcl 10774  ax-mulrcl 10775  ax-mulcom 10776  ax-addass 10777  ax-mulass 10778  ax-distr 10779  ax-i2m1 10780  ax-1ne0 10781  ax-1rid 10782  ax-rnegex 10783  ax-rrecex 10784  ax-cnre 10785  ax-pre-lttri 10786  ax-pre-lttrn 10787  ax-pre-ltadd 10788  ax-pre-mulgt0 10789  ax-pre-sup 10790
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 848  df-3or 1090  df-3an 1091  df-tru 1546  df-fal 1556  df-ex 1788  df-nf 1792  df-sb 2071  df-mo 2537  df-eu 2566  df-clab 2713  df-cleq 2726  df-clel 2812  df-nfc 2882  df-ne 2936  df-nel 3040  df-ral 3059  df-rex 3060  df-reu 3061  df-rmo 3062  df-rab 3063  df-v 3403  df-sbc 3688  df-csb 3803  df-dif 3860  df-un 3862  df-in 3864  df-ss 3874  df-pss 3876  df-nul 4228  df-if 4430  df-pw 4505  df-sn 4532  df-pr 4534  df-tp 4536  df-op 4538  df-uni 4810  df-iun 4896  df-br 5044  df-opab 5106  df-mpt 5125  df-tr 5151  df-id 5444  df-eprel 5449  df-po 5457  df-so 5458  df-fr 5498  df-we 5500  df-xp 5546  df-rel 5547  df-cnv 5548  df-co 5549  df-dm 5550  df-rn 5551  df-res 5552  df-ima 5553  df-pred 6149  df-ord 6205  df-on 6206  df-lim 6207  df-suc 6208  df-iota 6327  df-fun 6371  df-fn 6372  df-f 6373  df-f1 6374  df-fo 6375  df-f1o 6376  df-fv 6377  df-riota 7159  df-ov 7205  df-oprab 7206  df-mpo 7207  df-om 7634  df-2nd 7751  df-wrecs 8036  df-recs 8097  df-rdg 8135  df-er 8380  df-en 8616  df-dom 8617  df-sdom 8618  df-sup 9047  df-inf 9048  df-pnf 10852  df-mnf 10853  df-xr 10854  df-ltxr 10855  df-le 10856  df-sub 11047  df-neg 11048  df-div 11473  df-nn 11814  df-n0 12074  df-z 12160  df-uz 12422  df-rp 12570  df-fl 13350  df-mod 13426  df-seq 13558  df-exp 13619  df-dvds 15797
This theorem is referenced by:  fermltl  16318
  Copyright terms: Public domain W3C validator