Metamath Proof Explorer


Theorem divalg2

Description: The division algorithm (theorem) for a positive divisor. (Contributed by Paul Chapman, 21-Mar-2011)

Ref Expression
Assertion divalg2 N D ∃! r 0 r < D D N r

Proof

Step Hyp Ref Expression
1 nnz D D
2 nnne0 D D 0
3 1 2 jca D D D 0
4 divalg N D D 0 ∃! r q 0 r r < D N = q D + r
5 divalgb N D D 0 ∃! r q 0 r r < D N = q D + r ∃! r 0 r < D D N r
6 4 5 mpbid N D D 0 ∃! r 0 r < D D N r
7 6 3expb N D D 0 ∃! r 0 r < D D N r
8 3 7 sylan2 N D ∃! r 0 r < D D N r
9 nnre D D
10 nnnn0 D D 0
11 10 nn0ge0d D 0 D
12 9 11 absidd D D = D
13 12 breq2d D r < D r < D
14 13 anbi1d D r < D D N r r < D D N r
15 14 reubidv D ∃! r 0 r < D D N r ∃! r 0 r < D D N r
16 15 adantl N D ∃! r 0 r < D D N r ∃! r 0 r < D D N r
17 8 16 mpbid N D ∃! r 0 r < D D N r