Metamath Proof Explorer


Theorem 2sqmo

Description: There exists at most one decomposition of a prime as a sum of two squares. See 2sqb for the existence of such a decomposition. (Contributed by Thierry Arnoux, 2-Feb-2020)

Ref Expression
Assertion 2sqmo P * a 0 b 0 a b a 2 + b 2 = P

Proof

Step Hyp Ref Expression
1 nfv b P a 0 c 0
2 nfre1 b b 0 a b a 2 + b 2 = P
3 1 2 nfan b P a 0 c 0 b 0 a b a 2 + b 2 = P
4 nfv b d 0
5 3 4 nfan b P a 0 c 0 b 0 a b a 2 + b 2 = P d 0
6 nfv b c d
7 5 6 nfan b P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d
8 nfv b c 2 + d 2 = P
9 7 8 nfan b P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P
10 simp-8l P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P P
11 simp-8r P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P a 0
12 simpllr P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P b 0
13 simp-7r P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P c 0
14 simp-6r P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P d 0
15 simplr P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P a b
16 simp-5r P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P c d
17 simpr P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P a 2 + b 2 = P
18 simp-4r P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P c 2 + d 2 = P
19 10 11 12 13 14 15 16 17 18 2sqmod P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P a = c b = d
20 19 simpld P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P a = c
21 20 anasss P a 0 c 0 d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P a = c
22 21 adantl5r P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P a = c
23 simp-4r P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P b 0 a b a 2 + b 2 = P
24 9 22 23 r19.29af P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P a = c
25 24 anasss P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P a = c
26 25 r19.29an P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P a = c
27 26 expl P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P a = c
28 27 ralrimiva P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P a = c
29 28 ralrimiva P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P a = c
30 breq12 a = c b = d a b c d
31 simpl a = c b = d a = c
32 31 oveq1d a = c b = d a 2 = c 2
33 simpr a = c b = d b = d
34 33 oveq1d a = c b = d b 2 = d 2
35 32 34 oveq12d a = c b = d a 2 + b 2 = c 2 + d 2
36 35 eqeq1d a = c b = d a 2 + b 2 = P c 2 + d 2 = P
37 30 36 anbi12d a = c b = d a b a 2 + b 2 = P c d c 2 + d 2 = P
38 37 cbvrexdva a = c b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P
39 38 rmo4 * a 0 b 0 a b a 2 + b 2 = P a 0 c 0 b 0 a b a 2 + b 2 = P d 0 c d c 2 + d 2 = P a = c
40 29 39 sylibr P * a 0 b 0 a b a 2 + b 2 = P