Metamath Proof Explorer


Theorem 2lgslem3b

Description: Lemma for 2lgslem3b1 . (Contributed by AV, 16-Jul-2021)

Ref Expression
Hypothesis 2lgslem2.n
|- N = ( ( ( P - 1 ) / 2 ) - ( |_ ` ( P / 4 ) ) )
Assertion 2lgslem3b
|- ( ( K e. NN0 /\ P = ( ( 8 x. K ) + 3 ) ) -> N = ( ( 2 x. K ) + 1 ) )

Proof

Step Hyp Ref Expression
1 2lgslem2.n
 |-  N = ( ( ( P - 1 ) / 2 ) - ( |_ ` ( P / 4 ) ) )
2 oveq1
 |-  ( P = ( ( 8 x. K ) + 3 ) -> ( P - 1 ) = ( ( ( 8 x. K ) + 3 ) - 1 ) )
3 2 oveq1d
 |-  ( P = ( ( 8 x. K ) + 3 ) -> ( ( P - 1 ) / 2 ) = ( ( ( ( 8 x. K ) + 3 ) - 1 ) / 2 ) )
4 fvoveq1
 |-  ( P = ( ( 8 x. K ) + 3 ) -> ( |_ ` ( P / 4 ) ) = ( |_ ` ( ( ( 8 x. K ) + 3 ) / 4 ) ) )
5 3 4 oveq12d
 |-  ( P = ( ( 8 x. K ) + 3 ) -> ( ( ( P - 1 ) / 2 ) - ( |_ ` ( P / 4 ) ) ) = ( ( ( ( ( 8 x. K ) + 3 ) - 1 ) / 2 ) - ( |_ ` ( ( ( 8 x. K ) + 3 ) / 4 ) ) ) )
