HomeHome Metamath Proof Explorer < Previous   Next >
Related theorems
Unicode version

Theorem quoremz 7492
Description: Quotient and remainder of an integer divided by a natural number.
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 zre 7348 . . . . . 6 |- (A e. ZZ -> A e. RR)
21adantr 425 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> A e. RR)
3 nnre 7112 . . . . . 6 |- (B e. NN -> B e. RR)
43adantl 424 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> B e. RR)
5 nnne0 7132 . . . . . 6 |- (B e. NN -> B =/= 0)
65adantl 424 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> B =/= 0)
7 redivcl 6978 . . . . 5 |- ((A e. RR /\ B e. RR /\ B =/= 0) -> (A / B) e. RR)
82, 4, 6, 7syl111anc 1100 . . . 4 |- ((A e. ZZ /\ B e. NN) -> (A / B) e. RR)
9 flcl 7465 . . . 4 |- ((A / B) e. RR -> (|_` (A / B)) e. ZZ)
108, 9syl 12 . . 3 |- ((A e. ZZ /\ B e. NN) -> (|_` (A / B)) e. ZZ)
11 quorem.1 . . 3 |- Q = (|_` (A / B))
1210, 11syl5eqel 1975 . 2 |- ((A e. ZZ /\ B e. NN) -> Q e. ZZ)
13 nnz 7362 . . . . . 6 |- (B e. NN -> B e. ZZ)
1413adantl 424 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> B e. ZZ)
15 zmulcl 7389 . . . . 5 |- ((B e. ZZ /\ Q e. ZZ) -> (B x. Q) e. ZZ)
1614, 12, 15syl11anc 524 . . . 4 |- ((A e. ZZ /\ B e. NN) -> (B x. Q) e. ZZ)
17 simpl 346 . . . 4 |- ((A e. ZZ /\ B e. NN) -> A e. ZZ)
18 zcn 7349 . . . . . . . 8 |- (Q e. ZZ -> Q e. CC)
1912, 18syl 12 . . . . . . 7 |- ((A e. ZZ /\ B e. NN) -> Q e. CC)
20 nncn 7113 . . . . . . . 8 |- (B e. NN -> B e. CC)
2120adantl 424 . . . . . . 7 |- ((A e. ZZ /\ B e. NN) -> B e. CC)
22 divcan3 6938 . . . . . . 7 |- ((Q e. CC /\ B e. CC /\ B =/= 0) -> ((B x. Q) / B) = Q)
2319, 21, 6, 22syl111anc 1100 . . . . . 6 |- ((A e. ZZ /\ B e. NN) -> ((B x. Q) / B) = Q)
24 flle 7468 . . . . . . . 8 |- ((A / B) e. RR -> (|_` (A / B)) <_ (A / B))
258, 24syl 12 . . . . . . 7 |- ((A e. ZZ /\ B e. NN) -> (|_` (A / B)) <_ (A / B))
2625, 11syl5eqbr 3370 . . . . . 6 |- ((A e. ZZ /\ B e. NN) -> Q <_ (A / B))
2723, 26eqbrtrd 3357 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> ((B x. Q) / B) <_ (A / B))
28 zre 7348 . . . . . . 7 |- ((B x. Q) e. ZZ -> (B x. Q) e. RR)
2916, 28syl 12 . . . . . 6 |- ((A e. ZZ /\ B e. NN) -> (B x. Q) e. RR)
30 nngt0 7129 . . . . . . 7 |- (B e. NN -> 0 < B)
3130adantl 424 . . . . . 6 |- ((A e. ZZ /\ B e. NN) -> 0 < B)
32 lediv1 7033 . . . . . 6 |- (((B x. Q) e. RR /\ A e. RR /\ (B e. RR /\ 0 < B)) -> ((B x. Q) <_ A <-> ((B x. Q) / B) <_ (A / B)))
3329, 2, 4, 31, 32syl112anc 1104 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> ((B x. Q) <_ A <-> ((B x. Q) / B) <_ (A / B)))
3427, 33mpbird 213 . . . 4 |- ((A e. ZZ /\ B e. NN) -> (B x. Q) <_ A)
35 znn0sub2 7388 . . . 4 |- (((B x. Q) e. ZZ /\ A e. ZZ /\ (B x. Q) <_ A) -> (A - (B x. Q)) e. NN0)
3616, 17, 34, 35syl111anc 1100 . . 3 |- ((A e. ZZ /\ B e. NN) -> (A - (B x. Q)) e. NN0)
37 quorem.2 . . 3 |- R = (A - (B x. Q))
3836, 37syl5eqel 1975 . 2 |- ((A e. ZZ /\ B e. NN) -> R e. NN0)
39 fraclt1 7470 . . . . . . 7 |- ((A / B) e. RR -> ((A / B) - (|_` (A / B))) < 1)
408, 39syl 12 . . . . . 6 |- ((A e. ZZ /\ B e. NN) -> ((A / B) - (|_` (A / B))) < 1)
4111opreq2i 4893 . . . . . 6 |- ((A / B) - Q) = ((A / B) - (|_` (A / B)))
4240, 41syl5eqbr 3370 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> ((A / B) - Q) < 1)
43 zcn 7349 . . . . . . . . 9 |- (A e. ZZ -> A e. CC)
4443adantr 425 . . . . . . . 8 |- ((A e. ZZ /\ B e. NN) -> A e. CC)
45 zcn 7349 . . . . . . . . 9 |- ((B x. Q) e. ZZ -> (B x. Q) e. CC)
4616, 45syl 12 . . . . . . . 8 |- ((A e. ZZ /\ B e. NN) -> (B x. Q) e. CC)
4720, 5jca 310 . . . . . . . . 9 |- (B e. NN -> (B e. CC /\ B =/= 0))
4847adantl 424 . . . . . . . 8 |- ((A e. ZZ /\ B e. NN) -> (B e. CC /\ B =/= 0))
49 divsubdir 6951 . . . . . . . 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)))
5044, 46, 48, 49syl111anc 1100 . . . . . . 7 |- ((A e. ZZ /\ B e. NN) -> ((A - (B x. Q)) / B) = ((A / B) - ((B x. Q) / B)))
5123opreq2d 4898 . . . . . . 7 |- ((A e. ZZ /\ B e. NN) -> ((A / B) - ((B x. Q) / B)) = ((A / B) - Q))
5250, 51eqtrd 1925 . . . . . 6 |- ((A e. ZZ /\ B e. NN) -> ((A - (B x. Q)) / B) = ((A / B) - Q))
5337opreq1i 4892 . . . . . 6 |- (R / B) = ((A - (B x. Q)) / B)
5452, 53syl5eq 1940 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> (R / B) = ((A / B) - Q))
55 divid 6942 . . . . . . 7 |- ((B e. CC /\ B =/= 0) -> (B / B) = 1)
5620, 5, 55syl11anc 524 . . . . . 6 |- (B e. NN -> (B / B) = 1)
5756adantl 424 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> (B / B) = 1)
5842, 54, 573brtr4d 3367 . . . 4 |- ((A e. ZZ /\ B e. NN) -> (R / B) < (B / B))
59 nn0re 7317 . . . . . 6 |- (R e. NN0 -> R e. RR)
6038, 59syl 12 . . . . 5 |- ((A e. ZZ /\ B e. NN) -> R e. RR)
61 ltdiv1 7031 . . . . 5 |- ((R e. RR /\ B e. RR /\ (B e. RR /\ 0 < B)) -> (R < B <-> (R / B) < (B / B)))
6260, 4, 4, 31, 61syl112anc 1104 . . . 4 |- ((A e. ZZ /\ B e. NN) -> (R < B <-> (R / B) < (B / B)))
6358, 62mpbird 213 . . 3 |- ((A e. ZZ /\ B e. NN) -> R < B)
64 pncan3 6534 . . . . 5 |- (((B x. Q) e. CC /\ A e. CC) -> ((B x. Q) + (A - (B x. Q))) = A)
6546, 44, 64syl11anc 524 . . . 4 |- ((A e. ZZ /\ B e. NN) -> ((B x. Q) + (A - (B x. Q))) = A)
6637opreq2i 4893 . . . 4 |- ((B x. Q) + R) = ((B x. Q) + (A - (B x. Q)))
6765, 66syl5req 1941 . . 3 |- ((A e. ZZ /\ B e. NN) -> A = ((B x. Q) + R))
6863, 67jca 310 . 2 |- ((A e. ZZ /\ B e. NN) -> (R < B /\ A = ((B x. Q) + R)))
6912, 38, 68jca31 311 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 3   <-> wb 163   /\ wa 240   = wceq 1298   e. wcel 1300   =/= wne 2017   class class class wbr 3338  ` cfv 3998  (class class class)co 4884  CCcc 6384  RRcr 6385  0cc0 6386  1c1 6387   + caddc 6389   x. cmul 6391   - cmin 6445   / cdiv 6447   <_ cle 6448  NNcn 6449  NN0cn0 6450  ZZcz 6451   < clt 6653  |_cfl 7462
This theorem is referenced by:  quoremnn0ALT 7493
This theorem was proved from axioms:  ax-1 4  ax-2 5  ax-3 6  ax-mp 7  ax-7 1304  ax-gen 1305  ax-8 1306  ax-9 1307  ax-10 1308  ax-11 1309  ax-12 1310  ax-13 1311  ax-14 1312  ax-17 1317  ax-4 1319  ax-5o 1321  ax-6o 1324  ax-9o 1481  ax-10o 1500  ax-16 1580  ax-11o 1588  ax-ext 1865  ax-rep 3428  ax-sep 3438  ax-nul 3445  ax-pow 3481  ax-pr 3524  ax-un 3790  ax-inf2 5731
This theorem depends on definitions:  df-bi 164  df-or 241  df-an 242  df-3or 859  df-3an 860  df-ex 1327  df-sb 1536  df-eu 1775  df-mo 1776  df-clab 1872  df-cleq 1877  df-clel 1880  df-ne 2019  df-nel 2020  df-ral 2109  df-rex 2110  df-reu 2111  df-rab 2112  df-v 2294  df-sbc 2454  df-csb 2541  df-dif 2597  df-un 2600  df-in 2603  df-ss 2605  df-pss 2607  df-nul 2876  df-if 2983  df-pw 3035  df-sn 3049  df-pr 3050  df-tp 3052  df-op 3053  df-uni 3178  df-int 3215  df-iun 3257  df-br 3339  df-opab 3396  df-tr 3412  df-eprel 3583  df-id 3586  df-po 3591  df-so 3604  df-fr 3625  df-we 3644  df-ord 3660  df-on 3661  df-lim 3662  df-suc 3663  df-om 3950  df-xp 4000  df-rel 4001  df-cnv 4002  df-co 4003  df-dm 4004  df-rn 4005  df-res 4006  df-ima 4007  df-fun 4008  df-fn 4009  df-f 4010  df-f1 4011  df-fo 4012  df-f1o 4013  df-fv 4014  df-opr 4886  df-oprab 4887  df-mpt 5006  df-1st 5020  df-2nd 5021  df-iota 5089  df-rdg 5140  df-1o 5177  df-oadd 5179  df-omul 5180  df-er 5318  df-ec 5320  df-qs 5323  df-en 5427  df-dom 5428  df-sdom 5429  df-undef 5556  df-riota 5560  df-ni 6152  df-pli 6153  df-mi 6154  df-lti 6155  df-plpq 6187  df-mpq 6188  df-enq 6189  df-nq 6190  df-plq 6191  df-mq 6192  df-rq 6193  df-ltq 6194  df-1q 6195  df-np 6238  df-1p 6239  df-plp 6240  df-mp 6241  df-ltp 6242  df-plpr 6316  df-mpr 6317  df-enr 6318  df-nr 6319  df-plr 6320  df-mr 6321  df-ltr 6322  df-0r 6323  df-1r 6324  df-m1r 6325  df-c 6392  df-0 6393  df-1 6394  df-i 6395  df-r 6396  df-plus 6397  df-mul 6398  df-lt 6399  df-sub 6511  df-neg 6513  df-pnf 6654  df-mnf 6655  df-xr 6656  df-ltxr 6657  df-le 6658  df-div 6892  df-n 7108  df-n0 7309  df-z 7345  df-fl 7463
Copyright terms: Public domain