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

Theorem modqmuladd 10163
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 9440 . . . . . . 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 8293 . . . . . 6  |-  ( ph  ->  M  =/=  0 )
7 qdivcl 9457 . . . . . 6  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  M  =/=  0 )  ->  ( A  /  M )  e.  QQ )
83, 4, 6, 7syl3anc 1216 . . . . 5  |-  ( ph  ->  ( A  /  M
)  e.  QQ )
98flqcld 10074 . . . 4  |-  ( ph  ->  ( |_ `  ( A  /  M ) )  e.  ZZ )
10 oveq1 5784 . . . . . . 7  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  (
k  x.  M )  =  ( ( |_
`  ( A  /  M ) )  x.  M ) )
1110oveq1d 5792 . . . . . 6  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  (
( k  x.  M
)  +  ( A  mod  M ) )  =  ( ( ( |_ `  ( A  /  M ) )  x.  M )  +  ( A  mod  M
) ) )
1211eqeq2d 2151 . . . . 5  |-  ( k  =  ( |_ `  ( A  /  M
) )  ->  ( A  =  ( (
k  x.  M )  +  ( A  mod  M ) )  <->  A  =  ( ( ( |_
`  ( A  /  M ) )  x.  M )  +  ( A  mod  M ) ) ) )
1312adantl 275 . . . 4  |-  ( (
ph  /\  k  =  ( |_ `  ( A  /  M ) ) )  ->  ( A  =  ( ( k  x.  M )  +  ( A  mod  M
) )  <->  A  =  ( ( ( |_
`  ( A  /  M ) )  x.  M )  +  ( A  mod  M ) ) ) )
14 flqpmodeq 10124 . . . . . 6  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( ( |_ `  ( A  /  M
) )  x.  M
)  +  ( A  mod  M ) )  =  A )
153, 4, 5, 14syl3anc 1216 . . . . 5  |-  ( ph  ->  ( ( ( |_
`  ( A  /  M ) )  x.  M )  +  ( A  mod  M ) )  =  A )
1615eqcomd 2145 . . . 4  |-  ( ph  ->  A  =  ( ( ( |_ `  ( A  /  M ) )  x.  M )  +  ( A  mod  M
) ) )
179, 13, 16rspcedvd 2795 . . 3  |-  ( ph  ->  E. k  e.  ZZ  A  =  ( (
k  x.  M )  +  ( A  mod  M ) ) )
18 oveq2 5785 . . . . . 6  |-  ( B  =  ( A  mod  M )  ->  ( (
k  x.  M )  +  B )  =  ( ( k  x.  M )  +  ( A  mod  M ) ) )
1918eqeq2d 2151 . . . . 5  |-  ( B  =  ( A  mod  M )  ->  ( A  =  ( ( k  x.  M )  +  B )  <->  A  =  ( ( k  x.  M )  +  ( A  mod  M ) ) ) )
2019eqcoms 2142 . . . 4  |-  ( ( A  mod  M )  =  B  ->  ( A  =  ( (
k  x.  M )  +  B )  <->  A  =  ( ( k  x.  M )  +  ( A  mod  M ) ) ) )
2120rexbidv 2438 . . 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 156 . 2  |-  ( ph  ->  ( ( A  mod  M )  =  B  ->  E. k  e.  ZZ  A  =  ( (
k  x.  M )  +  B ) ) )
23 oveq1 5784 . . . . . 6  |-  ( A  =  ( ( k  x.  M )  +  B )  ->  ( A  mod  M )  =  ( ( ( k  x.  M )  +  B )  mod  M
) )
2423adantl 275 . . . . 5  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
( A  mod  M
)  =  ( ( ( k  x.  M
)  +  B )  mod  M ) )
25 simplr 519 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
k  e.  ZZ )
264ad2antrr 479 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  ->  M  e.  QQ )
27 modqmuladd.bq . . . . . . 7  |-  ( ph  ->  B  e.  QQ )
2827ad2antrr 479 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  ->  B  e.  QQ )
29 modqmuladd.b . . . . . . 7  |-  ( ph  ->  B  e.  ( 0 [,) M ) )
3029ad2antrr 479 . . . . . 6  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  ->  B  e.  ( 0 [,) M ) )
31 mulqaddmodid 10161 . . . . . 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 1217 . . . . 5  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
( ( ( k  x.  M )  +  B )  mod  M
)  =  B )
3324, 32eqtrd 2172 . . . 4  |-  ( ( ( ph  /\  k  e.  ZZ )  /\  A  =  ( ( k  x.  M )  +  B ) )  -> 
( A  mod  M
)  =  B )
3433ex 114 . . 3  |-  ( (
ph  /\  k  e.  ZZ )  ->  ( A  =  ( ( k  x.  M )  +  B )  ->  ( A  mod  M )  =  B ) )
3534rexlimdva 2549 . 2  |-  ( ph  ->  ( E. k  e.  ZZ  A  =  ( ( k  x.  M
)  +  B )  ->  ( A  mod  M )  =  B ) )
3622, 35impbid 128 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 103    <-> wb 104    = wceq 1331    e. wcel 1480    =/= wne 2308   E.wrex 2417   class class class wbr 3932   ` cfv 5126  (class class class)co 5777   0cc0 7639    + caddc 7642    x. cmul 7644    < clt 7819    / cdiv 8451   ZZcz 9073   QQcq 9433   [,)cico 9696   |_cfl 10065    mod cmo 10119
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 603  ax-in2 604  ax-io 698  ax-5 1423  ax-7 1424  ax-gen 1425  ax-ie1 1469  ax-ie2 1470  ax-8 1482  ax-10 1483  ax-11 1484  ax-i12 1485  ax-bndl 1486  ax-4 1487  ax-13 1491  ax-14 1492  ax-17 1506  ax-i9 1510  ax-ial 1514  ax-i5r 1515  ax-ext 2121  ax-sep 4049  ax-pow 4101  ax-pr 4134  ax-un 4358  ax-setind 4455  ax-cnex 7730  ax-resscn 7731  ax-1cn 7732  ax-1re 7733  ax-icn 7734  ax-addcl 7735  ax-addrcl 7736  ax-mulcl 7737  ax-mulrcl 7738  ax-addcom 7739  ax-mulcom 7740  ax-addass 7741  ax-mulass 7742  ax-distr 7743  ax-i2m1 7744  ax-0lt1 7745  ax-1rid 7746  ax-0id 7747  ax-rnegex 7748  ax-precex 7749  ax-cnre 7750  ax-pre-ltirr 7751  ax-pre-ltwlin 7752  ax-pre-lttrn 7753  ax-pre-apti 7754  ax-pre-ltadd 7755  ax-pre-mulgt0 7756  ax-pre-mulext 7757  ax-arch 7758
This theorem depends on definitions:  df-bi 116  df-3or 963  df-3an 964  df-tru 1334  df-fal 1337  df-nf 1437  df-sb 1736  df-eu 2002  df-mo 2003  df-clab 2126  df-cleq 2132  df-clel 2135  df-nfc 2270  df-ne 2309  df-nel 2404  df-ral 2421  df-rex 2422  df-reu 2423  df-rmo 2424  df-rab 2425  df-v 2688  df-sbc 2910  df-csb 3004  df-dif 3073  df-un 3075  df-in 3077  df-ss 3084  df-pw 3512  df-sn 3533  df-pr 3534  df-op 3536  df-uni 3740  df-int 3775  df-iun 3818  df-br 3933  df-opab 3993  df-mpt 3994  df-id 4218  df-po 4221  df-iso 4222  df-xp 4548  df-rel 4549  df-cnv 4550  df-co 4551  df-dm 4552  df-rn 4553  df-res 4554  df-ima 4555  df-iota 5091  df-fun 5128  df-fn 5129  df-f 5130  df-fv 5134  df-riota 5733  df-ov 5780  df-oprab 5781  df-mpo 5782  df-1st 6041  df-2nd 6042  df-pnf 7821  df-mnf 7822  df-xr 7823  df-ltxr 7824  df-le 7825  df-sub 7954  df-neg 7955  df-reap 8356  df-ap 8363  df-div 8452  df-inn 8740  df-n0 8997  df-z 9074  df-q 9434  df-rp 9464  df-ico 9700  df-fl 10067  df-mod 10120
This theorem is referenced by:  modqmuladdim  10164
  Copyright terms: Public domain W3C validator