Metamath Proof Explorer


Theorem 4sqlem9

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
4sqlem9.5 φ ψ B 2 = 0
Assertion 4sqlem9 φ ψ M 2 A 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 4sqlem9.5 φ ψ B 2 = 0
5 1 2 3 4sqlem5 φ B A B M
6 5 simpld φ B
7 6 zcnd φ B
8 sqeq0 B B 2 = 0 B = 0
9 7 8 syl φ B 2 = 0 B = 0
10 9 biimpa φ B 2 = 0 B = 0
11 4 10 syldan φ ψ B = 0
12 11 oveq2d φ ψ A B = A 0
13 1 adantr φ ψ A
14 13 zcnd φ ψ A
15 14 subid1d φ ψ A 0 = A
16 12 15 eqtrd φ ψ A B = A
17 16 oveq1d φ ψ A B M = A M
18 5 simprd φ A B M
19 18 adantr φ ψ A B M
20 17 19 eqeltrrd φ ψ A M
21 2 nnzd φ M
22 2 nnne0d φ M 0
23 dvdsval2 M M 0 A M A A M
24 21 22 1 23 syl3anc φ M A A M
25 24 adantr φ ψ M A A M
26 20 25 mpbird φ ψ M A
27 dvdssq M A M A M 2 A 2
28 21 13 27 syl2an2r φ ψ M A M 2 A 2
29 26 28 mpbid φ ψ M 2 A 2