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

Theorem modqmuladdnn0 9450
Description: Implication of a decomposition of a nonnegative integer into a multiple of a modulus and a remainder. (Contributed by Jim Kingdon, 23-Oct-2021.)
Assertion
Ref Expression
modqmuladdnn0  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  mod  M
)  =  B  ->  E. k  e.  NN0  A  =  ( ( k  x.  M )  +  B ) ) )
Distinct variable groups:    A, k    B, k    k, M

Proof of Theorem modqmuladdnn0
Dummy variable  i is distinct from all other variables.
StepHypRef Expression
1 simpr 108 . . . . . 6  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  i  e.  ZZ )
21adantr 270 . . . . 5  |-  ( ( ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  < 
M )  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  /\  A  =  ( ( i  x.  M )  +  B ) )  -> 
i  e.  ZZ )
3 nn0cn 8365 . . . . . . . . . . . 12  |-  ( A  e.  NN0  ->  A  e.  CC )
433ad2ant1 960 . . . . . . . . . . 11  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  A  e.  CC )
54ad2antrr 472 . . . . . . . . . 10  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  A  e.  CC )
6 nn0z 8452 . . . . . . . . . . . . . . . . 17  |-  ( A  e.  NN0  ->  A  e.  ZZ )
7 zq 8792 . . . . . . . . . . . . . . . . 17  |-  ( A  e.  ZZ  ->  A  e.  QQ )
86, 7syl 14 . . . . . . . . . . . . . . . 16  |-  ( A  e.  NN0  ->  A  e.  QQ )
983ad2ant1 960 . . . . . . . . . . . . . . 15  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  A  e.  QQ )
109adantr 270 . . . . . . . . . . . . . 14  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  ->  A  e.  QQ )
11 simpl2 943 . . . . . . . . . . . . . 14  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  ->  M  e.  QQ )
12 simpl3 944 . . . . . . . . . . . . . 14  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  -> 
0  <  M )
1310, 11, 12modqcld 9410 . . . . . . . . . . . . 13  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  -> 
( A  mod  M
)  e.  QQ )
14 qcn 8800 . . . . . . . . . . . . 13  |-  ( ( A  mod  M )  e.  QQ  ->  ( A  mod  M )  e.  CC )
1513, 14syl 14 . . . . . . . . . . . 12  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  -> 
( A  mod  M
)  e.  CC )
16 eleq1 2142 . . . . . . . . . . . . 13  |-  ( ( A  mod  M )  =  B  ->  (
( A  mod  M
)  e.  CC  <->  B  e.  CC ) )
1716adantl 271 . . . . . . . . . . . 12  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  -> 
( ( A  mod  M )  e.  CC  <->  B  e.  CC ) )
1815, 17mpbid 145 . . . . . . . . . . 11  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  ->  B  e.  CC )
1918adantr 270 . . . . . . . . . 10  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  B  e.  CC )
20 zcn 8437 . . . . . . . . . . . 12  |-  ( i  e.  ZZ  ->  i  e.  CC )
2120adantl 271 . . . . . . . . . . 11  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  i  e.  CC )
22 qcn 8800 . . . . . . . . . . . . 13  |-  ( M  e.  QQ  ->  M  e.  CC )
2311, 22syl 14 . . . . . . . . . . . 12  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  ->  M  e.  CC )
2423adantr 270 . . . . . . . . . . 11  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  M  e.  CC )
2521, 24mulcld 7201 . . . . . . . . . 10  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
i  x.  M )  e.  CC )
265, 19, 25subadd2d 7505 . . . . . . . . 9  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
( A  -  B
)  =  ( i  x.  M )  <->  ( (
i  x.  M )  +  B )  =  A ) )
27 eqcom 2084 . . . . . . . . 9  |-  ( A  =  ( ( i  x.  M )  +  B )  <->  ( (
i  x.  M )  +  B )  =  A )
2826, 27syl6rbbr 197 . . . . . . . 8  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  ( A  =  ( (
i  x.  M )  +  B )  <->  ( A  -  B )  =  ( i  x.  M ) ) )
294adantr 270 . . . . . . . . . . 11  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  ->  A  e.  CC )
3029, 18subcld 7486 . . . . . . . . . 10  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  -> 
( A  -  B
)  e.  CC )
3130adantr 270 . . . . . . . . 9  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  ( A  -  B )  e.  CC )
32 qre 8791 . . . . . . . . . . . 12  |-  ( M  e.  QQ  ->  M  e.  RR )
33323ad2ant2 961 . . . . . . . . . . 11  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  M  e.  RR )
3433ad2antrr 472 . . . . . . . . . 10  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  M  e.  RR )
3512adantr 270 . . . . . . . . . 10  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  0  <  M )
3634, 35gt0ap0d 7795 . . . . . . . . 9  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  M #  0 )
3731, 21, 24, 36divmulap3d 7978 . . . . . . . 8  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
( ( A  -  B )  /  M
)  =  i  <->  ( A  -  B )  =  ( i  x.  M ) ) )
38 oveq2 5551 . . . . . . . . . . . . . 14  |-  ( B  =  ( A  mod  M )  ->  ( A  -  B )  =  ( A  -  ( A  mod  M ) ) )
3938oveq1d 5558 . . . . . . . . . . . . 13  |-  ( B  =  ( A  mod  M )  ->  ( ( A  -  B )  /  M )  =  ( ( A  -  ( A  mod  M ) )  /  M ) )
4039eqcoms 2085 . . . . . . . . . . . 12  |-  ( ( A  mod  M )  =  B  ->  (
( A  -  B
)  /  M )  =  ( ( A  -  ( A  mod  M ) )  /  M
) )
4140adantl 271 . . . . . . . . . . 11  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  -> 
( ( A  -  B )  /  M
)  =  ( ( A  -  ( A  mod  M ) )  /  M ) )
4241adantr 270 . . . . . . . . . 10  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
( A  -  B
)  /  M )  =  ( ( A  -  ( A  mod  M ) )  /  M
) )
43 modqdiffl 9417 . . . . . . . . . . . 12  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  -  ( A  mod  M ) )  /  M )  =  ( |_ `  ( A  /  M ) ) )
448, 43syl3an1 1203 . . . . . . . . . . 11  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  -  ( A  mod  M ) )  /  M )  =  ( |_ `  ( A  /  M ) ) )
4544ad2antrr 472 . . . . . . . . . 10  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
( A  -  ( A  mod  M ) )  /  M )  =  ( |_ `  ( A  /  M ) ) )
4642, 45eqtrd 2114 . . . . . . . . 9  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
( A  -  B
)  /  M )  =  ( |_ `  ( A  /  M
) ) )
4746eqeq1d 2090 . . . . . . . 8  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
( ( A  -  B )  /  M
)  =  i  <->  ( |_ `  ( A  /  M
) )  =  i ) )
4828, 37, 473bitr2d 214 . . . . . . 7  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  ( A  =  ( (
i  x.  M )  +  B )  <->  ( |_ `  ( A  /  M
) )  =  i ) )
49 qre 8791 . . . . . . . . . . . 12  |-  ( A  e.  QQ  ->  A  e.  RR )
509, 49syl 14 . . . . . . . . . . 11  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  A  e.  RR )
51 nn0ge0 8380 . . . . . . . . . . . 12  |-  ( A  e.  NN0  ->  0  <_  A )
52513ad2ant1 960 . . . . . . . . . . 11  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  0  <_  A )
53 simp3 941 . . . . . . . . . . 11  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  0  <  M )
54 divge0 8018 . . . . . . . . . . 11  |-  ( ( ( A  e.  RR  /\  0  <_  A )  /\  ( M  e.  RR  /\  0  <  M ) )  ->  0  <_  ( A  /  M ) )
5550, 52, 33, 53, 54syl22anc 1171 . . . . . . . . . 10  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  0  <_  ( A  /  M
) )
56 simp2 940 . . . . . . . . . . . 12  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  M  e.  QQ )
5753gt0ne0d 7680 . . . . . . . . . . . 12  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  M  =/=  0 )
58 qdivcl 8809 . . . . . . . . . . . 12  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  M  =/=  0 )  ->  ( A  /  M )  e.  QQ )
599, 56, 57, 58syl3anc 1170 . . . . . . . . . . 11  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  ( A  /  M )  e.  QQ )
60 0z 8443 . . . . . . . . . . 11  |-  0  e.  ZZ
61 flqge 9364 . . . . . . . . . . 11  |-  ( ( ( A  /  M
)  e.  QQ  /\  0  e.  ZZ )  ->  ( 0  <_  ( A  /  M )  <->  0  <_  ( |_ `  ( A  /  M ) ) ) )
6259, 60, 61sylancl 404 . . . . . . . . . 10  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  (
0  <_  ( A  /  M )  <->  0  <_  ( |_ `  ( A  /  M ) ) ) )
6355, 62mpbid 145 . . . . . . . . 9  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  0  <_  ( |_ `  ( A  /  M ) ) )
64 breq2 3797 . . . . . . . . 9  |-  ( ( |_ `  ( A  /  M ) )  =  i  ->  (
0  <_  ( |_ `  ( A  /  M
) )  <->  0  <_  i ) )
6563, 64syl5ibcom 153 . . . . . . . 8  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  (
( |_ `  ( A  /  M ) )  =  i  ->  0  <_  i ) )
6665ad2antrr 472 . . . . . . 7  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  (
( |_ `  ( A  /  M ) )  =  i  ->  0  <_  i ) )
6748, 66sylbid 148 . . . . . 6  |-  ( ( ( ( A  e. 
NN0  /\  M  e.  QQ  /\  0  <  M
)  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  ->  ( A  =  ( (
i  x.  M )  +  B )  -> 
0  <_  i )
)
6867imp 122 . . . . 5  |-  ( ( ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  < 
M )  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  /\  A  =  ( ( i  x.  M )  +  B ) )  -> 
0  <_  i )
69 elnn0z 8445 . . . . 5  |-  ( i  e.  NN0  <->  ( i  e.  ZZ  /\  0  <_ 
i ) )
702, 68, 69sylanbrc 408 . . . 4  |-  ( ( ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  < 
M )  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  /\  A  =  ( ( i  x.  M )  +  B ) )  -> 
i  e.  NN0 )
71 oveq1 5550 . . . . . . 7  |-  ( k  =  i  ->  (
k  x.  M )  =  ( i  x.  M ) )
7271oveq1d 5558 . . . . . 6  |-  ( k  =  i  ->  (
( k  x.  M
)  +  B )  =  ( ( i  x.  M )  +  B ) )
7372eqeq2d 2093 . . . . 5  |-  ( k  =  i  ->  ( A  =  ( (
k  x.  M )  +  B )  <->  A  =  ( ( i  x.  M )  +  B
) ) )
7473adantl 271 . . . 4  |-  ( ( ( ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  /\  A  =  ( ( i  x.  M )  +  B ) )  /\  k  =  i )  ->  ( A  =  ( ( k  x.  M
)  +  B )  <-> 
A  =  ( ( i  x.  M )  +  B ) ) )
75 simpr 108 . . . 4  |-  ( ( ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  < 
M )  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  /\  A  =  ( ( i  x.  M )  +  B ) )  ->  A  =  ( (
i  x.  M )  +  B ) )
7670, 74, 75rspcedvd 2709 . . 3  |-  ( ( ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  < 
M )  /\  ( A  mod  M )  =  B )  /\  i  e.  ZZ )  /\  A  =  ( ( i  x.  M )  +  B ) )  ->  E. k  e.  NN0  A  =  ( ( k  x.  M )  +  B ) )
77 modqmuladdim 9449 . . . . 5  |-  ( ( A  e.  ZZ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  mod  M
)  =  B  ->  E. i  e.  ZZ  A  =  ( (
i  x.  M )  +  B ) ) )
786, 77syl3an1 1203 . . . 4  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  mod  M
)  =  B  ->  E. i  e.  ZZ  A  =  ( (
i  x.  M )  +  B ) ) )
7978imp 122 . . 3  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  ->  E. i  e.  ZZ  A  =  ( (
i  x.  M )  +  B ) )
8076, 79r19.29a 2499 . 2  |-  ( ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  B )  ->  E. k  e.  NN0  A  =  ( ( k  x.  M )  +  B ) )
8180ex 113 1  |-  ( ( A  e.  NN0  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  mod  M
)  =  B  ->  E. k  e.  NN0  A  =  ( ( k  x.  M )  +  B ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 102    <-> wb 103    /\ w3a 920    = wceq 1285    e. wcel 1434    =/= wne 2246   E.wrex 2350   class class class wbr 3793   ` cfv 4932  (class class class)co 5543   CCcc 7041   RRcr 7042   0cc0 7043    + caddc 7046    x. cmul 7048    < clt 7215    <_ cle 7216    - cmin 7346    / cdiv 7827   NN0cn0 8355   ZZcz 8432   QQcq 8785   |_cfl 9350    mod cmo 9404
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 2064  ax-sep 3904  ax-pow 3956  ax-pr 3972  ax-un 4196  ax-setind 4288  ax-cnex 7129  ax-resscn 7130  ax-1cn 7131  ax-1re 7132  ax-icn 7133  ax-addcl 7134  ax-addrcl 7135  ax-mulcl 7136  ax-mulrcl 7137  ax-addcom 7138  ax-mulcom 7139  ax-addass 7140  ax-mulass 7141  ax-distr 7142  ax-i2m1 7143  ax-0lt1 7144  ax-1rid 7145  ax-0id 7146  ax-rnegex 7147  ax-precex 7148  ax-cnre 7149  ax-pre-ltirr 7150  ax-pre-ltwlin 7151  ax-pre-lttrn 7152  ax-pre-apti 7153  ax-pre-ltadd 7154  ax-pre-mulgt0 7155  ax-pre-mulext 7156  ax-arch 7157
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 1687  df-eu 1945  df-mo 1946  df-clab 2069  df-cleq 2075  df-clel 2078  df-nfc 2209  df-ne 2247  df-nel 2341  df-ral 2354  df-rex 2355  df-reu 2356  df-rmo 2357  df-rab 2358  df-v 2604  df-sbc 2817  df-csb 2910  df-dif 2976  df-un 2978  df-in 2980  df-ss 2987  df-pw 3392  df-sn 3412  df-pr 3413  df-op 3415  df-uni 3610  df-int 3645  df-iun 3688  df-br 3794  df-opab 3848  df-mpt 3849  df-id 4056  df-po 4059  df-iso 4060  df-xp 4377  df-rel 4378  df-cnv 4379  df-co 4380  df-dm 4381  df-rn 4382  df-res 4383  df-ima 4384  df-iota 4897  df-fun 4934  df-fn 4935  df-f 4936  df-fv 4940  df-riota 5499  df-ov 5546  df-oprab 5547  df-mpt2 5548  df-1st 5798  df-2nd 5799  df-pnf 7217  df-mnf 7218  df-xr 7219  df-ltxr 7220  df-le 7221  df-sub 7348  df-neg 7349  df-reap 7742  df-ap 7749  df-div 7828  df-inn 8107  df-n0 8356  df-z 8433  df-q 8786  df-rp 8816  df-ico 8993  df-fl 9352  df-mod 9405
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator