Metamath Proof Explorer


Theorem 2sqreuopnnltb

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

Ref Expression
Assertion 2sqreuopnnltb PPmod4=1∃!p×1stp<2ndp1stp2+2ndp2=P

Proof

Step Hyp Ref Expression
1 biid a<ba2+b2=Pa<ba2+b2=P
2 1 2sqreunnltb PPmod4=1∃!aba<ba2+b2=P∃!baa<ba2+b2=P
3 fveq2 p=ab1stp=1stab
4 fveq2 p=ab2ndp=2ndab
5 3 4 breq12d p=ab1stp<2ndp1stab<2ndab
6 vex aV
7 vex bV
8 6 7 op1st 1stab=a
9 6 7 op2nd 2ndab=b
10 8 9 breq12i 1stab<2ndaba<b
11 5 10 bitrdi p=ab1stp<2ndpa<b
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=ab1stp<2ndp1stp2+2ndp2=Pa<ba2+b2=P
19 18 opreu2reurex ∃!p×1stp<2ndp1stp2+2ndp2=P∃!aba<ba2+b2=P∃!baa<ba2+b2=P
20 2 19 bitr4di PPmod4=1∃!p×1stp<2ndp1stp2+2ndp2=P