Metamath Proof Explorer


Theorem 4sqlem7

Description: Lemma for 4sq . (Contributed by Mario Carneiro, 15-Jul-2014)

Ref Expression
Hypotheses 4sqlem5.2 φ A
4sqlem5.3 φ M
4sqlem5.4 B = A + M 2 mod M M 2
Assertion 4sqlem7 φ B 2 M 2 2 2

Proof

Step Hyp Ref Expression
1 4sqlem5.2 φ A
2 4sqlem5.3 φ M
3 4sqlem5.4 B = A + M 2 mod M M 2
4 1 2 3 4sqlem5 φ B A B M
5 4 simpld φ B
6 5 zred φ B
7 2 nnrpd φ M +
8 7 rphalfcld φ M 2 +
9 8 rpred φ M 2
10 1 2 3 4sqlem6 φ M 2 B B < M 2
11 10 simprd φ B < M 2
12 6 9 11 ltled φ B M 2
13 10 simpld φ M 2 B
14 9 6 13 lenegcon1d φ B M 2
15 8 rpge0d φ 0 M 2
16 lenegsq B M 2 0 M 2 B M 2 B M 2 B 2 M 2 2
17 6 9 15 16 syl3anc φ B M 2 B M 2 B 2 M 2 2
18 12 14 17 mpbi2and φ B 2 M 2 2
19 2cnd φ 2
20 19 sqvald φ 2 2 = 2 2
21 20 oveq2d φ M 2 2 2 = M 2 2 2
22 2 nncnd φ M
23 2ne0 2 0
24 23 a1i φ 2 0
25 22 19 24 sqdivd φ M 2 2 = M 2 2 2
26 22 sqcld φ M 2
27 26 19 19 24 24 divdiv1d φ M 2 2 2 = M 2 2 2
28 21 25 27 3eqtr4d φ M 2 2 = M 2 2 2
29 18 28 breqtrd φ B 2 M 2 2 2