Metamath Proof Explorer


Theorem divnumden2

Description: Calculate the reduced form of a quotient using gcd . This version extends divnumden for the negative integers. (Contributed by Thierry Arnoux, 25-Oct-2017)

Ref Expression
Assertion divnumden2 A B B numer A B = A A gcd B denom A B = B A gcd B

Proof

Step Hyp Ref Expression
1 zssq
2 simp1 A B B A
3 1 2 sselid A B B A
4 simp2 A B B B
5 1 4 sselid A B B B
6 nnne0 B B 0
7 6 3ad2ant3 A B B B 0
8 neg0 0 = 0
9 8 neeq2i B 0 B 0
10 7 9 sylibr A B B B 0
11 10 neneqd A B B ¬ B = 0
12 4 zcnd A B B B
13 0cnd A B B 0
14 12 13 neg11ad A B B B = 0 B = 0
15 11 14 mtbid A B B ¬ B = 0
16 15 neqned A B B B 0
17 qdivcl A B B 0 A B
18 3 5 16 17 syl3anc A B B A B
19 qnumcl A B numer A B
20 18 19 syl A B B numer A B
21 20 zcnd A B B numer A B
22 simpl A B A
23 22 zcnd A B A
24 23 3adant2 A B B A
25 2 4 gcdcld A B B A gcd B 0
26 25 nn0cnd A B B A gcd B
27 26 negcld A B B A gcd B
28 15 intnand A B B ¬ A = 0 B = 0
29 gcdeq0 A B A gcd B = 0 A = 0 B = 0
30 29 necon3abid A B A gcd B 0 ¬ A = 0 B = 0
31 30 3adant3 A B B A gcd B 0 ¬ A = 0 B = 0
32 28 31 mpbird A B B A gcd B 0
33 26 32 negne0d A B B A gcd B 0
34 24 27 33 divcld A B B A A gcd B
35 24 12 16 divneg2d A B B A B = A B
36 35 fveq2d A B B numer A B = numer A B
37 numdenneg A B numer A B = numer A B denom A B = denom A B
38 37 simpld A B numer A B = numer A B
39 18 38 syl A B B numer A B = numer A B
40 gcdneg A B A gcd B = A gcd B
41 40 3adant3 A B B A gcd B = A gcd B
42 41 oveq2d A B B A A gcd B = A A gcd B
43 divnumden A B numer A B = A A gcd B denom A B = B A gcd B
44 43 simpld A B numer A B = A A gcd B
45 44 3adant2 A B B numer A B = A A gcd B
46 24 27 33 divnegd A B B A A gcd B = A A gcd B
47 24 26 32 div2negd A B B A A gcd B = A A gcd B
48 46 47 eqtrd A B B A A gcd B = A A gcd B
49 42 45 48 3eqtr4d A B B numer A B = A A gcd B
50 36 39 49 3eqtr3d A B B numer A B = A A gcd B
51 21 34 50 neg11d A B B numer A B = A A gcd B
52 24 26 32 divneg2d A B B A A gcd B = A A gcd B
53 51 52 eqtr4d A B B numer A B = A A gcd B
54 35 fveq2d A B B denom A B = denom A B
55 37 simprd A B denom A B = denom A B
56 18 55 syl A B B denom A B = denom A B
57 41 oveq2d A B B B A gcd B = B A gcd B
58 43 simprd A B denom A B = B A gcd B
59 58 3adant2 A B B denom A B = B A gcd B
60 12 26 32 divneg2d A B B B A gcd B = B A gcd B
61 12 26 32 divnegd A B B B A gcd B = B A gcd B
62 60 61 eqtr3d A B B B A gcd B = B A gcd B
63 57 59 62 3eqtr4d A B B denom A B = B A gcd B
64 54 56 63 3eqtr3d A B B denom A B = B A gcd B
65 64 60 eqtr4d A B B denom A B = B A gcd B
66 53 65 jca A B B numer A B = A A gcd B denom A B = B A gcd B