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

Theorem quoremz 11228
Description: Quotient and remainder of an integer divided by a natural number. 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 10278 . . . . . 6  |-  ( A  e.  ZZ  ->  A  e.  RR )
32adantr 452 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  e.  RR )
4 nnre 9999 . . . . . 6  |-  ( B  e.  NN  ->  B  e.  RR )
54adantl 453 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  e.  RR )
6 nnne0 10024 . . . . . 6  |-  ( B  e.  NN  ->  B  =/=  0 )
76adantl 453 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  =/=  0 )
83, 5, 7redivcld 9834 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( A  /  B
)  e.  RR )
98flcld 11199 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( |_ `  ( A  /  B ) )  e.  ZZ )
101, 9syl5eqel 2519 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  Q  e.  ZZ )
11 quorem.2 . . 3  |-  R  =  ( A  -  ( B  x.  Q )
)
1210zcnd 10368 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  Q  e.  CC )
13 nncn 10000 . . . . . . . 8  |-  ( B  e.  NN  ->  B  e.  CC )
1413adantl 453 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  e.  CC )
1512, 14, 7divcan3d 9787 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  /  B
)  =  Q )
16 flle 11200 . . . . . . . 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 4237 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  Q  <_  ( A  /  B ) )
1915, 18eqbrtrd 4224 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  /  B
)  <_  ( A  /  B ) )
20 nnz 10295 . . . . . . . . 9  |-  ( B  e.  NN  ->  B  e.  ZZ )
2120adantl 453 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  B  e.  ZZ )
2221, 10zmulcld 10373 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  e.  ZZ )
2322zred 10367 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  e.  RR )
24 nngt0 10021 . . . . . . 7  |-  ( B  e.  NN  ->  0  <  B )
2524adantl 453 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  0  <  B )
26 lediv1 9867 . . . . . 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 1188 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  <_  A  <->  ( ( B  x.  Q
)  /  B )  <_  ( A  /  B ) ) )
2819, 27mpbird 224 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  <_  A )
29 simpl 444 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  e.  ZZ )
30 znn0sub 10315 . . . . 5  |-  ( ( ( B  x.  Q
)  e.  ZZ  /\  A  e.  ZZ )  ->  ( ( B  x.  Q )  <_  A  <->  ( A  -  ( B  x.  Q ) )  e.  NN0 ) )
3122, 29, 30syl2anc 643 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  <_  A  <->  ( A  -  ( B  x.  Q ) )  e.  NN0 ) )
3228, 31mpbid 202 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( A  -  ( B  x.  Q )
)  e.  NN0 )
3311, 32syl5eqel 2519 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  R  e.  NN0 )
341oveq2i 6084 . . . . . 6  |-  ( ( A  /  B )  -  Q )  =  ( ( A  /  B )  -  ( |_ `  ( A  /  B ) ) )
35 fraclt1 11203 . . . . . . 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 4237 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  /  B )  -  Q
)  <  1 )
3811oveq1i 6083 . . . . . 6  |-  ( R  /  B )  =  ( ( A  -  ( B  x.  Q
) )  /  B
)
39 zcn 10279 . . . . . . . . 9  |-  ( A  e.  ZZ  ->  A  e.  CC )
4039adantr 452 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  e.  CC )
4122zcnd 10368 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  x.  Q
)  e.  CC )
4213, 6jca 519 . . . . . . . . 9  |-  ( B  e.  NN  ->  ( B  e.  CC  /\  B  =/=  0 ) )
4342adantl 453 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  e.  CC  /\  B  =/=  0 ) )
44 divsubdir 9702 . . . . . . . 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 1184 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  -  ( B  x.  Q
) )  /  B
)  =  ( ( A  /  B )  -  ( ( B  x.  Q )  /  B ) ) )
4615oveq2d 6089 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  /  B )  -  (
( B  x.  Q
)  /  B ) )  =  ( ( A  /  B )  -  Q ) )
4745, 46eqtrd 2467 . . . . . 6  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( A  -  ( B  x.  Q
) )  /  B
)  =  ( ( A  /  B )  -  Q ) )
4838, 47syl5eq 2479 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  /  B
)  =  ( ( A  /  B )  -  Q ) )
4913, 6dividd 9780 . . . . . 6  |-  ( B  e.  NN  ->  ( B  /  B )  =  1 )
5049adantl 453 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( B  /  B
)  =  1 )
5137, 48, 503brtr4d 4234 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  /  B
)  <  ( B  /  B ) )
5233nn0red 10267 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  R  e.  RR )
53 ltdiv1 9866 . . . . 5  |-  ( ( R  e.  RR  /\  B  e.  RR  /\  ( B  e.  RR  /\  0  <  B ) )  -> 
( R  <  B  <->  ( R  /  B )  <  ( B  /  B ) ) )
5452, 5, 5, 25, 53syl112anc 1188 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  <  B  <->  ( R  /  B )  <  ( B  /  B ) ) )
5551, 54mpbird 224 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  R  <  B )
5611oveq2i 6084 . . . 4  |-  ( ( B  x.  Q )  +  R )  =  ( ( B  x.  Q )  +  ( A  -  ( B  x.  Q ) ) )
5741, 40pncan3d 9406 . . . 4  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( B  x.  Q )  +  ( A  -  ( B  x.  Q ) ) )  =  A )
5856, 57syl5req 2480 . . 3  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  A  =  ( ( B  x.  Q )  +  R ) )
5955, 58jca 519 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( R  <  B  /\  A  =  (
( B  x.  Q
)  +  R ) ) )
6010, 33, 59jca31 521 1  |-  ( ( A  e.  ZZ  /\  B  e.  NN )  ->  ( ( Q  e.  ZZ  /\  R  e. 
NN0 )  /\  ( R  <  B  /\  A  =  ( ( B  x.  Q )  +  R ) ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 177    /\ wa 359    = wceq 1652    e. wcel 1725    =/= wne 2598   class class class wbr 4204   ` cfv 5446  (class class class)co 6073   CCcc 8980   RRcr 8981   0cc0 8982   1c1 8983    + caddc 8985    x. cmul 8987    < clt 9112    <_ cle 9113    - cmin 9283    / cdiv 9669   NNcn 9992   NN0cn0 10213   ZZcz 10274   |_cfl 11193
This theorem is referenced by:  quoremnn0  11229
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2416  ax-sep 4322  ax-nul 4330  ax-pow 4369  ax-pr 4395  ax-un 4693  ax-cnex 9038  ax-resscn 9039  ax-1cn 9040  ax-icn 9041  ax-addcl 9042  ax-addrcl 9043  ax-mulcl 9044  ax-mulrcl 9045  ax-mulcom 9046  ax-addass 9047  ax-mulass 9048  ax-distr 9049  ax-i2m1 9050  ax-1ne0 9051  ax-1rid 9052  ax-rnegex 9053  ax-rrecex 9054  ax-cnre 9055  ax-pre-lttri 9056  ax-pre-lttrn 9057  ax-pre-ltadd 9058  ax-pre-mulgt0 9059  ax-pre-sup 9060
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1328  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2284  df-mo 2285  df-clab 2422  df-cleq 2428  df-clel 2431  df-nfc 2560  df-ne 2600  df-nel 2601  df-ral 2702  df-rex 2703  df-reu 2704  df-rmo 2705  df-rab 2706  df-v 2950  df-sbc 3154  df-csb 3244  df-dif 3315  df-un 3317  df-in 3319  df-ss 3326  df-pss 3328  df-nul 3621  df-if 3732  df-pw 3793  df-sn 3812  df-pr 3813  df-tp 3814  df-op 3815  df-uni 4008  df-iun 4087  df-br 4205  df-opab 4259  df-mpt 4260  df-tr 4295  df-eprel 4486  df-id 4490  df-po 4495  df-so 4496  df-fr 4533  df-we 4535  df-ord 4576  df-on 4577  df-lim 4578  df-suc 4579  df-om 4838  df-xp 4876  df-rel 4877  df-cnv 4878  df-co 4879  df-dm 4880  df-rn 4881  df-res 4882  df-ima 4883  df-iota 5410  df-fun 5448  df-fn 5449  df-f 5450  df-f1 5451  df-fo 5452  df-f1o 5453  df-fv 5454  df-ov 6076  df-oprab 6077  df-mpt2 6078  df-riota 6541  df-recs 6625  df-rdg 6660  df-er 6897  df-en 7102  df-dom 7103  df-sdom 7104  df-sup 7438  df-pnf 9114  df-mnf 9115  df-xr 9116  df-ltxr 9117  df-le 9118  df-sub 9285  df-neg 9286  df-div 9670  df-nn 9993  df-n0 10214  df-z 10275  df-uz 10481  df-fl 11194
  Copyright terms: Public domain W3C validator