Metamath Proof Explorer


Theorem 2sqreunnltb

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 . (Contributed by AV, 11-Jun-2023) The prime needs not be odd, as observed by WL. (Revised by AV, 25-Jun-2023)

Ref Expression
Hypothesis 2sqreult.1 φa<ba2+b2=P
Assertion 2sqreunnltb PPmod4=1∃!abφ∃!baφ

Proof

Step Hyp Ref Expression
1 2sqreult.1 φa<ba2+b2=P
2 2sqreunnltblem PPmod4=1∃!a∃!ba<ba2+b2=P
3 1 bicomi a<ba2+b2=Pφ
4 3 reubii ∃!ba<ba2+b2=P∃!bφ
5 4 reubii ∃!a∃!ba<ba2+b2=P∃!a∃!bφ
6 1 2sqreunnlem2 a*bφ
7 2reu1 a*bφ∃!a∃!bφ∃!abφ∃!baφ
8 6 7 ax-mp ∃!a∃!bφ∃!abφ∃!baφ
9 5 8 bitri ∃!a∃!ba<ba2+b2=P∃!abφ∃!baφ
10 2 9 bitrdi PPmod4=1∃!abφ∃!baφ