Metamath Proof Explorer


Theorem 2sqreuopnn

Description: There exists a unique decomposition of a prime of the form 4 k + 1 as a sum of squares of two positive integers. Ordered pair variant of 2sqreunn . (Contributed by AV, 2-Jul-2023)

Ref Expression
Assertion 2sqreuopnn PPmod4=1∃!p×1stp2ndp1stp2+2ndp2=P

Proof

Step Hyp Ref Expression
1 biid aba2+b2=Paba2+b2=P
2 1 2sqreunn PPmod4=1∃!ababa2+b2=P∃!baaba2+b2=P
3 fveq2 p=ab1stp=1stab
4 fveq2 p=ab2ndp=2ndab
5 3 4 breq12d p=ab1stp2ndp1stab2ndab
6 vex aV
7 vex bV
8 6 7 op1st 1stab=a
9 6 7 op2nd 2ndab=b
10 8 9 breq12i 1stab2ndabab
11 5 10 bitrdi p=ab1stp2ndpab
12 6 7 op1std p=ab1stp=a
13 12 oveq1d p=ab1stp2=a2
14 6 7 op2ndd p=ab2ndp=b
15 14 oveq1d p=ab2ndp2=b2
16 13 15 oveq12d p=ab1stp2+2ndp2=a2+b2
17 16 eqeq1d p=ab1stp2+2ndp2=Pa2+b2=P
18 11 17 anbi12d p=ab1stp2ndp1stp2+2ndp2=Paba2+b2=P
19 18 opreu2reurex ∃!p×1stp2ndp1stp2+2ndp2=P∃!ababa2+b2=P∃!baaba2+b2=P
20 2 19 sylibr PPmod4=1∃!p×1stp2ndp1stp2+2ndp2=P