Metamath Proof Explorer


Theorem difsqpwdvds

Description: If the difference of two squares is a power of a prime, the prime divides twice the second squared number. (Contributed by AV, 13-Aug-2021)

Ref Expression
Assertion difsqpwdvds A 0 B 0 B + 1 < A C D 0 C D = A 2 B 2 C 2 B

Proof

Step Hyp Ref Expression
1 nn0cn A 0 A
2 nn0cn B 0 B
3 1 2 anim12i A 0 B 0 A B
4 3 3adant3 A 0 B 0 B + 1 < A A B
5 subsq A B A 2 B 2 = A + B A B
6 4 5 syl A 0 B 0 B + 1 < A A 2 B 2 = A + B A B
7 6 adantr A 0 B 0 B + 1 < A C D 0 A 2 B 2 = A + B A B
8 7 eqeq2d A 0 B 0 B + 1 < A C D 0 C D = A 2 B 2 C D = A + B A B
9 simprl A 0 B 0 B + 1 < A C D 0 C
10 nn0z A 0 A
11 nn0z B 0 B
12 10 11 anim12i A 0 B 0 A B
13 zaddcl A B A + B
14 12 13 syl A 0 B 0 A + B
15 14 3adant3 A 0 B 0 B + 1 < A A + B
16 nn0re B 0 B
17 16 adantl A 0 B 0 B
18 1red A 0 B 0 1
19 nn0re A 0 A
20 19 adantr A 0 B 0 A
21 17 18 20 ltaddsub2d A 0 B 0 B + 1 < A 1 < A B
22 simpr A 0 B 0 B 0
23 20 22 18 3jca A 0 B 0 A B 0 1
24 difgtsumgt A B 0 1 1 < A B 1 < A + B
25 23 24 syl A 0 B 0 1 < A B 1 < A + B
26 21 25 sylbid A 0 B 0 B + 1 < A 1 < A + B
27 26 3impia A 0 B 0 B + 1 < A 1 < A + B
28 eluz2b1 A + B 2 A + B 1 < A + B
29 15 27 28 sylanbrc A 0 B 0 B + 1 < A A + B 2
30 29 adantr A 0 B 0 B + 1 < A C D 0 A + B 2
31 simprr A 0 B 0 B + 1 < A C D 0 D 0
32 9 30 31 3jca A 0 B 0 B + 1 < A C D 0 C A + B 2 D 0
33 32 adantr A 0 B 0 B + 1 < A C D 0 C D = A + B A B C A + B 2 D 0
34 zsubcl A B A B
35 13 34 jca A B A + B A B
36 12 35 syl A 0 B 0 A + B A B
37 36 3adant3 A 0 B 0 B + 1 < A A + B A B
38 dvdsmul1 A + B A B A + B A + B A B
39 37 38 syl A 0 B 0 B + 1 < A A + B A + B A B
40 39 ad2antrr A 0 B 0 B + 1 < A C D 0 C D = A + B A B A + B A + B A B
41 breq2 C D = A + B A B A + B C D A + B A + B A B
42 41 adantl A 0 B 0 B + 1 < A C D 0 C D = A + B A B A + B C D A + B A + B A B
43 40 42 mpbird A 0 B 0 B + 1 < A C D 0 C D = A + B A B A + B C D
44 dvdsprmpweqnn C A + B 2 D 0 A + B C D m A + B = C m
45 33 43 44 sylc A 0 B 0 B + 1 < A C D 0 C D = A + B A B m A + B = C m
46 prmz C C
47 iddvdsexp C m C C m
48 46 47 sylan C m C C m
49 breq2 A + B = C m C A + B C C m
50 48 49 syl5ibrcom C m A + B = C m C A + B
51 50 rexlimdva C m A + B = C m C A + B
52 51 adantr C D 0 m A + B = C m C A + B
53 52 adantl A 0 B 0 B + 1 < A C D 0 m A + B = C m C A + B
54 53 adantr A 0 B 0 B + 1 < A C D 0 C D = A + B A B m A + B = C m C A + B
55 12 34 syl A 0 B 0 A B
56 55 3adant3 A 0 B 0 B + 1 < A A B
57 21 biimp3a A 0 B 0 B + 1 < A 1 < A B
58 eluz2b1 A B 2 A B 1 < A B
59 56 57 58 sylanbrc A 0 B 0 B + 1 < A A B 2
60 59 adantr A 0 B 0 B + 1 < A C D 0 A B 2
61 9 60 31 3jca A 0 B 0 B + 1 < A C D 0 C A B 2 D 0
62 61 adantr A 0 B 0 B + 1 < A C D 0 C D = A + B A B C A B 2 D 0
63 dvdsmul2 A + B A B A B A + B A B
64 37 63 syl A 0 B 0 B + 1 < A A B A + B A B
65 64 ad2antrr A 0 B 0 B + 1 < A C D 0 C D = A + B A B A B A + B A B
66 breq2 C D = A + B A B A B C D A B A + B A B
67 66 adantl A 0 B 0 B + 1 < A C D 0 C D = A + B A B A B C D A B A + B A B
68 65 67 mpbird A 0 B 0 B + 1 < A C D 0 C D = A + B A B A B C D
69 dvdsprmpweqnn C A B 2 D 0 A B C D n A B = C n
70 62 68 69 sylc A 0 B 0 B + 1 < A C D 0 C D = A + B A B n A B = C n
71 iddvdsexp C n C C n
72 46 71 sylan C n C C n
73 breq2 A B = C n C A B C C n
74 72 73 syl5ibrcom C n A B = C n C A B
75 74 rexlimdva C n A B = C n C A B
76 75 adantr C D 0 n A B = C n C A B
77 76 adantl A 0 B 0 B + 1 < A C D 0 n A B = C n C A B
78 77 adantr A 0 B 0 B + 1 < A C D 0 C D = A + B A B n A B = C n C A B
79 46 adantr C D 0 C
80 37 79 anim12ci A 0 B 0 B + 1 < A C D 0 C A + B A B
81 3anass C A + B A B C A + B A B
82 80 81 sylibr A 0 B 0 B + 1 < A C D 0 C A + B A B
83 dvds2sub C A + B A B C A + B C A B C A + B - A B
84 82 83 syl A 0 B 0 B + 1 < A C D 0 C A + B C A B C A + B - A B
85 1 3ad2ant1 A 0 B 0 B + 1 < A A
86 2 3ad2ant2 A 0 B 0 B + 1 < A B
87 85 86 86 pnncand A 0 B 0 B + 1 < A A + B - A B = B + B
88 2 2timesd B 0 2 B = B + B
89 88 eqcomd B 0 B + B = 2 B
90 89 3ad2ant2 A 0 B 0 B + 1 < A B + B = 2 B
91 87 90 eqtrd A 0 B 0 B + 1 < A A + B - A B = 2 B
92 91 breq2d A 0 B 0 B + 1 < A C A + B - A B C 2 B
93 92 biimpd A 0 B 0 B + 1 < A C A + B - A B C 2 B
94 93 adantr A 0 B 0 B + 1 < A C D 0 C A + B - A B C 2 B
95 84 94 syld A 0 B 0 B + 1 < A C D 0 C A + B C A B C 2 B
96 95 expcomd A 0 B 0 B + 1 < A C D 0 C A B C A + B C 2 B
97 96 adantr A 0 B 0 B + 1 < A C D 0 C D = A + B A B C A B C A + B C 2 B
98 78 97 syld A 0 B 0 B + 1 < A C D 0 C D = A + B A B n A B = C n C A + B C 2 B
99 70 98 mpd A 0 B 0 B + 1 < A C D 0 C D = A + B A B C A + B C 2 B
100 54 99 syld A 0 B 0 B + 1 < A C D 0 C D = A + B A B m A + B = C m C 2 B
101 45 100 mpd A 0 B 0 B + 1 < A C D 0 C D = A + B A B C 2 B
102 101 ex A 0 B 0 B + 1 < A C D 0 C D = A + B A B C 2 B
103 8 102 sylbid A 0 B 0 B + 1 < A C D 0 C D = A 2 B 2 C 2 B