Metamath Proof Explorer


Theorem 2lgslem3a1

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

Ref Expression
Hypothesis 2lgslem2.n 𝑁 = ( ( ( 𝑃 − 1 ) / 2 ) − ( ⌊ ‘ ( 𝑃 / 4 ) ) )
Assertion 2lgslem3a1 ( ( 𝑃 ∈ ℕ ∧ ( 𝑃 mod 8 ) = 1 ) → ( 𝑁 mod 2 ) = 0 )

Proof

Step Hyp Ref Expression
1 2lgslem2.n 𝑁 = ( ( ( 𝑃 − 1 ) / 2 ) − ( ⌊ ‘ ( 𝑃 / 4 ) ) )
2 nnnn0 ( 𝑃 ∈ ℕ → 𝑃 ∈ ℕ0 )
3 8nn 8 ∈ ℕ
4 nnrp ( 8 ∈ ℕ → 8 ∈ ℝ+ )
5 3 4 ax-mp 8 ∈ ℝ+
6 modmuladdnn0 ( ( 𝑃 ∈ ℕ0 ∧ 8 ∈ ℝ+ ) → ( ( 𝑃 mod 8 ) = 1 → ∃ 𝑘 ∈ ℕ0 𝑃 = ( ( 𝑘 · 8 ) + 1 ) ) )
7 2 5 6 sylancl ( 𝑃 ∈ ℕ → ( ( 𝑃 mod 8 ) = 1 → ∃ 𝑘 ∈ ℕ0 𝑃 = ( ( 𝑘 · 8 ) + 1 ) ) )
8 simpr ( ( 𝑃 ∈ ℕ ∧ 𝑘 ∈ ℕ0 ) → 𝑘 ∈ ℕ0 )
9 nn0cn ( 𝑘 ∈ ℕ0𝑘 ∈ ℂ )
10 8cn 8 ∈ ℂ
11 10 a1i ( 𝑘 ∈ ℕ0 → 8 ∈ ℂ )
12 9 11 mulcomd ( 𝑘 ∈ ℕ0 → ( 𝑘 · 8 ) = ( 8 · 𝑘 ) )
13 12 adantl ( ( 𝑃 ∈ ℕ ∧ 𝑘 ∈ ℕ0 ) → ( 𝑘 · 8 ) = ( 8 · 𝑘 ) )
14 13 oveq1d ( ( 𝑃 ∈ ℕ ∧ 𝑘 ∈ ℕ0 ) → ( ( 𝑘 · 8 ) + 1 ) = ( ( 8 · 𝑘 ) + 1 ) )
15 14 eqeq2d ( ( 𝑃 ∈ ℕ ∧ 𝑘 ∈ ℕ0 ) → ( 𝑃 = ( ( 𝑘 · 8 ) + 1 ) ↔ 𝑃 = ( ( 8 · 𝑘 ) + 1 ) ) )
16 15 biimpa ( ( ( 𝑃 ∈ ℕ ∧ 𝑘 ∈ ℕ0 ) ∧ 𝑃 = ( ( 𝑘 · 8 ) + 1 ) ) → 𝑃 = ( ( 8 · 𝑘 ) + 1 ) )
17 1 2lgslem3a ( ( 𝑘 ∈ ℕ0𝑃 = ( ( 8 · 𝑘 ) + 1 ) ) → 𝑁 = ( 2 · 𝑘 ) )
18 8 16 17 syl2an2r ( ( ( 𝑃 ∈ ℕ ∧ 𝑘 ∈ ℕ0 ) ∧ 𝑃 = ( ( 𝑘 · 8 ) + 1 ) ) → 𝑁 = ( 2 · 𝑘 ) )
19 oveq1 ( 𝑁 = ( 2 · 𝑘 ) → ( 𝑁 mod 2 ) = ( ( 2 · 𝑘 ) mod 2 ) )
20 2cnd ( 𝑘 ∈ ℕ0 → 2 ∈ ℂ )
21 20 9 mulcomd ( 𝑘 ∈ ℕ0 → ( 2 · 𝑘 ) = ( 𝑘 · 2 ) )
22 21 oveq1d ( 𝑘 ∈ ℕ0 → ( ( 2 · 𝑘 ) mod 2 ) = ( ( 𝑘 · 2 ) mod 2 ) )
23 nn0z ( 𝑘 ∈ ℕ0𝑘 ∈ ℤ )
24 2rp 2 ∈ ℝ+
25 mulmod0 ( ( 𝑘 ∈ ℤ ∧ 2 ∈ ℝ+ ) → ( ( 𝑘 · 2 ) mod 2 ) = 0 )
26 23 24 25 sylancl ( 𝑘 ∈ ℕ0 → ( ( 𝑘 · 2 ) mod 2 ) = 0 )
27 22 26 eqtrd ( 𝑘 ∈ ℕ0 → ( ( 2 · 𝑘 ) mod 2 ) = 0 )
28 19 27 sylan9eqr ( ( 𝑘 ∈ ℕ0𝑁 = ( 2 · 𝑘 ) ) → ( 𝑁 mod 2 ) = 0 )
29 8 18 28 syl2an2r ( ( ( 𝑃 ∈ ℕ ∧ 𝑘 ∈ ℕ0 ) ∧ 𝑃 = ( ( 𝑘 · 8 ) + 1 ) ) → ( 𝑁 mod 2 ) = 0 )
30 29 rexlimdva2 ( 𝑃 ∈ ℕ → ( ∃ 𝑘 ∈ ℕ0 𝑃 = ( ( 𝑘 · 8 ) + 1 ) → ( 𝑁 mod 2 ) = 0 ) )
31 7 30 syld ( 𝑃 ∈ ℕ → ( ( 𝑃 mod 8 ) = 1 → ( 𝑁 mod 2 ) = 0 ) )
32 31 imp ( ( 𝑃 ∈ ℕ ∧ ( 𝑃 mod 8 ) = 1 ) → ( 𝑁 mod 2 ) = 0 )