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

Theorem modqmuladd 9769
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 9109 . . . . . . 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 7988 . . . . . 6  |-  ( ph  ->  M  =/=  0 )
7 qdivcl 9126 . . . . . 6  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  M  =/=  0 )  ->  ( A  /  M )  e.  QQ )
83, 4, 6, 7syl3anc 1174 . . . . 5  |-  ( ph  ->  ( A  /  M
)  e.  QQ )
98flqcld 9680 . . . 4  |-  ( ph  ->  ( |_ `  ( A  /  M ) )  e.  ZZ )
10 oveq1 5659 . . . . . . 7  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  (
k  x.  M )  =  ( ( |_
`  ( A  /  M ) )  x.  M ) )
1110oveq1d 5667 . . . . . 6  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  (
( k  x.  M
)  +  ( A  mod  M ) )  =  ( ( ( |_ `  ( A  /  M ) )  x.  M )  +  ( A  mod  M
) ) )
1211eqeq2d 2099 . . . . 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 9730 . . . . . 6  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( ( |_ `  ( A  /  M
) )  x.  M
)  +  ( A  mod  M ) )  =  A )
153, 4, 5, 14syl3anc 1174 . . . . 5  |-  ( ph  ->  ( ( ( |_
`  ( A  /  M ) )  x.  M )  +  ( A  mod  M ) )  =  A )
1615eqcomd 2093 . . . 4  |-  ( ph  ->  A  =  ( ( ( |_ `  ( A  /  M ) )  x.  M )  +  ( A  mod  M
) ) )
179, 13, 16rspcedvd 2728 . . 3  |-  ( ph  ->  E. k  e.  ZZ  A  =  ( (
k  x.  M )  +  ( A  mod  M ) ) )
18 oveq2 5660 . . . . . 6  |-  ( B  =  ( A  mod  M )  ->  ( (
k  x.  M )  +  B )  =  ( ( k  x.  M )  +  ( A  mod  M ) ) )
1918eqeq2d 2099 . . . . 5  |-  ( B  =  ( A  mod  M )  ->  ( A  =  ( ( k  x.  M )  +  B )  <->  A  =  ( ( k  x.  M )  +  ( A  mod  M ) ) ) )
2019eqcoms 2091 . . . 4  |-  ( ( A  mod  M )  =  B  ->  ( A  =  ( (
k  x.  M )  +  B )  <->  A  =  ( ( k  x.  M )  +  ( A  mod  M ) ) ) )
2120rexbidv 2381 . . 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 5659 . . . . . 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 9767 . . . . . 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 1175 . . . . 5  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
( ( ( k  x.  M )  +  B )  mod  M
)  =  B )
3324, 32eqtrd 2120 . . . 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 2489 . 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 1289    e. wcel 1438    =/= wne 2255   E.wrex 2360   class class class wbr 3845   ` cfv 5015  (class class class)co 5652   0cc0 7348    + caddc 7351    x. cmul 7353    < clt 7520    / cdiv 8137   ZZcz 8748   QQcq 9102   [,)cico 9306   |_cfl 9671    mod cmo 9725
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 579  ax-in2 580  ax-io 665  ax-5 1381  ax-7 1382  ax-gen 1383  ax-ie1 1427  ax-ie2 1428  ax-8 1440  ax-10 1441  ax-11 1442  ax-i12 1443  ax-bndl 1444  ax-4 1445  ax-13 1449  ax-14 1450  ax-17 1464  ax-i9 1468  ax-ial 1472  ax-i5r 1473  ax-ext 2070  ax-sep 3957  ax-pow 4009  ax-pr 4036  ax-un 4260  ax-setind 4353  ax-cnex 7434  ax-resscn 7435  ax-1cn 7436  ax-1re 7437  ax-icn 7438  ax-addcl 7439  ax-addrcl 7440  ax-mulcl 7441  ax-mulrcl 7442  ax-addcom 7443  ax-mulcom 7444  ax-addass 7445  ax-mulass 7446  ax-distr 7447  ax-i2m1 7448  ax-0lt1 7449  ax-1rid 7450  ax-0id 7451  ax-rnegex 7452  ax-precex 7453  ax-cnre 7454  ax-pre-ltirr 7455  ax-pre-ltwlin 7456  ax-pre-lttrn 7457  ax-pre-apti 7458  ax-pre-ltadd 7459  ax-pre-mulgt0 7460  ax-pre-mulext 7461  ax-arch 7462
This theorem depends on definitions:  df-bi 115  df-3or 925  df-3an 926  df-tru 1292  df-fal 1295  df-nf 1395  df-sb 1693  df-eu 1951  df-mo 1952  df-clab 2075  df-cleq 2081  df-clel 2084  df-nfc 2217  df-ne 2256  df-nel 2351  df-ral 2364  df-rex 2365  df-reu 2366  df-rmo 2367  df-rab 2368  df-v 2621  df-sbc 2841  df-csb 2934  df-dif 3001  df-un 3003  df-in 3005  df-ss 3012  df-pw 3431  df-sn 3452  df-pr 3453  df-op 3455  df-uni 3654  df-int 3689  df-iun 3732  df-br 3846  df-opab 3900  df-mpt 3901  df-id 4120  df-po 4123  df-iso 4124  df-xp 4444  df-rel 4445  df-cnv 4446  df-co 4447  df-dm 4448  df-rn 4449  df-res 4450  df-ima 4451  df-iota 4980  df-fun 5017  df-fn 5018  df-f 5019  df-fv 5023  df-riota 5608  df-ov 5655  df-oprab 5656  df-mpt2 5657  df-1st 5911  df-2nd 5912  df-pnf 7522  df-mnf 7523  df-xr 7524  df-ltxr 7525  df-le 7526  df-sub 7653  df-neg 7654  df-reap 8050  df-ap 8057  df-div 8138  df-inn 8421  df-n0 8672  df-z 8749  df-q 9103  df-rp 9133  df-ico 9310  df-fl 9673  df-mod 9726
This theorem is referenced by:  modqmuladdim  9770
  Copyright terms: Public domain W3C validator