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

Theorem quoremz 11951
Description: Quotient and remainder of an integer divided by a positive integer. TO DO - is this really needed for anything? Should we use  mod to simplify it? (Contributed by NM, 14-Aug-2008.)
Hypotheses
Ref Expression
quorem.1  |-  Q  =  ( |_ `  ( A  /  B ) )
quorem.2  |-  R  =  ( A  -  ( B  x.  Q )
)
Assertion
Ref Expression
quoremz  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( Q  e.  ZZ  /\  R  e. 
NN0 )  /\  ( R  <  B  /\  A  =  ( ( B  x.  Q )  +  R ) ) ) )

Proof of Theorem quoremz
StepHypRef Expression
1 quorem.1 . . 3  |-  Q  =  ( |_ `  ( A  /  B ) )
2 zre 10869 . . . . . 6  |-  ( A  e.  ZZ  ->  A  e.  RR )
32adantr 465 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  e.  RR )
4 nnre 10544 . . . . . 6  |-  ( B  e.  NN  ->  B  e.  RR )
54adantl 466 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  e.  RR )
6 nnne0 10569 . . . . . 6  |-  ( B  e.  NN  ->  B  =/=  0 )
76adantl 466 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  =/=  0 )
83, 5, 7redivcld 10373 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( A  /  B
)  e.  RR )
98flcld 11904 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( |_ `  ( A  /  B ) )  e.  ZZ )
101, 9syl5eqel 2559 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  Q  e.  ZZ )
11 quorem.2 . . 3  |-  R  =  ( A  -  ( B  x.  Q )
)
1210zcnd 10968 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  Q  e.  CC )
13 nncn 10545 . . . . . . . 8  |-  ( B  e.  NN  ->  B  e.  CC )
1413adantl 466 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  e.  CC )
1512, 14, 7divcan3d 10326 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  /  B
)  =  Q )
16 flle 11905 . . . . . . . 8  |-  ( ( A  /  B )  e.  RR  ->  ( |_ `  ( A  /  B ) )  <_ 
( A  /  B
) )
178, 16syl 16 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( |_ `  ( A  /  B ) )  <_  ( A  /  B ) )
181, 17syl5eqbr 4480 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  Q  <_  ( A  /  B ) )
1915, 18eqbrtrd 4467 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  /  B
)  <_  ( A  /  B ) )
20 nnz 10887 . . . . . . . . 9  |-  ( B  e.  NN  ->  B  e.  ZZ )
2120adantl 466 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  e.  ZZ )
2221, 10zmulcld 10973 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  e.  ZZ )
2322zred 10967 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  e.  RR )
24 nngt0 10566 . . . . . . 7  |-  ( B  e.  NN  ->  0  <  B )
2524adantl 466 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  0  <  B )
26 lediv1 10408 . . . . . 6  |-  ( ( ( B  x.  Q
)  e.  RR  /\  A  e.  RR  /\  ( B  e.  RR  /\  0  <  B ) )  -> 
( ( B  x.  Q )  <_  A  <->  ( ( B  x.  Q
)  /  B )  <_  ( A  /  B ) ) )
2723, 3, 5, 25, 26syl112anc 1232 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  <_  A  <->  ( ( B  x.  Q
)  /  B )  <_  ( A  /  B ) ) )
2819, 27mpbird 232 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  <_  A )
29 simpl 457 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  e.  ZZ )
30 znn0sub 10911 . . . . 5  |-  ( ( ( B  x.  Q
)  e.  ZZ  /\  A  e.  ZZ )  ->  ( ( B  x.  Q )  <_  A  <->  ( A  -  ( B  x.  Q ) )  e.  NN0 ) )
3122, 29, 30syl2anc 661 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  <_  A  <->  ( A  -  ( B  x.  Q ) )  e.  NN0 ) )
3228, 31mpbid 210 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( A  -  ( B  x.  Q )
)  e.  NN0 )
3311, 32syl5eqel 2559 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  R  e.  NN0 )
341oveq2i 6296 . . . . . 6  |-  ( ( A  /  B )  -  Q )  =  ( ( A  /  B )  -  ( |_ `  ( A  /  B ) ) )
35 fraclt1 11908 . . . . . . 7  |-  ( ( A  /  B )  e.  RR  ->  (
( A  /  B
)  -  ( |_
`  ( A  /  B ) ) )  <  1 )
368, 35syl 16 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  /  B )  -  ( |_ `  ( A  /  B ) ) )  <  1 )
3734, 36syl5eqbr 4480 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  /  B )  -  Q
)  <  1 )
3811oveq1i 6295 . . . . . 6  |-  ( R  /  B )  =  ( ( A  -  ( B  x.  Q
) )  /  B
)
39 zcn 10870 . . . . . . . . 9  |-  ( A  e.  ZZ  ->  A  e.  CC )
4039adantr 465 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  e.  CC )
4122zcnd 10968 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  e.  CC )
4213, 6jca 532 . . . . . . . . 9  |-  ( B  e.  NN  ->  ( B  e.  CC  /\  B  =/=  0 ) )
4342adantl 466 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  e.  CC  /\  B  =/=  0 ) )
44 divsubdir 10241 . . . . . . . 8  |-  ( ( A  e.  CC  /\  ( B  x.  Q
)  e.  CC  /\  ( B  e.  CC  /\  B  =/=  0 ) )  ->  ( ( A  -  ( B  x.  Q ) )  /  B )  =  ( ( A  /  B
)  -  ( ( B  x.  Q )  /  B ) ) )
4540, 41, 43, 44syl3anc 1228 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  -  ( B  x.  Q
) )  /  B
)  =  ( ( A  /  B )  -  ( ( B  x.  Q )  /  B ) ) )
4615oveq2d 6301 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  /  B )  -  (
( B  x.  Q
)  /  B ) )  =  ( ( A  /  B )  -  Q ) )
4745, 46eqtrd 2508 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  -  ( B  x.  Q
) )  /  B
)  =  ( ( A  /  B )  -  Q ) )
4838, 47syl5eq 2520 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  /  B
)  =  ( ( A  /  B )  -  Q ) )
4913, 6dividd 10319 . . . . . 6  |-  ( B  e.  NN  ->  ( B  /  B )  =  1 )
5049adantl 466 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  /  B
)  =  1 )
5137, 48, 503brtr4d 4477 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  /  B
)  <  ( B  /  B ) )
5233nn0red 10854 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  R  e.  RR )
53 ltdiv1 10407 . . . . 5  |-  ( ( R  e.  RR  /\  B  e.  RR  /\  ( B  e.  RR  /\  0  <  B ) )  -> 
( R  <  B  <->  ( R  /  B )  <  ( B  /  B ) ) )
5452, 5, 5, 25, 53syl112anc 1232 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  <  B  <->  ( R  /  B )  <  ( B  /  B ) ) )
5551, 54mpbird 232 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  R  <  B )
5611oveq2i 6296 . . . 4  |-  ( ( B  x.  Q )  +  R )  =  ( ( B  x.  Q )  +  ( A  -  ( B  x.  Q ) ) )
5741, 40pncan3d 9934 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  +  ( A  -  ( B  x.  Q ) ) )  =  A )
5856, 57syl5req 2521 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  =  ( ( B  x.  Q )  +  R ) )
5955, 58jca 532 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  <  B  /\  A  =  (
( B  x.  Q
)  +  R ) ) )
6010, 33, 59jca31 534 1  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( Q  e.  ZZ  /\  R  e. 
NN0 )  /\  ( R  <  B  /\  A  =  ( ( B  x.  Q )  +  R ) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 369    = wceq 1379    e. wcel 1767    =/= wne 2662   class class class wbr 4447   ` cfv 5588  (class class class)co 6285   CCcc 9491   RRcr 9492   0cc0 9493   1c1 9494    + caddc 9496    x. cmul 9498    < clt 9629    <_ cle 9630    - cmin 9806    / cdiv 10207   NNcn 10537   NN0cn0 10796   ZZcz 10865   |_cfl 11896
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1601  ax-4 1612  ax-5 1680  ax-6 1719  ax-7 1739  ax-8 1769  ax-9 1771  ax-10 1786  ax-11 1791  ax-12 1803  ax-13 1968  ax-ext 2445  ax-sep 4568  ax-nul 4576  ax-pow 4625  ax-pr 4686  ax-un 6577  ax-cnex 9549  ax-resscn 9550  ax-1cn 9551  ax-icn 9552  ax-addcl 9553  ax-addrcl 9554  ax-mulcl 9555  ax-mulrcl 9556  ax-mulcom 9557  ax-addass 9558  ax-mulass 9559  ax-distr 9560  ax-i2m1 9561  ax-1ne0 9562  ax-1rid 9563  ax-rnegex 9564  ax-rrecex 9565  ax-cnre 9566  ax-pre-lttri 9567  ax-pre-lttrn 9568  ax-pre-ltadd 9569  ax-pre-mulgt0 9570  ax-pre-sup 9571
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1382  df-ex 1597  df-nf 1600  df-sb 1712  df-eu 2279  df-mo 2280  df-clab 2453  df-cleq 2459  df-clel 2462  df-nfc 2617  df-ne 2664  df-nel 2665  df-ral 2819  df-rex 2820  df-reu 2821  df-rmo 2822  df-rab 2823  df-v 3115  df-sbc 3332  df-csb 3436  df-dif 3479  df-un 3481  df-in 3483  df-ss 3490  df-pss 3492  df-nul 3786  df-if 3940  df-pw 4012  df-sn 4028  df-pr 4030  df-tp 4032  df-op 4034  df-uni 4246  df-iun 4327  df-br 4448  df-opab 4506  df-mpt 4507  df-tr 4541  df-eprel 4791  df-id 4795  df-po 4800  df-so 4801  df-fr 4838  df-we 4840  df-ord 4881  df-on 4882  df-lim 4883  df-suc 4884  df-xp 5005  df-rel 5006  df-cnv 5007  df-co 5008  df-dm 5009  df-rn 5010  df-res 5011  df-ima 5012  df-iota 5551  df-fun 5590  df-fn 5591  df-f 5592  df-f1 5593  df-fo 5594  df-f1o 5595  df-fv 5596  df-riota 6246  df-ov 6288  df-oprab 6289  df-mpt2 6290  df-om 6686  df-recs 7043  df-rdg 7077  df-er 7312  df-en 7518  df-dom 7519  df-sdom 7520  df-sup 7902  df-pnf 9631  df-mnf 9632  df-xr 9633  df-ltxr 9634  df-le 9635  df-sub 9808  df-neg 9809  df-div 10208  df-nn 10538  df-n0 10797  df-z 10866  df-uz 11084  df-fl 11898
This theorem is referenced by:  quoremnn0  11952
  Copyright terms: Public domain W3C validator