Metamath Proof Explorer


Theorem divalgb

Description: Express the division algorithm as stated in divalg in terms of || . (Contributed by Paul Chapman, 31-Mar-2011)

Ref Expression
Assertion divalgb N D D 0 ∃! r q 0 r r < D N = q D + r ∃! r 0 r < D D N r

Proof

Step Hyp Ref Expression
1 df-3an 0 r r < D N = q D + r 0 r r < D N = q D + r
2 1 rexbii q 0 r r < D N = q D + r q 0 r r < D N = q D + r
3 r19.42v q 0 r r < D N = q D + r 0 r r < D q N = q D + r
4 2 3 bitri q 0 r r < D N = q D + r 0 r r < D q N = q D + r
5 zsubcl N r N r
6 divides D N r D N r q q D = N r
7 5 6 sylan2 D N r D N r q q D = N r
8 7 3impb D N r D N r q q D = N r
9 8 3com12 N D r D N r q q D = N r
10 zcn N N
11 zcn r r
12 zmulcl q D q D
13 12 zcnd q D q D
14 subadd N r q D N r = q D r + q D = N
15 10 11 13 14 syl3an N r q D N r = q D r + q D = N
16 addcom r q D r + q D = q D + r
17 11 13 16 syl2an r q D r + q D = q D + r
18 17 3adant1 N r q D r + q D = q D + r
19 18 eqeq1d N r q D r + q D = N q D + r = N
20 15 19 bitrd N r q D N r = q D q D + r = N
21 eqcom N r = q D q D = N r
22 eqcom q D + r = N N = q D + r
23 20 21 22 3bitr3g N r q D q D = N r N = q D + r
24 23 3expia N r q D q D = N r N = q D + r
25 24 expcomd N r D q q D = N r N = q D + r
26 25 3impia N r D q q D = N r N = q D + r
27 26 imp N r D q q D = N r N = q D + r
28 27 rexbidva N r D q q D = N r q N = q D + r
29 28 3com23 N D r q q D = N r q N = q D + r
30 9 29 bitrd N D r D N r q N = q D + r
31 30 anbi2d N D r 0 r r < D D N r 0 r r < D q N = q D + r
32 4 31 bitr4id N D r q 0 r r < D N = q D + r 0 r r < D D N r
33 anass 0 r r < D D N r 0 r r < D D N r
34 32 33 bitrdi N D r q 0 r r < D N = q D + r 0 r r < D D N r
35 34 3expa N D r q 0 r r < D N = q D + r 0 r r < D D N r
36 35 reubidva N D ∃! r q 0 r r < D N = q D + r ∃! r 0 r r < D D N r
37 elnn0z r 0 r 0 r
38 37 anbi1i r 0 r < D D N r r 0 r r < D D N r
39 anass r 0 r r < D D N r r 0 r r < D D N r
40 38 39 bitri r 0 r < D D N r r 0 r r < D D N r
41 40 eubii ∃! r r 0 r < D D N r ∃! r r 0 r r < D D N r
42 df-reu ∃! r 0 r < D D N r ∃! r r 0 r < D D N r
43 df-reu ∃! r 0 r r < D D N r ∃! r r 0 r r < D D N r
44 41 42 43 3bitr4ri ∃! r 0 r r < D D N r ∃! r 0 r < D D N r
45 36 44 bitrdi N D ∃! r q 0 r r < D N = q D + r ∃! r 0 r < D D N r
46 45 3adant3 N D D 0 ∃! r q 0 r r < D N = q D + r ∃! r 0 r < D D N r