MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  mod2xnegi Structured version   Unicode version

Theorem mod2xnegi 14644
Description: Version of mod2xi 14642 with a negative mod value. (Contributed by Mario Carneiro, 21-Feb-2014.)
Hypotheses
Ref Expression
mod2xnegi.1  |-  A  e.  NN
mod2xnegi.2  |-  B  e. 
NN0
mod2xnegi.3  |-  D  e.  ZZ
mod2xnegi.4  |-  K  e.  NN
mod2xnegi.5  |-  M  e. 
NN0
mod2xnegi.6  |-  L  e. 
NN0
mod2xnegi.10  |-  ( ( A ^ B )  mod  N )  =  ( L  mod  N
)
mod2xnegi.7  |-  ( 2  x.  B )  =  E
mod2xnegi.8  |-  ( L  +  K )  =  N
mod2xnegi.9  |-  ( ( D  x.  N )  +  M )  =  ( K  x.  K
)
Assertion
Ref Expression
mod2xnegi  |-  ( ( A ^ E )  mod  N )  =  ( M  mod  N
)

Proof of Theorem mod2xnegi
StepHypRef Expression
1 mod2xnegi.8 . . 3  |-  ( L  +  K )  =  N
2 mod2xnegi.6 . . . 4  |-  L  e. 
NN0
3 mod2xnegi.4 . . . 4  |-  K  e.  NN
4 nn0nnaddcl 10823 . . . 4  |-  ( ( L  e.  NN0  /\  K  e.  NN )  ->  ( L  +  K
)  e.  NN )
52, 3, 4mp2an 670 . . 3  |-  ( L  +  K )  e.  NN
61, 5eqeltrri 2539 . 2  |-  N  e.  NN
7 mod2xnegi.1 . 2  |-  A  e.  NN
8 mod2xnegi.2 . 2  |-  B  e. 
NN0
96nnzi 10884 . . . 4  |-  N  e.  ZZ
10 mod2xnegi.3 . . . 4  |-  D  e.  ZZ
11 zaddcl 10900 . . . 4  |-  ( ( N  e.  ZZ  /\  D  e.  ZZ )  ->  ( N  +  D
)  e.  ZZ )
129, 10, 11mp2an 670 . . 3  |-  ( N  +  D )  e.  ZZ
133nnnn0i 10799 . . . . 5  |-  K  e. 
NN0
1413, 13nn0addcli 10829 . . . 4  |-  ( K  +  K )  e. 
NN0
1514nn0zi 10885 . . 3  |-  ( K  +  K )  e.  ZZ
16 zsubcl 10902 . . 3  |-  ( ( ( N  +  D
)  e.  ZZ  /\  ( K  +  K
)  e.  ZZ )  ->  ( ( N  +  D )  -  ( K  +  K
) )  e.  ZZ )
1712, 15, 16mp2an 670 . 2  |-  ( ( N  +  D )  -  ( K  +  K ) )  e.  ZZ
18 mod2xnegi.5 . 2  |-  M  e. 
NN0
19 mod2xnegi.10 . 2  |-  ( ( A ^ B )  mod  N )  =  ( L  mod  N
)
20 mod2xnegi.7 . 2  |-  ( 2  x.  B )  =  E
216nncni 10541 . . . . . 6  |-  N  e.  CC
22 zcn 10865 . . . . . . 7  |-  ( D  e.  ZZ  ->  D  e.  CC )
2310, 22ax-mp 5 . . . . . 6  |-  D  e.  CC
2421, 23addcli 9589 . . . . 5  |-  ( N  +  D )  e.  CC
253nncni 10541 . . . . . 6  |-  K  e.  CC
2625, 25addcli 9589 . . . . 5  |-  ( K  +  K )  e.  CC
2724, 26, 21subdiri 10002 . . . 4  |-  ( ( ( N  +  D
)  -  ( K  +  K ) )  x.  N )  =  ( ( ( N  +  D )  x.  N )  -  (
( K  +  K
)  x.  N ) )
2827oveq1i 6280 . . 3  |-  ( ( ( ( N  +  D )  -  ( K  +  K )
)  x.  N )  +  M )  =  ( ( ( ( N  +  D )  x.  N )  -  ( ( K  +  K )  x.  N
) )  +  M
)
2924, 21mulcli 9590 . . . 4  |-  ( ( N  +  D )  x.  N )  e.  CC
3018nn0cni 10803 . . . 4  |-  M  e.  CC
3126, 21mulcli 9590 . . . 4  |-  ( ( K  +  K )  x.  N )  e.  CC
3229, 30, 31addsubi 9903 . . 3  |-  ( ( ( ( N  +  D )  x.  N
)  +  M )  -  ( ( K  +  K )  x.  N ) )  =  ( ( ( ( N  +  D )  x.  N )  -  ( ( K  +  K )  x.  N
) )  +  M
)
33 mod2xnegi.9 . . . . . . 7  |-  ( ( D  x.  N )  +  M )  =  ( K  x.  K
)
3433oveq2i 6281 . . . . . 6  |-  ( ( N  x.  N )  +  ( ( D  x.  N )  +  M ) )  =  ( ( N  x.  N )  +  ( K  x.  K ) )
3521, 25, 25adddii 9595 . . . . . 6  |-  ( N  x.  ( K  +  K ) )  =  ( ( N  x.  K )  +  ( N  x.  K ) )
3634, 35oveq12i 6282 . . . . 5  |-  ( ( ( N  x.  N
)  +  ( ( D  x.  N )  +  M ) )  -  ( N  x.  ( K  +  K
) ) )  =  ( ( ( N  x.  N )  +  ( K  x.  K
) )  -  (
( N  x.  K
)  +  ( N  x.  K ) ) )
3721, 23, 21adddiri 9596 . . . . . . . 8  |-  ( ( N  +  D )  x.  N )  =  ( ( N  x.  N )  +  ( D  x.  N ) )
3837oveq1i 6280 . . . . . . 7  |-  ( ( ( N  +  D
)  x.  N )  +  M )  =  ( ( ( N  x.  N )  +  ( D  x.  N
) )  +  M
)
3921, 21mulcli 9590 . . . . . . . 8  |-  ( N  x.  N )  e.  CC
4023, 21mulcli 9590 . . . . . . . 8  |-  ( D  x.  N )  e.  CC
4139, 40, 30addassi 9593 . . . . . . 7  |-  ( ( ( N  x.  N
)  +  ( D  x.  N ) )  +  M )  =  ( ( N  x.  N )  +  ( ( D  x.  N
)  +  M ) )
4238, 41eqtr2i 2484 . . . . . 6  |-  ( ( N  x.  N )  +  ( ( D  x.  N )  +  M ) )  =  ( ( ( N  +  D )  x.  N )  +  M
)
4321, 26mulcomi 9591 . . . . . 6  |-  ( N  x.  ( K  +  K ) )  =  ( ( K  +  K )  x.  N
)
4442, 43oveq12i 6282 . . . . 5  |-  ( ( ( N  x.  N
)  +  ( ( D  x.  N )  +  M ) )  -  ( N  x.  ( K  +  K
) ) )  =  ( ( ( ( N  +  D )  x.  N )  +  M )  -  (
( K  +  K
)  x.  N ) )
4536, 44eqtr3i 2485 . . . 4  |-  ( ( ( N  x.  N
)  +  ( K  x.  K ) )  -  ( ( N  x.  K )  +  ( N  x.  K
) ) )  =  ( ( ( ( N  +  D )  x.  N )  +  M )  -  (
( K  +  K
)  x.  N ) )
46 mulsub 9995 . . . . . 6  |-  ( ( ( N  e.  CC  /\  K  e.  CC )  /\  ( N  e.  CC  /\  K  e.  CC ) )  -> 
( ( N  -  K )  x.  ( N  -  K )
)  =  ( ( ( N  x.  N
)  +  ( K  x.  K ) )  -  ( ( N  x.  K )  +  ( N  x.  K
) ) ) )
4721, 25, 21, 25, 46mp4an 671 . . . . 5  |-  ( ( N  -  K )  x.  ( N  -  K ) )  =  ( ( ( N  x.  N )  +  ( K  x.  K
) )  -  (
( N  x.  K
)  +  ( N  x.  K ) ) )
482nn0cni 10803 . . . . . . . 8  |-  L  e.  CC
4921, 25, 48subadd2i 9899 . . . . . . 7  |-  ( ( N  -  K )  =  L  <->  ( L  +  K )  =  N )
501, 49mpbir 209 . . . . . 6  |-  ( N  -  K )  =  L
5150, 50oveq12i 6282 . . . . 5  |-  ( ( N  -  K )  x.  ( N  -  K ) )  =  ( L  x.  L
)
5247, 51eqtr3i 2485 . . . 4  |-  ( ( ( N  x.  N
)  +  ( K  x.  K ) )  -  ( ( N  x.  K )  +  ( N  x.  K
) ) )  =  ( L  x.  L
)
5345, 52eqtr3i 2485 . . 3  |-  ( ( ( ( N  +  D )  x.  N
)  +  M )  -  ( ( K  +  K )  x.  N ) )  =  ( L  x.  L
)
5428, 32, 533eqtr2i 2489 . 2  |-  ( ( ( ( N  +  D )  -  ( K  +  K )
)  x.  N )  +  M )  =  ( L  x.  L
)
556, 7, 8, 17, 2, 18, 19, 20, 54mod2xi 14642 1  |-  ( ( A ^ E )  mod  N )  =  ( M  mod  N
)
Colors of variables: wff setvar class
Syntax hints:    = wceq 1398    e. wcel 1823  (class class class)co 6270   CCcc 9479    + caddc 9484    x. cmul 9486    - cmin 9796   NNcn 10531   2c2 10581   NN0cn0 10791   ZZcz 10860    mod cmo 11978   ^cexp 12151
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1623  ax-4 1636  ax-5 1709  ax-6 1752  ax-7 1795  ax-8 1825  ax-9 1827  ax-10 1842  ax-11 1847  ax-12 1859  ax-13 2004  ax-ext 2432  ax-sep 4560  ax-nul 4568  ax-pow 4615  ax-pr 4676  ax-un 6565  ax-cnex 9537  ax-resscn 9538  ax-1cn 9539  ax-icn 9540  ax-addcl 9541  ax-addrcl 9542  ax-mulcl 9543  ax-mulrcl 9544  ax-mulcom 9545  ax-addass 9546  ax-mulass 9547  ax-distr 9548  ax-i2m1 9549  ax-1ne0 9550  ax-1rid 9551  ax-rnegex 9552  ax-rrecex 9553  ax-cnre 9554  ax-pre-lttri 9555  ax-pre-lttrn 9556  ax-pre-ltadd 9557  ax-pre-mulgt0 9558  ax-pre-sup 9559
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 972  df-3an 973  df-tru 1401  df-ex 1618  df-nf 1622  df-sb 1745  df-eu 2288  df-mo 2289  df-clab 2440  df-cleq 2446  df-clel 2449  df-nfc 2604  df-ne 2651  df-nel 2652  df-ral 2809  df-rex 2810  df-reu 2811  df-rmo 2812  df-rab 2813  df-v 3108  df-sbc 3325  df-csb 3421  df-dif 3464  df-un 3466  df-in 3468  df-ss 3475  df-pss 3477  df-nul 3784  df-if 3930  df-pw 4001  df-sn 4017  df-pr 4019  df-tp 4021  df-op 4023  df-uni 4236  df-iun 4317  df-br 4440  df-opab 4498  df-mpt 4499  df-tr 4533  df-eprel 4780  df-id 4784  df-po 4789  df-so 4790  df-fr 4827  df-we 4829  df-ord 4870  df-on 4871  df-lim 4872  df-suc 4873  df-xp 4994  df-rel 4995  df-cnv 4996  df-co 4997  df-dm 4998  df-rn 4999  df-res 5000  df-ima 5001  df-iota 5534  df-fun 5572  df-fn 5573  df-f 5574  df-f1 5575  df-fo 5576  df-f1o 5577  df-fv 5578  df-riota 6232  df-ov 6273  df-oprab 6274  df-mpt2 6275  df-om 6674  df-2nd 6774  df-recs 7034  df-rdg 7068  df-er 7303  df-en 7510  df-dom 7511  df-sdom 7512  df-sup 7893  df-pnf 9619  df-mnf 9620  df-xr 9621  df-ltxr 9622  df-le 9623  df-sub 9798  df-neg 9799  df-div 10203  df-nn 10532  df-2 10590  df-n0 10792  df-z 10861  df-uz 11083  df-rp 11222  df-fl 11910  df-mod 11979  df-seq 12093  df-exp 12152
This theorem is referenced by:  1259lem4  14703  2503lem2  14707
  Copyright terms: Public domain W3C validator