Metamath Proof Explorer


Theorem zsqrtelqelz

Description: If an integer has a rational square root, that root is must be an integer. (Contributed by Stefan O'Rear, 15-Sep-2014)

Ref Expression
Assertion zsqrtelqelz A A A

Proof

Step Hyp Ref Expression
1 qdencl A denom A
2 1 adantl A A denom A
3 2 nnred A A denom A
4 1red A A 1
5 2 nnnn0d A A denom A 0
6 5 nn0ge0d A A 0 denom A
7 0le1 0 1
8 7 a1i A A 0 1
9 sq1 1 2 = 1
10 9 a1i A A 1 2 = 1
11 zcn A A
12 11 sqsqrtd A A 2 = A
13 12 adantr A A A 2 = A
14 13 fveq2d A A denom A 2 = denom A
15 simpl A A A
16 zq A A
17 16 adantr A A A
18 qden1elz A denom A = 1 A
19 17 18 syl A A denom A = 1 A
20 15 19 mpbird A A denom A = 1
21 14 20 eqtrd A A denom A 2 = 1
22 densq A denom A 2 = denom A 2
23 22 adantl A A denom A 2 = denom A 2
24 10 21 23 3eqtr2rd A A denom A 2 = 1 2
25 3 4 6 8 24 sq11d A A denom A = 1
26 qden1elz A denom A = 1 A
27 26 adantl A A denom A = 1 A
28 25 27 mpbid A A A