Metamath Proof Explorer


Theorem 2sqreult

Description: There exists a unique decomposition of a prime as a sum of squares of two different nonnegative integers. (Contributed by AV, 8-Jun-2023) (Proposed by GL, 8-Jun-2023.) (Revised by AV, 25-Jun-2023)

Ref Expression
Hypothesis 2sqreult.1 φ a < b a 2 + b 2 = P
Assertion 2sqreult P P mod 4 = 1 ∃! a 0 b 0 φ ∃! b 0 a 0 φ

Proof

Step Hyp Ref Expression
1 2sqreult.1 φ a < b a 2 + b 2 = P
2 2sqreultlem P P mod 4 = 1 ∃! a 0 ∃! b 0 a < b a 2 + b 2 = P
3 1 bicomi a < b a 2 + b 2 = P φ
4 3 reubii ∃! b 0 a < b a 2 + b 2 = P ∃! b 0 φ
5 4 reubii ∃! a 0 ∃! b 0 a < b a 2 + b 2 = P ∃! a 0 ∃! b 0 φ
6 1 2sqreulem4 a 0 * b 0 φ
7 2reu1 a 0 * b 0 φ ∃! a 0 ∃! b 0 φ ∃! a 0 b 0 φ ∃! b 0 a 0 φ
8 6 7 mp1i P P mod 4 = 1 ∃! a 0 ∃! b 0 φ ∃! a 0 b 0 φ ∃! b 0 a 0 φ
9 5 8 syl5bb P P mod 4 = 1 ∃! a 0 ∃! b 0 a < b a 2 + b 2 = P ∃! a 0 b 0 φ ∃! b 0 a 0 φ
10 2 9 mpbid P P mod 4 = 1 ∃! a 0 b 0 φ ∃! b 0 a 0 φ