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

Theorem modqmuladd 9518
Description: Decomposition of an integer into a multiple of a modulus and a remainder. (Contributed by Jim Kingdon, 23-Oct-2021.)
Hypotheses
Ref Expression
modqmuladd.a  |-  ( ph  ->  A  e.  ZZ )
modqmuladd.bq  |-  ( ph  ->  B  e.  QQ )
modqmuladd.b  |-  ( ph  ->  B  e.  ( 0 [,) M ) )
modqmuladd.m  |-  ( ph  ->  M  e.  QQ )
modqmuladd.mgt0  |-  ( ph  ->  0  <  M )
Assertion
Ref Expression
modqmuladd  |-  ( ph  ->  ( ( A  mod  M )  =  B  <->  E. k  e.  ZZ  A  =  ( ( k  x.  M
)  +  B ) ) )
Distinct variable groups:    A, k    B, k    k, M    ph, k

Proof of Theorem modqmuladd
StepHypRef Expression
1 modqmuladd.a . . . . . . 7  |-  ( ph  ->  A  e.  ZZ )
2 zq 8862 . . . . . . 7  |-  ( A  e.  ZZ  ->  A  e.  QQ )
31, 2syl 14 . . . . . 6  |-  ( ph  ->  A  e.  QQ )
4 modqmuladd.m . . . . . 6  |-  ( ph  ->  M  e.  QQ )
5 modqmuladd.mgt0 . . . . . . 7  |-  ( ph  ->  0  <  M )
65gt0ne0d 7750 . . . . . 6  |-  ( ph  ->  M  =/=  0 )
7 qdivcl 8879 . . . . . 6  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  M  =/=  0 )  ->  ( A  /  M )  e.  QQ )
83, 4, 6, 7syl3anc 1170 . . . . 5  |-  ( ph  ->  ( A  /  M
)  e.  QQ )
98flqcld 9429 . . . 4  |-  ( ph  ->  ( |_ `  ( A  /  M ) )  e.  ZZ )
10 oveq1 5571 . . . . . . 7  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  (
k  x.  M )  =  ( ( |_
`  ( A  /  M ) )  x.  M ) )
1110oveq1d 5579 . . . . . 6  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  (
( k  x.  M
)  +  ( A  mod  M ) )  =  ( ( ( |_ `  ( A  /  M ) )  x.  M )  +  ( A  mod  M
) ) )
1211eqeq2d 2094 . . . . 5  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  ( A  =  ( (
k  x.  M )  +  ( A  mod  M ) )  <->  A  =  ( ( ( |_
`  ( A  /  M ) )  x.  M )  +  ( A  mod  M ) ) ) )
1312adantl 271 . . . 4  |-  ( (
ph  /\  k  =  ( |_ `  ( A  /  M ) ) )  ->  ( A  =  ( ( k  x.  M )  +  ( A  mod  M
) )  <->  A  =  ( ( ( |_
`  ( A  /  M ) )  x.  M )  +  ( A  mod  M ) ) ) )
14 flqpmodeq 9479 . . . . . 6  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( ( |_ `  ( A  /  M
) )  x.  M
)  +  ( A  mod  M ) )  =  A )
153, 4, 5, 14syl3anc 1170 . . . . 5  |-  ( ph  ->  ( ( ( |_
`  ( A  /  M ) )  x.  M )  +  ( A  mod  M ) )  =  A )
1615eqcomd 2088 . . . 4  |-  ( ph  ->  A  =  ( ( ( |_ `  ( A  /  M ) )  x.  M )  +  ( A  mod  M
) ) )
179, 13, 16rspcedvd 2716 . . 3  |-  ( ph  ->  E. k  e.  ZZ  A  =  ( (
k  x.  M )  +  ( A  mod  M ) ) )
18 oveq2 5572 . . . . . 6  |-  ( B  =  ( A  mod  M )  ->  ( (
k  x.  M )  +  B )  =  ( ( k  x.  M )  +  ( A  mod  M ) ) )
1918eqeq2d 2094 . . . . 5  |-  ( B  =  ( A  mod  M )  ->  ( A  =  ( ( k  x.  M )  +  B )  <->  A  =  ( ( k  x.  M )  +  ( A  mod  M ) ) ) )
2019eqcoms 2086 . . . 4  |-  ( ( A  mod  M )  =  B  ->  ( A  =  ( (
k  x.  M )  +  B )  <->  A  =  ( ( k  x.  M )  +  ( A  mod  M ) ) ) )
2120rexbidv 2374 . . 3  |-  ( ( A  mod  M )  =  B  ->  ( E. k  e.  ZZ  A  =  ( (
k  x.  M )  +  B )  <->  E. k  e.  ZZ  A  =  ( ( k  x.  M
)  +  ( A  mod  M ) ) ) )
2217, 21syl5ibrcom 155 . 2  |-  ( ph  ->  ( ( A  mod  M )  =  B  ->  E. k  e.  ZZ  A  =  ( (
k  x.  M )  +  B ) ) )
23 oveq1 5571 . . . . . 6  |-  ( A  =  ( ( k  x.  M )  +  B )  ->  ( A  mod  M )  =  ( ( ( k  x.  M )  +  B )  mod  M
) )
2423adantl 271 . . . . 5  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
( A  mod  M
)  =  ( ( ( k  x.  M
)  +  B )  mod  M ) )
25 simplr 497 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
k  e.  ZZ )
264ad2antrr 472 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  ->  M  e.  QQ )
27 modqmuladd.bq . . . . . . 7  |-  ( ph  ->  B  e.  QQ )
2827ad2antrr 472 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  ->  B  e.  QQ )
29 modqmuladd.b . . . . . . 7  |-  ( ph  ->  B  e.  ( 0 [,) M ) )
3029ad2antrr 472 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  ->  B  e.  ( 0 [,) M ) )
31 mulqaddmodid 9516 . . . . . 6  |-  ( ( ( k  e.  ZZ  /\  M  e.  QQ )  /\  ( B  e.  QQ  /\  B  e.  ( 0 [,) M
) ) )  -> 
( ( ( k  x.  M )  +  B )  mod  M
)  =  B )
3225, 26, 28, 30, 31syl22anc 1171 . . . . 5  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
( ( ( k  x.  M )  +  B )  mod  M
)  =  B )
3324, 32eqtrd 2115 . . . 4  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
( A  mod  M
)  =  B )
3433ex 113 . . 3  |-  ( (
ph  /\  k  e.  ZZ )  ->  ( A  =  ( ( k  x.  M )  +  B )  ->  ( A  mod  M )  =  B ) )
3534rexlimdva 2482 . 2  |-  ( ph  ->  ( E. k  e.  ZZ  A  =  ( ( k  x.  M
)  +  B )  ->  ( A  mod  M )  =  B ) )
3622, 35impbid 127 1  |-  ( ph  ->  ( ( A  mod  M )  =  B  <->  E. k  e.  ZZ  A  =  ( ( k  x.  M
)  +  B ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 102    <-> wb 103    = wceq 1285    e. wcel 1434    =/= wne 2249   E.wrex 2354   class class class wbr 3805   ` cfv 4952  (class class class)co 5564   0cc0 7113    + caddc 7116    x. cmul 7118    < clt 7285    / cdiv 7897   ZZcz 8502   QQcq 8855   [,)cico 9059   |_cfl 9420    mod cmo 9474
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 577  ax-in2 578  ax-io 663  ax-5 1377  ax-7 1378  ax-gen 1379  ax-ie1 1423  ax-ie2 1424  ax-8 1436  ax-10 1437  ax-11 1438  ax-i12 1439  ax-bndl 1440  ax-4 1441  ax-13 1445  ax-14 1446  ax-17 1460  ax-i9 1464  ax-ial 1468  ax-i5r 1469  ax-ext 2065  ax-sep 3916  ax-pow 3968  ax-pr 3992  ax-un 4216  ax-setind 4308  ax-cnex 7199  ax-resscn 7200  ax-1cn 7201  ax-1re 7202  ax-icn 7203  ax-addcl 7204  ax-addrcl 7205  ax-mulcl 7206  ax-mulrcl 7207  ax-addcom 7208  ax-mulcom 7209  ax-addass 7210  ax-mulass 7211  ax-distr 7212  ax-i2m1 7213  ax-0lt1 7214  ax-1rid 7215  ax-0id 7216  ax-rnegex 7217  ax-precex 7218  ax-cnre 7219  ax-pre-ltirr 7220  ax-pre-ltwlin 7221  ax-pre-lttrn 7222  ax-pre-apti 7223  ax-pre-ltadd 7224  ax-pre-mulgt0 7225  ax-pre-mulext 7226  ax-arch 7227
This theorem depends on definitions:  df-bi 115  df-3or 921  df-3an 922  df-tru 1288  df-fal 1291  df-nf 1391  df-sb 1688  df-eu 1946  df-mo 1947  df-clab 2070  df-cleq 2076  df-clel 2079  df-nfc 2212  df-ne 2250  df-nel 2345  df-ral 2358  df-rex 2359  df-reu 2360  df-rmo 2361  df-rab 2362  df-v 2612  df-sbc 2825  df-csb 2918  df-dif 2984  df-un 2986  df-in 2988  df-ss 2995  df-pw 3402  df-sn 3422  df-pr 3423  df-op 3425  df-uni 3622  df-int 3657  df-iun 3700  df-br 3806  df-opab 3860  df-mpt 3861  df-id 4076  df-po 4079  df-iso 4080  df-xp 4397  df-rel 4398  df-cnv 4399  df-co 4400  df-dm 4401  df-rn 4402  df-res 4403  df-ima 4404  df-iota 4917  df-fun 4954  df-fn 4955  df-f 4956  df-fv 4960  df-riota 5520  df-ov 5567  df-oprab 5568  df-mpt2 5569  df-1st 5819  df-2nd 5820  df-pnf 7287  df-mnf 7288  df-xr 7289  df-ltxr 7290  df-le 7291  df-sub 7418  df-neg 7419  df-reap 7812  df-ap 7819  df-div 7898  df-inn 8177  df-n0 8426  df-z 8503  df-q 8856  df-rp 8886  df-ico 9063  df-fl 9422  df-mod 9475
This theorem is referenced by:  modqmuladdim  9519
  Copyright terms: Public domain W3C validator