Metamath Proof Explorer


Theorem zesq

Description: An integer is even iff its square is even. (Contributed by Mario Carneiro, 12-Sep-2015)

Ref Expression
Assertion zesq N N 2 N 2 2

Proof

Step Hyp Ref Expression
1 zcn N N
2 sqval N N 2 = N N
3 1 2 syl N N 2 = N N
4 3 oveq1d N N 2 2 = N N 2
5 2cnd N 2
6 2ne0 2 0
7 6 a1i N 2 0
8 1 1 5 7 divassd N N N 2 = N N 2
9 4 8 eqtrd N N 2 2 = N N 2
10 9 adantr N N 2 N 2 2 = N N 2
11 zmulcl N N 2 N N 2
12 10 11 eqeltrd N N 2 N 2 2
13 1 adantr N N + 1 2 N
14 sqcl N N 2
15 13 14 syl N N + 1 2 N 2
16 peano2cn N 2 N 2 + 1
17 15 16 syl N N + 1 2 N 2 + 1
18 17 halfcld N N + 1 2 N 2 + 1 2
19 18 13 pncand N N + 1 2 N 2 + 1 2 + N - N = N 2 + 1 2
20 binom21 N N + 1 2 = N 2 + 2 N + 1
21 13 20 syl N N + 1 2 N + 1 2 = N 2 + 2 N + 1
22 peano2cn N N + 1
23 13 22 syl N N + 1 2 N + 1
24 sqval N + 1 N + 1 2 = N + 1 N + 1
25 23 24 syl N N + 1 2 N + 1 2 = N + 1 N + 1
26 2cn 2
27 mulcl 2 N 2 N
28 26 13 27 sylancr N N + 1 2 2 N
29 1cnd N N + 1 2 1
30 15 28 29 add32d N N + 1 2 N 2 + 2 N + 1 = N 2 + 1 + 2 N
31 21 25 30 3eqtr3d N N + 1 2 N + 1 N + 1 = N 2 + 1 + 2 N
32 31 oveq1d N N + 1 2 N + 1 N + 1 2 = N 2 + 1 + 2 N 2
33 2cnd N N + 1 2 2
34 6 a1i N N + 1 2 2 0
35 23 23 33 34 divassd N N + 1 2 N + 1 N + 1 2 = N + 1 N + 1 2
36 17 28 33 34 divdird N N + 1 2 N 2 + 1 + 2 N 2 = N 2 + 1 2 + 2 N 2
37 13 33 34 divcan3d N N + 1 2 2 N 2 = N
38 37 oveq2d N N + 1 2 N 2 + 1 2 + 2 N 2 = N 2 + 1 2 + N
39 36 38 eqtrd N N + 1 2 N 2 + 1 + 2 N 2 = N 2 + 1 2 + N
40 32 35 39 3eqtr3d N N + 1 2 N + 1 N + 1 2 = N 2 + 1 2 + N
41 peano2z N N + 1
42 zmulcl N + 1 N + 1 2 N + 1 N + 1 2
43 41 42 sylan N N + 1 2 N + 1 N + 1 2
44 40 43 eqeltrrd N N + 1 2 N 2 + 1 2 + N
45 simpl N N + 1 2 N
46 44 45 zsubcld N N + 1 2 N 2 + 1 2 + N - N
47 19 46 eqeltrrd N N + 1 2 N 2 + 1 2
48 47 ex N N + 1 2 N 2 + 1 2
49 48 con3d N ¬ N 2 + 1 2 ¬ N + 1 2
50 zsqcl N N 2
51 zeo2 N 2 N 2 2 ¬ N 2 + 1 2
52 50 51 syl N N 2 2 ¬ N 2 + 1 2
53 zeo2 N N 2 ¬ N + 1 2
54 49 52 53 3imtr4d N N 2 2 N 2
55 54 imp N N 2 2 N 2
56 12 55 impbida N N 2 N 2 2