Metamath Proof Explorer


Theorem 2sqreu

Description: There exists a unique decomposition of a prime of the form 4 k + 1 as a sum of squares of two nonnegative integers. See 2sqnn0 for the existence of such a decomposition. (Contributed by AV, 4-Jun-2023) (Revised by AV, 25-Jun-2023)

Ref Expression
Hypothesis 2sqreu.1 φaba2+b2=P
Assertion 2sqreu PPmod4=1∃!a0b0φ∃!b0a0φ

Proof

Step Hyp Ref Expression
1 2sqreu.1 φaba2+b2=P
2 2sqreulem1 PPmod4=1∃!a0∃!b0aba2+b2=P
3 1 bicomi aba2+b2=Pφ
4 3 reubii ∃!b0aba2+b2=P∃!b0φ
5 4 reubii ∃!a0∃!b0aba2+b2=P∃!a0∃!b0φ
6 1 2sqreulem4 a0*b0φ
7 2reu1 a0*b0φ∃!a0∃!b0φ∃!a0b0φ∃!b0a0φ
8 6 7 mp1i PPmod4=1∃!a0∃!b0φ∃!a0b0φ∃!b0a0φ
9 5 8 bitrid PPmod4=1∃!a0∃!b0aba2+b2=P∃!a0b0φ∃!b0a0φ
10 2 9 mpbid PPmod4=1∃!a0b0φ∃!b0a0φ