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

Theorem dvdsmodexp 12181
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 12631). (Contributed by Mario Carneiro, 28-Feb-2014.) (Revised by AV, 19-Mar-2022.)
Assertion
Ref Expression
dvdsmodexp  |-  ( ( N  e.  NN  /\  B  e.  NN  /\  N  ||  A )  ->  (
( A ^ B
)  mod  N )  =  ( A  mod  N ) )

Proof of Theorem dvdsmodexp
StepHypRef Expression
1 dvdszrcl 12178 . . 3  |-  ( N 
||  A  ->  ( N  e.  ZZ  /\  A  e.  ZZ ) )
2 dvdsmod0 12179 . . . . . . . . 9  |-  ( ( N  e.  NN  /\  N  ||  A )  -> 
( A  mod  N
)  =  0 )
323ad2antl2 1163 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  N  ||  A )  ->  ( A  mod  N )  =  0 )
43ex 115 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  ->  ( N  ||  A  ->  ( A  mod  N )  =  0 ) )
5 simpl3 1005 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  B  e.  NN )
650expd 10856 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  ( 0 ^ B )  =  0 )
76oveq1d 5972 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  ( ( 0 ^ B )  mod 
N )  =  ( 0  mod  N ) )
8 simpl1 1003 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  A  e.  ZZ )
9 0zd 9404 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  0  e.  ZZ )
10 nnnn0 9322 . . . . . . . . . . . 12  |-  ( B  e.  NN  ->  B  e.  NN0 )
11103ad2ant3 1023 . . . . . . . . . . 11  |-  ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  ->  B  e.  NN0 )
1211adantr 276 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  B  e.  NN0 )
13 simpl2 1004 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  N  e.  NN )
14 nnq 9774 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  N  e.  QQ )
1513, 14syl 14 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  N  e.  QQ )
16 nnrp 9805 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  N  e.  RR+ )
17163ad2ant2 1022 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  ->  N  e.  RR+ )
1817adantr 276 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  N  e.  RR+ )
1918rpgt0d 9841 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  0  <  N
)
20 simpr 110 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  ( A  mod  N )  =  0 )
21 q0mod 10522 . . . . . . . . . . . 12  |-  ( ( N  e.  QQ  /\  0  <  N )  -> 
( 0  mod  N
)  =  0 )
2215, 19, 21syl2anc 411 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  ( 0  mod 
N )  =  0 )
2320, 22eqtr4d 2242 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  ( A  mod  N )  =  ( 0  mod  N ) )
248, 9, 12, 15, 19, 23modqexp 10833 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  ( ( A ^ B )  mod 
N )  =  ( ( 0 ^ B
)  mod  N )
)
257, 24, 233eqtr4d 2249 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  /\  ( A  mod  N
)  =  0 )  ->  ( ( A ^ B )  mod 
N )  =  ( A  mod  N ) )
2625ex 115 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  ->  (
( A  mod  N
)  =  0  -> 
( ( A ^ B )  mod  N
)  =  ( A  mod  N ) ) )
274, 26syld 45 . . . . . 6  |-  ( ( A  e.  ZZ  /\  N  e.  NN  /\  B  e.  NN )  ->  ( N  ||  A  ->  (
( A ^ B
)  mod  N )  =  ( A  mod  N ) ) )
28273exp 1205 . . . . 5  |-  ( A  e.  ZZ  ->  ( N  e.  NN  ->  ( B  e.  NN  ->  ( N  ||  A  -> 
( ( A ^ B )  mod  N
)  =  ( A  mod  N ) ) ) ) )
2928com24 87 . . . 4  |-  ( A  e.  ZZ  ->  ( N  ||  A  ->  ( B  e.  NN  ->  ( N  e.  NN  ->  ( ( A ^ B
)  mod  N )  =  ( A  mod  N ) ) ) ) )
3029adantl 277 . . 3  |-  ( ( N  e.  ZZ  /\  A  e.  ZZ )  ->  ( N  ||  A  ->  ( B  e.  NN  ->  ( N  e.  NN  ->  ( ( A ^ B )  mod  N
)  =  ( A  mod  N ) ) ) ) )
311, 30mpcom 36 . 2  |-  ( N 
||  A  ->  ( B  e.  NN  ->  ( N  e.  NN  ->  ( ( A ^ B
)  mod  N )  =  ( A  mod  N ) ) ) )
32313imp31 1199 1  |-  ( ( N  e.  NN  /\  B  e.  NN  /\  N  ||  A )  ->  (
( A ^ B
)  mod  N )  =  ( A  mod  N ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 104    /\ w3a 981    = wceq 1373    e. wcel 2177   class class class wbr 4051  (class class class)co 5957   0cc0 7945    < clt 8127   NNcn 9056   NN0cn0 9315   ZZcz 9392   QQcq 9760   RR+crp 9795    mod cmo 10489   ^cexp 10705    || cdvds 12173
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 4167  ax-sep 4170  ax-nul 4178  ax-pow 4226  ax-pr 4261  ax-un 4488  ax-setind 4593  ax-iinf 4644  ax-cnex 8036  ax-resscn 8037  ax-1cn 8038  ax-1re 8039  ax-icn 8040  ax-addcl 8041  ax-addrcl 8042  ax-mulcl 8043  ax-mulrcl 8044  ax-addcom 8045  ax-mulcom 8046  ax-addass 8047  ax-mulass 8048  ax-distr 8049  ax-i2m1 8050  ax-0lt1 8051  ax-1rid 8052  ax-0id 8053  ax-rnegex 8054  ax-precex 8055  ax-cnre 8056  ax-pre-ltirr 8057  ax-pre-ltwlin 8058  ax-pre-lttrn 8059  ax-pre-apti 8060  ax-pre-ltadd 8061  ax-pre-mulgt0 8062  ax-pre-mulext 8063  ax-arch 8064
This theorem depends on definitions:  df-bi 117  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 3003  df-csb 3098  df-dif 3172  df-un 3174  df-in 3176  df-ss 3183  df-nul 3465  df-if 3576  df-pw 3623  df-sn 3644  df-pr 3645  df-op 3647  df-uni 3857  df-int 3892  df-iun 3935  df-br 4052  df-opab 4114  df-mpt 4115  df-tr 4151  df-id 4348  df-po 4351  df-iso 4352  df-iord 4421  df-on 4423  df-ilim 4424  df-suc 4426  df-iom 4647  df-xp 4689  df-rel 4690  df-cnv 4691  df-co 4692  df-dm 4693  df-rn 4694  df-res 4695  df-ima 4696  df-iota 5241  df-fun 5282  df-fn 5283  df-f 5284  df-f1 5285  df-fo 5286  df-f1o 5287  df-fv 5288  df-riota 5912  df-ov 5960  df-oprab 5961  df-mpo 5962  df-1st 6239  df-2nd 6240  df-recs 6404  df-frec 6490  df-pnf 8129  df-mnf 8130  df-xr 8131  df-ltxr 8132  df-le 8133  df-sub 8265  df-neg 8266  df-reap 8668  df-ap 8675  df-div 8766  df-inn 9057  df-n0 9316  df-z 9393  df-uz 9669  df-q 9761  df-rp 9796  df-fl 10435  df-mod 10490  df-seqfrec 10615  df-exp 10706  df-dvds 12174
This theorem is referenced by:  fermltl  12631
  Copyright terms: Public domain W3C validator