Metamath Proof Explorer


Theorem 2lgslem3d1

Description: Lemma 4 for 2lgslem3 . (Contributed by AV, 15-Jul-2021)

Ref Expression
Hypothesis 2lgslem2.n N = P 1 2 P 4
Assertion 2lgslem3d1 P P mod 8 = 7 N mod 2 = 0

Proof

Step Hyp Ref Expression
1 2lgslem2.n N = P 1 2 P 4
2 nnnn0 P P 0
3 8nn 8
4 nnrp 8 8 +
5 3 4 ax-mp 8 +
6 modmuladdnn0 P 0 8 + P mod 8 = 7 k 0 P = k 8 + 7
7 2 5 6 sylancl P P mod 8 = 7 k 0 P = k 8 + 7
8 simpr P k 0 k 0
9 nn0cn k 0 k
10 8cn 8
11 10 a1i k 0 8
12 9 11 mulcomd k 0 k 8 = 8 k
13 12 adantl P k 0 k 8 = 8 k
14 13 oveq1d P k 0 k 8 + 7 = 8 k + 7
15 14 eqeq2d P k 0 P = k 8 + 7 P = 8 k + 7
16 15 biimpa P k 0 P = k 8 + 7 P = 8 k + 7
17 1 2lgslem3d k 0 P = 8 k + 7 N = 2 k + 2
18 8 16 17 syl2an2r P k 0 P = k 8 + 7 N = 2 k + 2
19 oveq1 N = 2 k + 2 N mod 2 = 2 k + 2 mod 2
20 2t1e2 2 1 = 2
21 20 eqcomi 2 = 2 1
22 21 a1i k 0 2 = 2 1
23 22 oveq2d k 0 2 k + 2 = 2 k + 2 1
24 2cnd k 0 2
25 1cnd k 0 1
26 adddi 2 k 1 2 k + 1 = 2 k + 2 1
27 26 eqcomd 2 k 1 2 k + 2 1 = 2 k + 1
28 24 9 25 27 syl3anc k 0 2 k + 2 1 = 2 k + 1
29 9 25 addcld k 0 k + 1
30 24 29 mulcomd k 0 2 k + 1 = k + 1 2
31 23 28 30 3eqtrd k 0 2 k + 2 = k + 1 2
32 31 oveq1d k 0 2 k + 2 mod 2 = k + 1 2 mod 2
33 peano2nn0 k 0 k + 1 0
34 33 nn0zd k 0 k + 1
35 2rp 2 +
36 mulmod0 k + 1 2 + k + 1 2 mod 2 = 0
37 34 35 36 sylancl k 0 k + 1 2 mod 2 = 0
38 32 37 eqtrd k 0 2 k + 2 mod 2 = 0
39 19 38 sylan9eqr k 0 N = 2 k + 2 N mod 2 = 0
40 8 18 39 syl2an2r P k 0 P = k 8 + 7 N mod 2 = 0
41 40 rexlimdva2 P k 0 P = k 8 + 7 N mod 2 = 0
42 7 41 syld P P mod 8 = 7 N mod 2 = 0
43 42 imp P P mod 8 = 7 N mod 2 = 0