Metamath Proof Explorer


Theorem sgnsub

Description: Subtraction of a number of opposite sign. (Contributed by Thierry Arnoux, 2-Oct-2018)

Ref Expression
Assertion sgnsub A B A B < 0 sgn A B = sgn A

Proof

Step Hyp Ref Expression
1 simpll A B A B < 0 A
2 1 rexrd A B A B < 0 A *
3 eqeq2 sgn A = 0 sgn A B = sgn A sgn A B = 0
4 eqeq2 sgn A = 1 sgn A B = sgn A sgn A B = 1
5 eqeq2 sgn A = 1 sgn A B = sgn A sgn A B = 1
6 simpr A B A B < 0 A = 0 A = 0
7 1 recnd A B A B < 0 A
8 7 adantr A B A B < 0 A = 0 A
9 simplr A B A B < 0 B
10 9 recnd A B A B < 0 B
11 10 adantr A B A B < 0 A = 0 B
12 simplr A B A B < 0 A = 0 A B < 0
13 12 lt0ne0d A B A B < 0 A = 0 A B 0
14 8 11 13 mulne0bad A B A B < 0 A = 0 A 0
15 6 14 pm2.21ddne A B A B < 0 A = 0 sgn A B = 0
16 simplll A B A B < 0 0 < A A
17 simpllr A B A B < 0 0 < A B
18 16 17 resubcld A B A B < 0 0 < A A B
19 18 rexrd A B A B < 0 0 < A A B *
20 0red A B A B < 0 0 < A 0
21 simpr A B A B < 0 A B < 0
22 1 9 21 mul2lt0lgt0 A B A B < 0 0 < A B < 0
23 simpr A B A B < 0 0 < A 0 < A
24 17 20 16 22 23 lttrd A B A B < 0 0 < A B < A
25 simpr A B B
26 simpl A B A
27 25 26 posdifd A B B < A 0 < A B
28 27 biimpa A B B < A 0 < A B
29 16 17 24 28 syl21anc A B A B < 0 0 < A 0 < A B
30 sgnp A B * 0 < A B sgn A B = 1
31 19 29 30 syl2anc A B A B < 0 0 < A sgn A B = 1
32 simplll A B A B < 0 A < 0 A
33 simpllr A B A B < 0 A < 0 B
34 32 33 resubcld A B A B < 0 A < 0 A B
35 34 rexrd A B A B < 0 A < 0 A B *
36 0red A B A B < 0 A < 0 0
37 7 adantr A B A B < 0 A < 0 A
38 37 subid1d A B A B < 0 A < 0 A 0 = A
39 simpr A B A B < 0 A < 0 A < 0
40 1 9 21 mul2lt0llt0 A B A B < 0 A < 0 0 < B
41 32 36 33 39 40 lttrd A B A B < 0 A < 0 A < B
42 38 41 eqbrtrd A B A B < 0 A < 0 A 0 < B
43 32 36 33 42 ltsub23d A B A B < 0 A < 0 A B < 0
44 sgnn A B * A B < 0 sgn A B = 1
45 35 43 44 syl2anc A B A B < 0 A < 0 sgn A B = 1
46 2 3 4 5 15 31 45 sgn3da A B A B < 0 sgn A B = sgn A