Metamath Proof Explorer


Theorem pell1234qrdich

Description: A general Pell solution is either a positive solution, or its negation is. (Contributed by Stefan O'Rear, 18-Sep-2014)

Ref Expression
Assertion pell1234qrdich D A Pell1234QR D A Pell14QR D A Pell14QR D

Proof

Step Hyp Ref Expression
1 elpell1234qr D A Pell1234QR D A a b A = a + D b a 2 D b 2 = 1
2 simp-4r D A a a 0 b A = a + D b a 2 D b 2 = 1 A
3 oveq1 c = a c + D b = a + D b
4 3 eqeq2d c = a A = c + D b A = a + D b
5 oveq1 c = a c 2 = a 2
6 5 oveq1d c = a c 2 D b 2 = a 2 D b 2
7 6 eqeq1d c = a c 2 D b 2 = 1 a 2 D b 2 = 1
8 4 7 anbi12d c = a A = c + D b c 2 D b 2 = 1 A = a + D b a 2 D b 2 = 1
9 8 rexbidv c = a b A = c + D b c 2 D b 2 = 1 b A = a + D b a 2 D b 2 = 1
10 9 rspcev a 0 b A = a + D b a 2 D b 2 = 1 c 0 b A = c + D b c 2 D b 2 = 1
11 10 adantll D A a a 0 b A = a + D b a 2 D b 2 = 1 c 0 b A = c + D b c 2 D b 2 = 1
12 elpell14qr D A Pell14QR D A c 0 b A = c + D b c 2 D b 2 = 1
13 12 ad4antr D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A c 0 b A = c + D b c 2 D b 2 = 1
14 2 11 13 mpbir2and D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D
15 14 orcd D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
16 15 exp31 D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
17 simp-5r D A a a 0 b A = a + D b a 2 D b 2 = 1 A
18 17 renegcld D A a a 0 b A = a + D b a 2 D b 2 = 1 A
19 simpllr D A a a 0 b A = a + D b a 2 D b 2 = 1 a 0
20 znegcl b b
21 20 ad2antlr D A a a 0 b A = a + D b a 2 D b 2 = 1 b
22 simprl D A a a 0 b A = a + D b a 2 D b 2 = 1 A = a + D b
23 22 negeqd D A a a 0 b A = a + D b a 2 D b 2 = 1 A = a + D b
24 zcn a a
25 24 ad4antlr D A a a 0 b A = a + D b a 2 D b 2 = 1 a
26 eldifi D D
27 26 nncnd D D
28 27 ad5antr D A a a 0 b A = a + D b a 2 D b 2 = 1 D
29 28 sqrtcld D A a a 0 b A = a + D b a 2 D b 2 = 1 D
30 zcn b b
31 30 ad2antlr D A a a 0 b A = a + D b a 2 D b 2 = 1 b
32 29 31 mulcld D A a a 0 b A = a + D b a 2 D b 2 = 1 D b
33 25 32 negdid D A a a 0 b A = a + D b a 2 D b 2 = 1 a + D b = - a + D b
34 mulneg2 D b D b = D b
35 34 eqcomd D b D b = D b
36 29 31 35 syl2anc D A a a 0 b A = a + D b a 2 D b 2 = 1 D b = D b
37 36 oveq2d D A a a 0 b A = a + D b a 2 D b 2 = 1 - a + D b = - a + D b
38 23 33 37 3eqtrd D A a a 0 b A = a + D b a 2 D b 2 = 1 A = - a + D b
39 sqneg a a 2 = a 2
40 25 39 syl D A a a 0 b A = a + D b a 2 D b 2 = 1 a 2 = a 2
41 sqneg b b 2 = b 2
42 31 41 syl D A a a 0 b A = a + D b a 2 D b 2 = 1 b 2 = b 2
43 42 oveq2d D A a a 0 b A = a + D b a 2 D b 2 = 1 D b 2 = D b 2
44 40 43 oveq12d D A a a 0 b A = a + D b a 2 D b 2 = 1 a 2 D b 2 = a 2 D b 2
45 simprr D A a a 0 b A = a + D b a 2 D b 2 = 1 a 2 D b 2 = 1
46 44 45 eqtrd D A a a 0 b A = a + D b a 2 D b 2 = 1 a 2 D b 2 = 1
47 oveq1 c = a c + D d = - a + D d
48 47 eqeq2d c = a A = c + D d A = - a + D d
49 oveq1 c = a c 2 = a 2
50 49 oveq1d c = a c 2 D d 2 = a 2 D d 2
51 50 eqeq1d c = a c 2 D d 2 = 1 a 2 D d 2 = 1
52 48 51 anbi12d c = a A = c + D d c 2 D d 2 = 1 A = - a + D d a 2 D d 2 = 1
53 oveq2 d = b D d = D b
54 53 oveq2d d = b - a + D d = - a + D b
55 54 eqeq2d d = b A = - a + D d A = - a + D b
56 oveq1 d = b d 2 = b 2
57 56 oveq2d d = b D d 2 = D b 2
58 57 oveq2d d = b a 2 D d 2 = a 2 D b 2
59 58 eqeq1d d = b a 2 D d 2 = 1 a 2 D b 2 = 1
60 55 59 anbi12d d = b A = - a + D d a 2 D d 2 = 1 A = - a + D b a 2 D b 2 = 1
61 52 60 rspc2ev a 0 b A = - a + D b a 2 D b 2 = 1 c 0 d A = c + D d c 2 D d 2 = 1
62 19 21 38 46 61 syl112anc D A a a 0 b A = a + D b a 2 D b 2 = 1 c 0 d A = c + D d c 2 D d 2 = 1
63 elpell14qr D A Pell14QR D A c 0 d A = c + D d c 2 D d 2 = 1
64 63 ad5antr D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A c 0 d A = c + D d c 2 D d 2 = 1
65 18 62 64 mpbir2and D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D
66 65 olcd D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
67 66 ex D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
68 67 rexlimdva D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
69 68 ex D A a a 0 b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
70 elznn0 a a a 0 a 0
71 70 simprbi a a 0 a 0
72 71 adantl D A a a 0 a 0
73 16 69 72 mpjaod D A a b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
74 73 rexlimdva D A a b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
75 74 expimpd D A a b A = a + D b a 2 D b 2 = 1 A Pell14QR D A Pell14QR D
76 1 75 sylbid D A Pell1234QR D A Pell14QR D A Pell14QR D
77 76 imp D A Pell1234QR D A Pell14QR D A Pell14QR D