Metamath Proof Explorer < Previous   Next > Nearby theorems Mirrors  >  Home  >  MPE Home  >  Th. List  >  smumullem Structured version   Visualization version   GIF version

Theorem smumullem 15892
 Description: Lemma for smumul 15893. (Contributed by Mario Carneiro, 22-Sep-2016.)
Hypotheses
Ref Expression
smumullem.a (𝜑𝐴 ∈ ℤ)
smumullem.b (𝜑𝐵 ∈ ℤ)
smumullem.n (𝜑𝑁 ∈ ℕ0)
Assertion
Ref Expression
smumullem (𝜑 → (((bits‘𝐴) ∩ (0..^𝑁)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑁)) · 𝐵)))

Proof of Theorem smumullem
Dummy variables 𝑘 𝑛 𝑥 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 smumullem.n . 2 (𝜑𝑁 ∈ ℕ0)
2 oveq2 7159 . . . . . . . . . 10 (𝑥 = 0 → (0..^𝑥) = (0..^0))
3 fzo0 13111 . . . . . . . . . 10 (0..^0) = ∅
42, 3eqtrdi 2810 . . . . . . . . 9 (𝑥 = 0 → (0..^𝑥) = ∅)
54ineq2d 4118 . . . . . . . 8 (𝑥 = 0 → ((bits‘𝐴) ∩ (0..^𝑥)) = ((bits‘𝐴) ∩ ∅))
6 in0 4288 . . . . . . . 8 ((bits‘𝐴) ∩ ∅) = ∅
75, 6eqtrdi 2810 . . . . . . 7 (𝑥 = 0 → ((bits‘𝐴) ∩ (0..^𝑥)) = ∅)
87oveq1d 7166 . . . . . 6 (𝑥 = 0 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (∅ smul (bits‘𝐵)))
9 bitsss 15826 . . . . . . 7 (bits‘𝐵) ⊆ ℕ0
10 smu02 15887 . . . . . . 7 ((bits‘𝐵) ⊆ ℕ0 → (∅ smul (bits‘𝐵)) = ∅)
119, 10ax-mp 5 . . . . . 6 (∅ smul (bits‘𝐵)) = ∅
128, 11eqtrdi 2810 . . . . 5 (𝑥 = 0 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = ∅)
13 oveq2 7159 . . . . . . . 8 (𝑥 = 0 → (2↑𝑥) = (2↑0))
14 2cn 11750 . . . . . . . . 9 2 ∈ ℂ
15 exp0 13484 . . . . . . . . 9 (2 ∈ ℂ → (2↑0) = 1)
1614, 15ax-mp 5 . . . . . . . 8 (2↑0) = 1
1713, 16eqtrdi 2810 . . . . . . 7 (𝑥 = 0 → (2↑𝑥) = 1)
1817oveq2d 7167 . . . . . 6 (𝑥 = 0 → (𝐴 mod (2↑𝑥)) = (𝐴 mod 1))
1918fvoveq1d 7173 . . . . 5 (𝑥 = 0 → (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) = (bits‘((𝐴 mod 1) · 𝐵)))
2012, 19eqeq12d 2775 . . . 4 (𝑥 = 0 → ((((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) ↔ ∅ = (bits‘((𝐴 mod 1) · 𝐵))))
2120imbi2d 345 . . 3 (𝑥 = 0 → ((𝜑 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵))) ↔ (𝜑 → ∅ = (bits‘((𝐴 mod 1) · 𝐵)))))
22 oveq2 7159 . . . . . . 7 (𝑥 = 𝑘 → (0..^𝑥) = (0..^𝑘))
2322ineq2d 4118 . . . . . 6 (𝑥 = 𝑘 → ((bits‘𝐴) ∩ (0..^𝑥)) = ((bits‘𝐴) ∩ (0..^𝑘)))
2423oveq1d 7166 . . . . 5 (𝑥 = 𝑘 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)))
25 oveq2 7159 . . . . . . 7 (𝑥 = 𝑘 → (2↑𝑥) = (2↑𝑘))
2625oveq2d 7167 . . . . . 6 (𝑥 = 𝑘 → (𝐴 mod (2↑𝑥)) = (𝐴 mod (2↑𝑘)))
2726fvoveq1d 7173 . . . . 5 (𝑥 = 𝑘 → (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) = (bits‘((𝐴 mod (2↑𝑘)) · 𝐵)))
2824, 27eqeq12d 2775 . . . 4 (𝑥 = 𝑘 → ((((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) ↔ (((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑘)) · 𝐵))))
2928imbi2d 345 . . 3 (𝑥 = 𝑘 → ((𝜑 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵))) ↔ (𝜑 → (((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑘)) · 𝐵)))))
30 oveq2 7159 . . . . . . 7 (𝑥 = (𝑘 + 1) → (0..^𝑥) = (0..^(𝑘 + 1)))
3130ineq2d 4118 . . . . . 6 (𝑥 = (𝑘 + 1) → ((bits‘𝐴) ∩ (0..^𝑥)) = ((bits‘𝐴) ∩ (0..^(𝑘 + 1))))
3231oveq1d 7166 . . . . 5 (𝑥 = (𝑘 + 1) → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)))
33 oveq2 7159 . . . . . . 7 (𝑥 = (𝑘 + 1) → (2↑𝑥) = (2↑(𝑘 + 1)))
3433oveq2d 7167 . . . . . 6 (𝑥 = (𝑘 + 1) → (𝐴 mod (2↑𝑥)) = (𝐴 mod (2↑(𝑘 + 1))))
3534fvoveq1d 7173 . . . . 5 (𝑥 = (𝑘 + 1) → (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) = (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵)))
3632, 35eqeq12d 2775 . . . 4 (𝑥 = (𝑘 + 1) → ((((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) ↔ (((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵))))
3736imbi2d 345 . . 3 (𝑥 = (𝑘 + 1) → ((𝜑 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵))) ↔ (𝜑 → (((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵)))))
38 oveq2 7159 . . . . . . 7 (𝑥 = 𝑁 → (0..^𝑥) = (0..^𝑁))
3938ineq2d 4118 . . . . . 6 (𝑥 = 𝑁 → ((bits‘𝐴) ∩ (0..^𝑥)) = ((bits‘𝐴) ∩ (0..^𝑁)))
4039oveq1d 7166 . . . . 5 (𝑥 = 𝑁 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (((bits‘𝐴) ∩ (0..^𝑁)) smul (bits‘𝐵)))
41 oveq2 7159 . . . . . . 7 (𝑥 = 𝑁 → (2↑𝑥) = (2↑𝑁))
4241oveq2d 7167 . . . . . 6 (𝑥 = 𝑁 → (𝐴 mod (2↑𝑥)) = (𝐴 mod (2↑𝑁)))
4342fvoveq1d 7173 . . . . 5 (𝑥 = 𝑁 → (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) = (bits‘((𝐴 mod (2↑𝑁)) · 𝐵)))
4440, 43eqeq12d 2775 . . . 4 (𝑥 = 𝑁 → ((((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵)) ↔ (((bits‘𝐴) ∩ (0..^𝑁)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑁)) · 𝐵))))
4544imbi2d 345 . . 3 (𝑥 = 𝑁 → ((𝜑 → (((bits‘𝐴) ∩ (0..^𝑥)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑥)) · 𝐵))) ↔ (𝜑 → (((bits‘𝐴) ∩ (0..^𝑁)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑁)) · 𝐵)))))
46 smumullem.a . . . . . . . 8 (𝜑𝐴 ∈ ℤ)
47 zmod10 13305 . . . . . . . 8 (𝐴 ∈ ℤ → (𝐴 mod 1) = 0)
4846, 47syl 17 . . . . . . 7 (𝜑 → (𝐴 mod 1) = 0)
4948oveq1d 7166 . . . . . 6 (𝜑 → ((𝐴 mod 1) · 𝐵) = (0 · 𝐵))
50 smumullem.b . . . . . . . 8 (𝜑𝐵 ∈ ℤ)
5150zcnd 12128 . . . . . . 7 (𝜑𝐵 ∈ ℂ)
5251mul02d 10877 . . . . . 6 (𝜑 → (0 · 𝐵) = 0)
5349, 52eqtrd 2794 . . . . 5 (𝜑 → ((𝐴 mod 1) · 𝐵) = 0)
5453fveq2d 6663 . . . 4 (𝜑 → (bits‘((𝐴 mod 1) · 𝐵)) = (bits‘0))
55 0bits 15839 . . . 4 (bits‘0) = ∅
5654, 55eqtr2di 2811 . . 3 (𝜑 → ∅ = (bits‘((𝐴 mod 1) · 𝐵)))
57 oveq1 7158 . . . . . 6 ((((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) → ((((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) sadd {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}) = ((bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) sadd {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}))
58 bitsss 15826 . . . . . . . . 9 (bits‘𝐴) ⊆ ℕ0
5958a1i 11 . . . . . . . 8 ((𝜑𝑘 ∈ ℕ0) → (bits‘𝐴) ⊆ ℕ0)
609a1i 11 . . . . . . . 8 ((𝜑𝑘 ∈ ℕ0) → (bits‘𝐵) ⊆ ℕ0)
61 simpr 489 . . . . . . . 8 ((𝜑𝑘 ∈ ℕ0) → 𝑘 ∈ ℕ0)
6259, 60, 61smup1 15889 . . . . . . 7 ((𝜑𝑘 ∈ ℕ0) → (((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)) = ((((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) sadd {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}))
63 bitsinv1lem 15841 . . . . . . . . . . . 12 ((𝐴 ∈ ℤ ∧ 𝑘 ∈ ℕ0) → (𝐴 mod (2↑(𝑘 + 1))) = ((𝐴 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))
6446, 63sylan 584 . . . . . . . . . . 11 ((𝜑𝑘 ∈ ℕ0) → (𝐴 mod (2↑(𝑘 + 1))) = ((𝐴 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))
6564oveq1d 7166 . . . . . . . . . 10 ((𝜑𝑘 ∈ ℕ0) → ((𝐴 mod (2↑(𝑘 + 1))) · 𝐵) = (((𝐴 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)) · 𝐵))
6646adantr 485 . . . . . . . . . . . . 13 ((𝜑𝑘 ∈ ℕ0) → 𝐴 ∈ ℤ)
67 2nn 11748 . . . . . . . . . . . . . . 15 2 ∈ ℕ
6867a1i 11 . . . . . . . . . . . . . 14 ((𝜑𝑘 ∈ ℕ0) → 2 ∈ ℕ)
6968, 61nnexpcld 13657 . . . . . . . . . . . . 13 ((𝜑𝑘 ∈ ℕ0) → (2↑𝑘) ∈ ℕ)
7066, 69zmodcld 13310 . . . . . . . . . . . 12 ((𝜑𝑘 ∈ ℕ0) → (𝐴 mod (2↑𝑘)) ∈ ℕ0)
7170nn0cnd 11997 . . . . . . . . . . 11 ((𝜑𝑘 ∈ ℕ0) → (𝐴 mod (2↑𝑘)) ∈ ℂ)
7269nnnn0d 11995 . . . . . . . . . . . . 13 ((𝜑𝑘 ∈ ℕ0) → (2↑𝑘) ∈ ℕ0)
73 0nn0 11950 . . . . . . . . . . . . 13 0 ∈ ℕ0
74 ifcl 4466 . . . . . . . . . . . . 13 (((2↑𝑘) ∈ ℕ0 ∧ 0 ∈ ℕ0) → if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) ∈ ℕ0)
7572, 73, 74sylancl 590 . . . . . . . . . . . 12 ((𝜑𝑘 ∈ ℕ0) → if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) ∈ ℕ0)
7675nn0cnd 11997 . . . . . . . . . . 11 ((𝜑𝑘 ∈ ℕ0) → if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) ∈ ℂ)
7751adantr 485 . . . . . . . . . . 11 ((𝜑𝑘 ∈ ℕ0) → 𝐵 ∈ ℂ)
7871, 76, 77adddird 10705 . . . . . . . . . 10 ((𝜑𝑘 ∈ ℕ0) → (((𝐴 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)) · 𝐵) = (((𝐴 mod (2↑𝑘)) · 𝐵) + (if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) · 𝐵)))
7976, 77mulcomd 10701 . . . . . . . . . . 11 ((𝜑𝑘 ∈ ℕ0) → (if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) · 𝐵) = (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))
8079oveq2d 7167 . . . . . . . . . 10 ((𝜑𝑘 ∈ ℕ0) → (((𝐴 mod (2↑𝑘)) · 𝐵) + (if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) · 𝐵)) = (((𝐴 mod (2↑𝑘)) · 𝐵) + (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0))))
8165, 78, 803eqtrd 2798 . . . . . . . . 9 ((𝜑𝑘 ∈ ℕ0) → ((𝐴 mod (2↑(𝑘 + 1))) · 𝐵) = (((𝐴 mod (2↑𝑘)) · 𝐵) + (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0))))
8281fveq2d 6663 . . . . . . . 8 ((𝜑𝑘 ∈ ℕ0) → (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵)) = (bits‘(((𝐴 mod (2↑𝑘)) · 𝐵) + (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))))
8370nn0zd 12125 . . . . . . . . . 10 ((𝜑𝑘 ∈ ℕ0) → (𝐴 mod (2↑𝑘)) ∈ ℤ)
8450adantr 485 . . . . . . . . . 10 ((𝜑𝑘 ∈ ℕ0) → 𝐵 ∈ ℤ)
8583, 84zmulcld 12133 . . . . . . . . 9 ((𝜑𝑘 ∈ ℕ0) → ((𝐴 mod (2↑𝑘)) · 𝐵) ∈ ℤ)
8675nn0zd 12125 . . . . . . . . . 10 ((𝜑𝑘 ∈ ℕ0) → if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) ∈ ℤ)
8784, 86zmulcld 12133 . . . . . . . . 9 ((𝜑𝑘 ∈ ℕ0) → (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)) ∈ ℤ)
88 sadadd 15867 . . . . . . . . 9 ((((𝐴 mod (2↑𝑘)) · 𝐵) ∈ ℤ ∧ (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)) ∈ ℤ) → ((bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) sadd (bits‘(𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))) = (bits‘(((𝐴 mod (2↑𝑘)) · 𝐵) + (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))))
8985, 87, 88syl2anc 588 . . . . . . . 8 ((𝜑𝑘 ∈ ℕ0) → ((bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) sadd (bits‘(𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))) = (bits‘(((𝐴 mod (2↑𝑘)) · 𝐵) + (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))))
90 oveq2 7159 . . . . . . . . . . 11 ((2↑𝑘) = if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) → (𝐵 · (2↑𝑘)) = (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))
9190fveqeq2d 6667 . . . . . . . . . 10 ((2↑𝑘) = if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) → ((bits‘(𝐵 · (2↑𝑘))) = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))} ↔ (bits‘(𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0))) = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}))
92 oveq2 7159 . . . . . . . . . . 11 (0 = if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) → (𝐵 · 0) = (𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))
9392fveqeq2d 6667 . . . . . . . . . 10 (0 = if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0) → ((bits‘(𝐵 · 0)) = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))} ↔ (bits‘(𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0))) = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}))
94 bitsshft 15875 . . . . . . . . . . . 12 ((𝐵 ∈ ℤ ∧ 𝑘 ∈ ℕ0) → {𝑛 ∈ ℕ0 ∣ (𝑛𝑘) ∈ (bits‘𝐵)} = (bits‘(𝐵 · (2↑𝑘))))
9550, 94sylan 584 . . . . . . . . . . 11 ((𝜑𝑘 ∈ ℕ0) → {𝑛 ∈ ℕ0 ∣ (𝑛𝑘) ∈ (bits‘𝐵)} = (bits‘(𝐵 · (2↑𝑘))))
96 ibar 533 . . . . . . . . . . . 12 (𝑘 ∈ (bits‘𝐴) → ((𝑛𝑘) ∈ (bits‘𝐵) ↔ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))))
9796rabbidv 3393 . . . . . . . . . . 11 (𝑘 ∈ (bits‘𝐴) → {𝑛 ∈ ℕ0 ∣ (𝑛𝑘) ∈ (bits‘𝐵)} = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))})
9895, 97sylan9req 2815 . . . . . . . . . 10 (((𝜑𝑘 ∈ ℕ0) ∧ 𝑘 ∈ (bits‘𝐴)) → (bits‘(𝐵 · (2↑𝑘))) = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))})
9977adantr 485 . . . . . . . . . . . . 13 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → 𝐵 ∈ ℂ)
10099mul01d 10878 . . . . . . . . . . . 12 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → (𝐵 · 0) = 0)
101100fveq2d 6663 . . . . . . . . . . 11 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → (bits‘(𝐵 · 0)) = (bits‘0))
102 simpr 489 . . . . . . . . . . . . . 14 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → ¬ 𝑘 ∈ (bits‘𝐴))
103102intnanrd 494 . . . . . . . . . . . . 13 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → ¬ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵)))
104103ralrimivw 3115 . . . . . . . . . . . 12 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → ∀𝑛 ∈ ℕ0 ¬ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵)))
105 rabeq0 4281 . . . . . . . . . . . 12 ({𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))} = ∅ ↔ ∀𝑛 ∈ ℕ0 ¬ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵)))
106104, 105sylibr 237 . . . . . . . . . . 11 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))} = ∅)
10755, 101, 1063eqtr4a 2820 . . . . . . . . . 10 (((𝜑𝑘 ∈ ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝐴)) → (bits‘(𝐵 · 0)) = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))})
10891, 93, 98, 107ifbothda 4459 . . . . . . . . 9 ((𝜑𝑘 ∈ ℕ0) → (bits‘(𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0))) = {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))})
109108oveq2d 7167 . . . . . . . 8 ((𝜑𝑘 ∈ ℕ0) → ((bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) sadd (bits‘(𝐵 · if(𝑘 ∈ (bits‘𝐴), (2↑𝑘), 0)))) = ((bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) sadd {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}))
11082, 89, 1093eqtr2d 2800 . . . . . . 7 ((𝜑𝑘 ∈ ℕ0) → (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵)) = ((bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) sadd {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}))
11162, 110eqeq12d 2775 . . . . . 6 ((𝜑𝑘 ∈ ℕ0) → ((((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵)) ↔ ((((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) sadd {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))}) = ((bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) sadd {𝑛 ∈ ℕ0 ∣ (𝑘 ∈ (bits‘𝐴) ∧ (𝑛𝑘) ∈ (bits‘𝐵))})))
11257, 111syl5ibr 249 . . . . 5 ((𝜑𝑘 ∈ ℕ0) → ((((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) → (((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵))))
113112expcom 418 . . . 4 (𝑘 ∈ ℕ0 → (𝜑 → ((((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑘)) · 𝐵)) → (((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵)))))
114113a2d 29 . . 3 (𝑘 ∈ ℕ0 → ((𝜑 → (((bits‘𝐴) ∩ (0..^𝑘)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑘)) · 𝐵))) → (𝜑 → (((bits‘𝐴) ∩ (0..^(𝑘 + 1))) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑(𝑘 + 1))) · 𝐵)))))
11521, 29, 37, 45, 56, 114nn0ind 12117 . 2 (𝑁 ∈ ℕ0 → (𝜑 → (((bits‘𝐴) ∩ (0..^𝑁)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑁)) · 𝐵))))
1161, 115mpcom 38 1 (𝜑 → (((bits‘𝐴) ∩ (0..^𝑁)) smul (bits‘𝐵)) = (bits‘((𝐴 mod (2↑𝑁)) · 𝐵)))