Metamath Proof Explorer


Theorem smndex2dlinvh

Description: The halving functions H are left inverses of the doubling function D . (Contributed by AV, 18-Feb-2024)

Ref Expression
Hypotheses smndex2dbas.m ⊢ M = EndoFMnd ⁡ ℕ 0
smndex2dbas.b ⊢ B = Base M
smndex2dbas.0 ⊢ 0 ˙ = 0 M
smndex2dbas.d ⊢ D = x ∈ ℕ 0 ⟼ 2 ⁢ x
smndex2hbas.n ⊢ N ∈ ℕ 0
smndex2hbas.h ⊢ H = x ∈ ℕ 0 ⟼ if 2 ∥ x x 2 N
Assertion smndex2dlinvh ⊢ H ∘ D = 0 ˙

Proof

Step Hyp Ref Expression
1 smndex2dbas.m ⊢ M = EndoFMnd ⁡ ℕ 0
2 smndex2dbas.b ⊢ B = Base M
3 smndex2dbas.0 ⊢ 0 ˙ = 0 M
4 smndex2dbas.d ⊢ D = x ∈ ℕ 0 ⟼ 2 ⁢ x
5 smndex2hbas.n ⊢ N ∈ ℕ 0
6 smndex2hbas.h ⊢ H = x ∈ ℕ 0 ⟼ if 2 ∥ x x 2 N
7 2nn0 ⊢ 2 ∈ ℕ 0
8 nn0mulcl ⊢ 2 ∈ ℕ 0 ∧ y ∈ ℕ 0 → 2 ⁢ y ∈ ℕ 0
9 oveq2 ⊢ x = y → 2 ⁢ x = 2 ⁢ y
10 9 cbvmptv ⊢ x ∈ ℕ 0 ⟼ 2 ⁢ x = y ∈ ℕ 0 ⟼ 2 ⁢ y
11 4 10 eqtri ⊢ D = y ∈ ℕ 0 ⟼ 2 ⁢ y
12 11 a1i ⊢ 2 ∈ ℕ 0 → D = y ∈ ℕ 0 ⟼ 2 ⁢ y
13 6 a1i ⊢ 2 ∈ ℕ 0 → H = x ∈ ℕ 0 ⟼ if 2 ∥ x x 2 N
14 breq2 ⊢ x = 2 ⁢ y → 2 ∥ x ↔ 2 ∥ 2 ⁢ y
15 oveq1 ⊢ x = 2 ⁢ y → x 2 = 2 ⁢ y 2
16 14 15 ifbieq1d ⊢ x = 2 ⁢ y → if 2 ∥ x x 2 N = if 2 ∥ 2 ⁢ y 2 ⁢ y 2 N
17 8 12 13 16 fmptco ⊢ 2 ∈ ℕ 0 → H ∘ D = y ∈ ℕ 0 ⟼ if 2 ∥ 2 ⁢ y 2 ⁢ y 2 N
18 7 17 ax-mp ⊢ H ∘ D = y ∈ ℕ 0 ⟼ if 2 ∥ 2 ⁢ y 2 ⁢ y 2 N
19 nn0z ⊢ y ∈ ℕ 0 → y ∈ ℤ
20 eqidd ⊢ y ∈ ℕ 0 → 2 ⁢ y = 2 ⁢ y
21 2teven ⊢ y ∈ ℤ ∧ 2 ⁢ y = 2 ⁢ y → 2 ∥ 2 ⁢ y
22 19 20 21 syl2anc ⊢ y ∈ ℕ 0 → 2 ∥ 2 ⁢ y
23 22 iftrued ⊢ y ∈ ℕ 0 → if 2 ∥ 2 ⁢ y 2 ⁢ y 2 N = 2 ⁢ y 2
24 23 mpteq2ia ⊢ y ∈ ℕ 0 ⟼ if 2 ∥ 2 ⁢ y 2 ⁢ y 2 N = y ∈ ℕ 0 ⟼ 2 ⁢ y 2
25 nn0cn ⊢ y ∈ ℕ 0 → y ∈ ℂ
26 2cnd ⊢ y ∈ ℕ 0 → 2 ∈ ℂ
27 2ne0 ⊢ 2 ≠ 0
28 27 a1i ⊢ y ∈ ℕ 0 → 2 ≠ 0
29 25 26 28 divcan3d ⊢ y ∈ ℕ 0 → 2 ⁢ y 2 = y
30 29 mpteq2ia ⊢ y ∈ ℕ 0 ⟼ 2 ⁢ y 2 = y ∈ ℕ 0 ⟼ y
31 nn0ex ⊢ ℕ 0 ∈ V
32 1 efmndid ⊢ ℕ 0 ∈ V → I ↾ ℕ 0 = 0 M
33 31 32 ax-mp ⊢ I ↾ ℕ 0 = 0 M
34 mptresid ⊢ I ↾ ℕ 0 = y ∈ ℕ 0 ⟼ y
35 3 33 34 3eqtr2ri ⊢ y ∈ ℕ 0 ⟼ y = 0 ˙
36 30 35 eqtri ⊢ y ∈ ℕ 0 ⟼ 2 ⁢ y 2 = 0 ˙
37 24 36 eqtri ⊢ y ∈ ℕ 0 ⟼ if 2 ∥ 2 ⁢ y 2 ⁢ y 2 N = 0 ˙
38 18 37 eqtri ⊢ H ∘ D = 0 ˙