6 1 5 syl5eq
 |-  ( P = ( ( 8 x. K ) + 3 ) -> N = ( ( ( ( ( 8 x. K ) + 3 ) - 1 ) / 2 ) - ( |_ ` ( ( ( 8 x. K ) + 3 ) / 4 ) ) ) )
7 8nn0
 |-  8 e. NN0
8 7 a1i
 |-  ( K e. NN0 -> 8 e. NN0 )
9 id
 |-  ( K e. NN0 -> K e. NN0 )
10 8 9 nn0mulcld
 |-  ( K e. NN0 -> ( 8 x. K ) e. NN0 )
11 10 nn0cnd
 |-  ( K e. NN0 -> ( 8 x. K ) e. CC )
12 3cn
 |-  3 e. CC
13 12 a1i
 |-  ( K e. NN0 -> 3 e. CC )
14 1cnd
 |-  ( K e. NN0 -> 1 e. CC )
15 11 13 14 addsubassd
 |-  ( K e. NN0 -> ( ( ( 8 x. K ) + 3 ) - 1 ) = ( ( 8 x. K ) + ( 3 - 1 ) ) )
16 4t2e8
 |-  ( 4 x. 2 ) = 8
17 16 eqcomi
 |-  8 = ( 4 x. 2 )
18 17 a1i
 |-  ( K e. NN0 -> 8 = ( 4 x. 2 ) )
19 18 oveq1d
 |-  ( K e. NN0 -> ( 8 x. K ) = ( ( 4 x. 2 ) x. K ) )
20 4cn
 |-  4 e. CC
21 20 a1i
 |-  ( K e. NN0 -> 4 e. CC )
22 2cn
 |-  2 e. CC
23 22 a1i
 |-  ( K e. NN0 -> 2 e. CC )
24 nn0cn
 |-  ( K e. NN0 -> K e. CC )
25 21 23 24 mul32d
 |-  ( K e. NN0 -> ( ( 4 x. 2 ) x. K ) = ( ( 4 x. K ) x. 2 ) )
26 19 25 eqtrd
 |-  ( K e. NN0 -> ( 8 x. K ) = ( ( 4 x. K ) x. 2 ) )
27 3m1e2
 |-  ( 3 - 1 ) = 2
28 27 a1i
 |-  ( K e. NN0 -> ( 3 - 1 ) = 2 )
29 26 28 oveq12d
 |-  ( K e. NN0 -> ( ( 8 x. K ) + ( 3 - 1 ) ) = ( ( ( 4 x. K ) x. 2 ) + 2 ) )
30 15 29 eqtrd
 |-  ( K e. NN0 -> ( ( ( 8 x. K ) + 3 ) - 1 ) = ( ( ( 4 x. K ) x. 2 ) + 2 ) )
31 30 oveq1d
 |-  ( K e. NN0 -> ( ( ( ( 8 x. K ) + 3 ) - 1 ) / 2 ) = ( ( ( ( 4 x. K ) x. 2 ) + 2 ) / 2 ) )
32 4nn0
 |-  4 e. NN0
33 32 a1i
 |-  ( K e. NN0 -> 4 e. NN0 )
34 33 9 nn0mulcld
 |-  ( K e. NN0 -> ( 4 x. K ) e. NN0 )
35 34 nn0cnd
 |-  ( K e. NN0 -> ( 4 x. K ) e. CC )
36 35 23 mulcld
 |-  ( K e. NN0 -> ( ( 4 x. K ) x. 2 ) e. CC )
37 2rp
 |-  2 e. RR+
38 37 a1i
 |-  ( K e. NN0 -> 2 e. RR+ )
39 38 rpcnne0d
 |-  ( K e. NN0 -> ( 2 e. CC /\ 2 =/= 0 ) )
40 divdir
 |-  ( ( ( ( 4 x. K ) x. 2 ) e. CC /\ 2 e. CC /\ ( 2 e. CC /\ 2 =/= 0 ) ) -> ( ( ( ( 4 x. K ) x. 2 ) + 2 ) / 2 ) = ( ( ( ( 4 x. K ) x. 2 ) / 2 ) + ( 2 / 2 ) ) )
41 36 23 39 40 syl3anc
 |-  ( K e. NN0 -> ( ( ( ( 4 x. K ) x. 2 ) + 2 ) / 2 ) = ( ( ( ( 4 x. K ) x. 2 ) / 2 ) + ( 2 / 2 ) ) )
42 2ne0
 |-  2 =/= 0
43 42 a1i
 |-  ( K e. NN0 -> 2 =/= 0 )
44 35 23 43 divcan4d
 |-  ( K e. NN0 -> ( ( ( 4 x. K ) x. 2 ) / 2 ) = ( 4 x. K ) )
45 2div2e1
 |-  ( 2 / 2 ) = 1
46 45 a1i
 |-  ( K e. NN0 -> ( 2 / 2 ) = 1 )
47 44 46 oveq12d
 |-  ( K e. NN0 -> ( ( ( ( 4 x. K ) x. 2 ) / 2 ) + ( 2 / 2 ) ) = ( ( 4 x. K ) + 1 ) )
48 31 41 47 3eqtrd
 |-  ( K e. NN0 -> ( ( ( ( 8 x. K ) + 3 ) - 1 ) / 2 ) = ( ( 4 x. K ) + 1 ) )
49 4ne0
 |-  4 =/= 0
50 20 49 pm3.2i
 |-  ( 4 e. CC /\ 4 =/= 0 )
51 50 a1i
 |-  ( K e. NN0 -> ( 4 e. CC /\ 4 =/= 0 ) )
52 divdir
 |-  ( ( ( 8 x. K ) e. CC /\ 3 e. CC /\ ( 4 e. CC /\ 4 =/= 0 ) ) -> ( ( ( 8 x. K ) + 3 ) / 4 ) = ( ( ( 8 x. K ) / 4 ) + ( 3 / 4 ) ) )
53 11 13 51 52 syl3anc
 |-  ( K e. NN0 -> ( ( ( 8 x. K ) + 3 ) / 4 ) = ( ( ( 8 x. K ) / 4 ) + ( 3 / 4 ) ) )
54 8cn
 |-  8 e. CC
55 54 a1i
 |-  ( K e. NN0 -> 8 e. CC )
56 div23
 |-  ( ( 8 e. CC /\ K e. CC /\ ( 4 e. CC /\ 4 =/= 0 ) ) -> ( ( 8 x. K ) / 4 ) = ( ( 8 / 4 ) x. K ) )
57 55 24 51 56 syl3anc
 |-  ( K e. NN0 -> ( ( 8 x. K ) / 4 ) = ( ( 8 / 4 ) x. K ) )
58 17 oveq1i
 |-  ( 8 / 4 ) = ( ( 4 x. 2 ) / 4 )
59 22 20 49 divcan3i
 |-  ( ( 4 x. 2 ) / 4 ) = 2
60 58 59 eqtri
 |-  ( 8 / 4 ) = 2
61 60 a1i
 |-  ( K e. NN0 -> ( 8 / 4 ) = 2 )
62 61 oveq1d
 |-  ( K e. NN0 -> ( ( 8 / 4 ) x. K ) = ( 2 x. K ) )
63 57 62 eqtrd
 |-  ( K e. NN0 -> ( ( 8 x. K ) / 4 ) = ( 2 x. K ) )
64 63 oveq1d
 |-  ( K e. NN0 -> ( ( ( 8 x. K ) / 4 ) + ( 3 / 4 ) ) = ( ( 2 x. K ) + ( 3 / 4 ) ) )
65 53 64 eqtrd
 |-  ( K e. NN0 -> ( ( ( 8 x. K ) + 3 ) / 4 ) = ( ( 2 x. K ) + ( 3 / 4 ) ) )
66 65 fveq2d
 |-  ( K e. NN0 -> ( |_ ` ( ( ( 8 x. K ) + 3 ) / 4 ) ) = ( |_ ` ( ( 2 x. K ) + ( 3 / 4 ) ) ) )
67 3lt4
 |-  3 < 4
68 2nn0
 |-  2 e. NN0
69 68 a1i
 |-  ( K e. NN0 -> 2 e. NN0 )
70 69 9 nn0mulcld
 |-  ( K e. NN0 -> ( 2 x. K ) e. NN0 )
71 70 nn0zd
 |-  ( K e. NN0 -> ( 2 x. K ) e. ZZ )
72 3nn0
 |-  3 e. NN0
73 72 a1i
 |-  ( K e. NN0 -> 3 e. NN0 )
74 4nn
 |-  4 e. NN
75 74 a1i
 |-  ( K e. NN0 -> 4 e. NN )
76 adddivflid
 |-  ( ( ( 2 x. K ) e. ZZ /\ 3 e. NN0 /\ 4 e. NN ) -> ( 3 < 4 <-> ( |_ ` ( ( 2 x. K ) + ( 3 / 4 ) ) ) = ( 2 x. K ) ) )
