Metamath Proof Explorer


Theorem modge0

Description: The modulo operation is nonnegative. (Contributed by NM, 10-Nov-2008)

Ref Expression
Assertion modge0
|- ( ( A e. RR /\ B e. RR+ ) -> 0 <_ ( A mod B ) )

Proof

Step Hyp Ref Expression
1 fldivle
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( |_ ` ( A / B ) ) <_ ( A / B ) )
2 refldivcl
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( |_ ` ( A / B ) ) e. RR )
3 simpl
 |-  ( ( A e. RR /\ B e. RR+ ) -> A e. RR )
4 rpregt0
 |-  ( B e. RR+ -> ( B e. RR /\ 0 < B ) )
5 4 adantl
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( B e. RR /\ 0 < B ) )
6 lemuldiv2
 |-  ( ( ( |_ ` ( A / B ) ) e. RR /\ A e. RR /\ ( B e. RR /\ 0 < B ) ) -> ( ( B x. ( |_ ` ( A / B ) ) ) <_ A <-> ( |_ ` ( A / B ) ) <_ ( A / B ) ) )
7 2 3 5 6 syl3anc
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( ( B x. ( |_ ` ( A / B ) ) ) <_ A <-> ( |_ ` ( A / B ) ) <_ ( A / B ) ) )
8 1 7 mpbird
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( B x. ( |_ ` ( A / B ) ) ) <_ A )
9 rpre
 |-  ( B e. RR+ -> B e. RR )
10 9 adantl
 |-  ( ( A e. RR /\ B e. RR+ ) -> B e. RR )
11 10 2 remulcld
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( B x. ( |_ ` ( A / B ) ) ) e. RR )
12 subge0
 |-  ( ( A e. RR /\ ( B x. ( |_ ` ( A / B ) ) ) e. RR ) -> ( 0 <_ ( A - ( B x. ( |_ ` ( A / B ) ) ) ) <-> ( B x. ( |_ ` ( A / B ) ) ) <_ A ) )
13 11 12 syldan
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( 0 <_ ( A - ( B x. ( |_ ` ( A / B ) ) ) ) <-> ( B x. ( |_ ` ( A / B ) ) ) <_ A ) )
14 8 13 mpbird
 |-  ( ( A e. RR /\ B e. RR+ ) -> 0 <_ ( A - ( B x. ( |_ ` ( A / B ) ) ) ) )
15 modval
 |-  ( ( A e. RR /\ B e. RR+ ) -> ( A mod B ) = ( A - ( B x. ( |_ ` ( A / B ) ) ) ) )
16 14 15 breqtrrd
 |-  ( ( A e. RR /\ B e. RR+ ) -> 0 <_ ( A mod B ) )