77 71 73 75 76 syl3anc
 |-  ( K e. NN0 -> ( 3 < 4 <-> ( |_ ` ( ( 2 x. K ) + ( 3 / 4 ) ) ) = ( 2 x. K ) ) )
78 67 77 mpbii
 |-  ( K e. NN0 -> ( |_ ` ( ( 2 x. K ) + ( 3 / 4 ) ) ) = ( 2 x. K ) )
79 66 78 eqtrd
 |-  ( K e. NN0 -> ( |_ ` ( ( ( 8 x. K ) + 3 ) / 4 ) ) = ( 2 x. K ) )
80 48 79 oveq12d
 |-  ( K e. NN0 -> ( ( ( ( ( 8 x. K ) + 3 ) - 1 ) / 2 ) - ( |_ ` ( ( ( 8 x. K ) + 3 ) / 4 ) ) ) = ( ( ( 4 x. K ) + 1 ) - ( 2 x. K ) ) )
81 70 nn0cnd
 |-  ( K e. NN0 -> ( 2 x. K ) e. CC )
82 35 14 81 addsubd
 |-  ( K e. NN0 -> ( ( ( 4 x. K ) + 1 ) - ( 2 x. K ) ) = ( ( ( 4 x. K ) - ( 2 x. K ) ) + 1 ) )
83 2t2e4
 |-  ( 2 x. 2 ) = 4
84 83 eqcomi
 |-  4 = ( 2 x. 2 )
85 84 a1i
 |-  ( K e. NN0 -> 4 = ( 2 x. 2 ) )
86 85 oveq1d
 |-  ( K e. NN0 -> ( 4 x. K ) = ( ( 2 x. 2 ) x. K ) )
87 23 23 24 mulassd
 |-  ( K e. NN0 -> ( ( 2 x. 2 ) x. K ) = ( 2 x. ( 2 x. K ) ) )
88 86 87 eqtrd
 |-  ( K e. NN0 -> ( 4 x. K ) = ( 2 x. ( 2 x. K ) ) )
89 88 oveq1d
 |-  ( K e. NN0 -> ( ( 4 x. K ) - ( 2 x. K ) ) = ( ( 2 x. ( 2 x. K ) ) - ( 2 x. K ) ) )
90 2txmxeqx
 |-  ( ( 2 x. K ) e. CC -> ( ( 2 x. ( 2 x. K ) ) - ( 2 x. K ) ) = ( 2 x. K ) )
91 81 90 syl
 |-  ( K e. NN0 -> ( ( 2 x. ( 2 x. K ) ) - ( 2 x. K ) ) = ( 2 x. K ) )
92 89 91 eqtrd
 |-  ( K e. NN0 -> ( ( 4 x. K ) - ( 2 x. K ) ) = ( 2 x. K ) )
93 92 oveq1d
 |-  ( K e. NN0 -> ( ( ( 4 x. K ) - ( 2 x. K ) ) + 1 ) = ( ( 2 x. K ) + 1 ) )
94 80 82 93 3eqtrd
 |-  ( K e. NN0 -> ( ( ( ( ( 8 x. K ) + 3 ) - 1 ) / 2 ) - ( |_ ` ( ( ( 8 x. K ) + 3 ) / 4 ) ) ) = ( ( 2 x. K ) + 1 ) )
95 6 94 sylan9eqr
 |-  ( ( K e. NN0 /\ P = ( ( 8 x. K ) + 3 ) ) -> N = ( ( 2 x. K ) + 1 ) )