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

Hypotheses
Ref Expression
sadval.c 𝐶 = seq0((𝑐 ∈ 2𝑜, 𝑚 ∈ ℕ0 ↦ if(cadd(𝑚𝐴, 𝑚𝐵, ∅ ∈ 𝑐), 1𝑜, ∅)), (𝑛 ∈ ℕ0 ↦ if(𝑛 = 0, ∅, (𝑛 − 1))))
sadadd2lem.1 (𝜑 → ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)) = ((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))))
Assertion
Ref Expression
sadadd2lem (𝜑 → ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^(𝑁 + 1)))) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) = ((𝐾‘(𝐴 ∩ (0..^(𝑁 + 1)))) + (𝐾‘(𝐵 ∩ (0..^(𝑁 + 1))))))
Distinct variable groups:   𝑚,𝑐,𝑛   𝐴,𝑐,𝑚   𝐵,𝑐,𝑚   𝑛,𝑁
Allowed substitution hints:   𝜑(𝑚,𝑛,𝑐)   𝐴(𝑛)   𝐵(𝑛)   𝐶(𝑚,𝑛,𝑐)   𝐾(𝑚,𝑛,𝑐)   𝑁(𝑚,𝑐)

Dummy variable 𝑘 is distinct from all other variables.
StepHypRef Expression
1 inss1 3866 . . . . . . . . 9 ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ⊆ (𝐴 sadd 𝐵)
2 sadval.a . . . . . . . . . . 11 (𝜑𝐴 ⊆ ℕ0)
3 sadval.b . . . . . . . . . . 11 (𝜑𝐵 ⊆ ℕ0)
4 sadval.c . . . . . . . . . . 11 𝐶 = seq0((𝑐 ∈ 2𝑜, 𝑚 ∈ ℕ0 ↦ if(cadd(𝑚𝐴, 𝑚𝐵, ∅ ∈ 𝑐), 1𝑜, ∅)), (𝑛 ∈ ℕ0 ↦ if(𝑛 = 0, ∅, (𝑛 − 1))))
52, 3, 4sadfval 15221 . . . . . . . . . 10 (𝜑 → (𝐴 sadd 𝐵) = {𝑘 ∈ ℕ0 ∣ hadd(𝑘𝐴, 𝑘𝐵, ∅ ∈ (𝐶𝑘))})
6 ssrab2 3720 . . . . . . . . . 10 {𝑘 ∈ ℕ0 ∣ hadd(𝑘𝐴, 𝑘𝐵, ∅ ∈ (𝐶𝑘))} ⊆ ℕ0
75, 6syl6eqss 3688 . . . . . . . . 9 (𝜑 → (𝐴 sadd 𝐵) ⊆ ℕ0)
81, 7syl5ss 3647 . . . . . . . 8 (𝜑 → ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ⊆ ℕ0)
9 fzofi 12813 . . . . . . . . . 10 (0..^𝑁) ∈ Fin
109a1i 11 . . . . . . . . 9 (𝜑 → (0..^𝑁) ∈ Fin)
11 inss2 3867 . . . . . . . . 9 ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ⊆ (0..^𝑁)
12 ssfi 8221 . . . . . . . . 9 (((0..^𝑁) ∈ Fin ∧ ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ⊆ (0..^𝑁)) → ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ∈ Fin)
1310, 11, 12sylancl 695 . . . . . . . 8 (𝜑 → ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ∈ Fin)
14 elfpw 8309 . . . . . . . 8 (((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin) ↔ (((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ⊆ ℕ0 ∧ ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ∈ Fin))
158, 13, 14sylanbrc 699 . . . . . . 7 (𝜑 → ((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin))
16 bitsf1o 15214 . . . . . . . . . 10 (bits ↾ ℕ0):ℕ01-1-onto→(𝒫 ℕ0 ∩ Fin)
17 f1ocnv 6187 . . . . . . . . . 10 ((bits ↾ ℕ0):ℕ01-1-onto→(𝒫 ℕ0 ∩ Fin) → (bits ↾ ℕ0):(𝒫 ℕ0 ∩ Fin)–1-1-onto→ℕ0)
18 f1of 6175 . . . . . . . . . 10 ((bits ↾ ℕ0):(𝒫 ℕ0 ∩ Fin)–1-1-onto→ℕ0(bits ↾ ℕ0):(𝒫 ℕ0 ∩ Fin)⟶ℕ0)
1916, 17, 18mp2b 10 . . . . . . . . 9 (bits ↾ ℕ0):(𝒫 ℕ0 ∩ Fin)⟶ℕ0
20 sadcadd.k . . . . . . . . . 10 𝐾 = (bits ↾ ℕ0)
2120feq1i 6074 . . . . . . . . 9 (𝐾:(𝒫 ℕ0 ∩ Fin)⟶ℕ0(bits ↾ ℕ0):(𝒫 ℕ0 ∩ Fin)⟶ℕ0)
2219, 21mpbir 221 . . . . . . . 8 𝐾:(𝒫 ℕ0 ∩ Fin)⟶ℕ0
2322ffvelrni 6398 . . . . . . 7 (((𝐴 sadd 𝐵) ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin) → (𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) ∈ ℕ0)
2415, 23syl 17 . . . . . 6 (𝜑 → (𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) ∈ ℕ0)
2524nn0cnd 11391 . . . . 5 (𝜑 → (𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) ∈ ℂ)
26 2nn0 11347 . . . . . . . . . 10 2 ∈ ℕ0
2726a1i 11 . . . . . . . . 9 (𝜑 → 2 ∈ ℕ0)
28 sadcp1.n . . . . . . . . 9 (𝜑𝑁 ∈ ℕ0)
2927, 28nn0expcld 13071 . . . . . . . 8 (𝜑 → (2↑𝑁) ∈ ℕ0)
30 0nn0 11345 . . . . . . . 8 0 ∈ ℕ0
31 ifcl 4163 . . . . . . . 8 (((2↑𝑁) ∈ ℕ0 ∧ 0 ∈ ℕ0) → if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) ∈ ℕ0)
3229, 30, 31sylancl 695 . . . . . . 7 (𝜑 → if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) ∈ ℕ0)
3332nn0cnd 11391 . . . . . 6 (𝜑 → if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) ∈ ℂ)
34 1nn0 11346 . . . . . . . . . . 11 1 ∈ ℕ0
3534a1i 11 . . . . . . . . . 10 (𝜑 → 1 ∈ ℕ0)
3628, 35nn0addcld 11393 . . . . . . . . 9 (𝜑 → (𝑁 + 1) ∈ ℕ0)
3727, 36nn0expcld 13071 . . . . . . . 8 (𝜑 → (2↑(𝑁 + 1)) ∈ ℕ0)
38 ifcl 4163 . . . . . . . 8 (((2↑(𝑁 + 1)) ∈ ℕ0 ∧ 0 ∈ ℕ0) → if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0) ∈ ℕ0)
3937, 30, 38sylancl 695 . . . . . . 7 (𝜑 → if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0) ∈ ℕ0)
4039nn0cnd 11391 . . . . . 6 (𝜑 → if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0) ∈ ℂ)
4133, 40addcld 10097 . . . . 5 (𝜑 → (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) ∈ ℂ)
4225, 41addcld 10097 . . . 4 (𝜑 → ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0))) ∈ ℂ)
43 inss1 3866 . . . . . . . . . 10 (𝐴 ∩ (0..^𝑁)) ⊆ 𝐴
4443, 2syl5ss 3647 . . . . . . . . 9 (𝜑 → (𝐴 ∩ (0..^𝑁)) ⊆ ℕ0)
45 inss2 3867 . . . . . . . . . 10 (𝐴 ∩ (0..^𝑁)) ⊆ (0..^𝑁)
46 ssfi 8221 . . . . . . . . . 10 (((0..^𝑁) ∈ Fin ∧ (𝐴 ∩ (0..^𝑁)) ⊆ (0..^𝑁)) → (𝐴 ∩ (0..^𝑁)) ∈ Fin)
4710, 45, 46sylancl 695 . . . . . . . . 9 (𝜑 → (𝐴 ∩ (0..^𝑁)) ∈ Fin)
48 elfpw 8309 . . . . . . . . 9 ((𝐴 ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin) ↔ ((𝐴 ∩ (0..^𝑁)) ⊆ ℕ0 ∧ (𝐴 ∩ (0..^𝑁)) ∈ Fin))
4944, 47, 48sylanbrc 699 . . . . . . . 8 (𝜑 → (𝐴 ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin))
5022ffvelrni 6398 . . . . . . . 8 ((𝐴 ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin) → (𝐾‘(𝐴 ∩ (0..^𝑁))) ∈ ℕ0)
5149, 50syl 17 . . . . . . 7 (𝜑 → (𝐾‘(𝐴 ∩ (0..^𝑁))) ∈ ℕ0)
5251nn0cnd 11391 . . . . . 6 (𝜑 → (𝐾‘(𝐴 ∩ (0..^𝑁))) ∈ ℂ)
53 inss1 3866 . . . . . . . . . 10 (𝐵 ∩ (0..^𝑁)) ⊆ 𝐵
5453, 3syl5ss 3647 . . . . . . . . 9 (𝜑 → (𝐵 ∩ (0..^𝑁)) ⊆ ℕ0)
55 inss2 3867 . . . . . . . . . 10 (𝐵 ∩ (0..^𝑁)) ⊆ (0..^𝑁)
56 ssfi 8221 . . . . . . . . . 10 (((0..^𝑁) ∈ Fin ∧ (𝐵 ∩ (0..^𝑁)) ⊆ (0..^𝑁)) → (𝐵 ∩ (0..^𝑁)) ∈ Fin)
5710, 55, 56sylancl 695 . . . . . . . . 9 (𝜑 → (𝐵 ∩ (0..^𝑁)) ∈ Fin)
58 elfpw 8309 . . . . . . . . 9 ((𝐵 ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin) ↔ ((𝐵 ∩ (0..^𝑁)) ⊆ ℕ0 ∧ (𝐵 ∩ (0..^𝑁)) ∈ Fin))
5954, 57, 58sylanbrc 699 . . . . . . . 8 (𝜑 → (𝐵 ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin))
6022ffvelrni 6398 . . . . . . . 8 ((𝐵 ∩ (0..^𝑁)) ∈ (𝒫 ℕ0 ∩ Fin) → (𝐾‘(𝐵 ∩ (0..^𝑁))) ∈ ℕ0)
6159, 60syl 17 . . . . . . 7 (𝜑 → (𝐾‘(𝐵 ∩ (0..^𝑁))) ∈ ℕ0)
6261nn0cnd 11391 . . . . . 6 (𝜑 → (𝐾‘(𝐵 ∩ (0..^𝑁))) ∈ ℂ)
6352, 62addcld 10097 . . . . 5 (𝜑 → ((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) ∈ ℂ)
64 ifcl 4163 . . . . . . . 8 (((2↑𝑁) ∈ ℕ0 ∧ 0 ∈ ℕ0) → if(𝑁𝐴, (2↑𝑁), 0) ∈ ℕ0)
6529, 30, 64sylancl 695 . . . . . . 7 (𝜑 → if(𝑁𝐴, (2↑𝑁), 0) ∈ ℕ0)
6665nn0cnd 11391 . . . . . 6 (𝜑 → if(𝑁𝐴, (2↑𝑁), 0) ∈ ℂ)
67 ifcl 4163 . . . . . . . 8 (((2↑𝑁) ∈ ℕ0 ∧ 0 ∈ ℕ0) → if(𝑁𝐵, (2↑𝑁), 0) ∈ ℕ0)
6829, 30, 67sylancl 695 . . . . . . 7 (𝜑 → if(𝑁𝐵, (2↑𝑁), 0) ∈ ℕ0)
6968nn0cnd 11391 . . . . . 6 (𝜑 → if(𝑁𝐵, (2↑𝑁), 0) ∈ ℂ)
7066, 69addcld 10097 . . . . 5 (𝜑 → (if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0)) ∈ ℂ)
7163, 70addcld 10097 . . . 4 (𝜑 → (((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) + (if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0))) ∈ ℂ)
7229nn0cnd 11391 . . . . . 6 (𝜑 → (2↑𝑁) ∈ ℂ)
7372adantr 480 . . . . 5 ((𝜑 ∧ ∅ ∈ (𝐶𝑁)) → (2↑𝑁) ∈ ℂ)
74 0cnd 10071 . . . . 5 ((𝜑 ∧ ¬ ∅ ∈ (𝐶𝑁)) → 0 ∈ ℂ)
7573, 74ifclda 4153 . . . 4 (𝜑 → if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0) ∈ ℂ)
76 sadadd2lem.1 . . . . . 6 (𝜑 → ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)) = ((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))))
772, 3, 4, 28sadval 15225 . . . . . . . . 9 (𝜑 → (𝑁 ∈ (𝐴 sadd 𝐵) ↔ hadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁))))
7877ifbid 4141 . . . . . . . 8 (𝜑 → if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) = if(hadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2↑𝑁), 0))
792, 3, 4, 28sadcp1 15224 . . . . . . . . 9 (𝜑 → (∅ ∈ (𝐶‘(𝑁 + 1)) ↔ cadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁))))
8027nn0cnd 11391 . . . . . . . . . . 11 (𝜑 → 2 ∈ ℂ)
8180, 28expp1d 13049 . . . . . . . . . 10 (𝜑 → (2↑(𝑁 + 1)) = ((2↑𝑁) · 2))
8272, 80mulcomd 10099 . . . . . . . . . 10 (𝜑 → ((2↑𝑁) · 2) = (2 · (2↑𝑁)))
8381, 82eqtrd 2685 . . . . . . . . 9 (𝜑 → (2↑(𝑁 + 1)) = (2 · (2↑𝑁)))
8479, 83ifbieq1d 4142 . . . . . . . 8 (𝜑 → if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0) = if(cadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2 · (2↑𝑁)), 0))
8578, 84oveq12d 6708 . . . . . . 7 (𝜑 → (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) = (if(hadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2↑𝑁), 0) + if(cadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2 · (2↑𝑁)), 0)))
86 sadadd2lem2 15219 . . . . . . . 8 ((2↑𝑁) ∈ ℂ → (if(hadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2↑𝑁), 0) + if(cadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2 · (2↑𝑁)), 0)) = ((if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0)) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)))
8772, 86syl 17 . . . . . . 7 (𝜑 → (if(hadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2↑𝑁), 0) + if(cadd(𝑁𝐴, 𝑁𝐵, ∅ ∈ (𝐶𝑁)), (2 · (2↑𝑁)), 0)) = ((if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0)) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)))
8885, 87eqtrd 2685 . . . . . 6 (𝜑 → (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) = ((if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0)) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)))
8976, 88oveq12d 6708 . . . . 5 (𝜑 → (((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)) + (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0))) = (((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) + ((if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0)) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0))))
9025, 41, 75add32d 10301 . . . . 5 (𝜑 → (((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)) = (((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)) + (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0))))
9163, 70, 75addassd 10100 . . . . 5 (𝜑 → ((((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) + (if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)) = (((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) + ((if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0)) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0))))
9289, 90, 913eqtr4d 2695 . . . 4 (𝜑 → (((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)) = ((((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) + (if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0))) + if(∅ ∈ (𝐶𝑁), (2↑𝑁), 0)))
9342, 71, 75, 92addcan2ad 10280 . . 3 (𝜑 → ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0))) = (((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) + (if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0))))
9425, 33, 40addassd 10100 . . 3 (𝜑 → (((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0)) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) = ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + (if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0))))
9552, 66, 62, 69add4d 10302 . . 3 (𝜑 → (((𝐾‘(𝐴 ∩ (0..^𝑁))) + if(𝑁𝐴, (2↑𝑁), 0)) + ((𝐾‘(𝐵 ∩ (0..^𝑁))) + if(𝑁𝐵, (2↑𝑁), 0))) = (((𝐾‘(𝐴 ∩ (0..^𝑁))) + (𝐾‘(𝐵 ∩ (0..^𝑁)))) + (if(𝑁𝐴, (2↑𝑁), 0) + if(𝑁𝐵, (2↑𝑁), 0))))
9693, 94, 953eqtr4d 2695 . 2 (𝜑 → (((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0)) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) = (((𝐾‘(𝐴 ∩ (0..^𝑁))) + if(𝑁𝐴, (2↑𝑁), 0)) + ((𝐾‘(𝐵 ∩ (0..^𝑁))) + if(𝑁𝐵, (2↑𝑁), 0))))
9720bitsinvp1 15218 . . . 4 (((𝐴 sadd 𝐵) ⊆ ℕ0𝑁 ∈ ℕ0) → (𝐾‘((𝐴 sadd 𝐵) ∩ (0..^(𝑁 + 1)))) = ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0)))
987, 28, 97syl2anc 694 . . 3 (𝜑 → (𝐾‘((𝐴 sadd 𝐵) ∩ (0..^(𝑁 + 1)))) = ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0)))
9998oveq1d 6705 . 2 (𝜑 → ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^(𝑁 + 1)))) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) = (((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^𝑁))) + if(𝑁 ∈ (𝐴 sadd 𝐵), (2↑𝑁), 0)) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)))
10020bitsinvp1 15218 . . . 4 ((𝐴 ⊆ ℕ0𝑁 ∈ ℕ0) → (𝐾‘(𝐴 ∩ (0..^(𝑁 + 1)))) = ((𝐾‘(𝐴 ∩ (0..^𝑁))) + if(𝑁𝐴, (2↑𝑁), 0)))
1012, 28, 100syl2anc 694 . . 3 (𝜑 → (𝐾‘(𝐴 ∩ (0..^(𝑁 + 1)))) = ((𝐾‘(𝐴 ∩ (0..^𝑁))) + if(𝑁𝐴, (2↑𝑁), 0)))
10220bitsinvp1 15218 . . . 4 ((𝐵 ⊆ ℕ0𝑁 ∈ ℕ0) → (𝐾‘(𝐵 ∩ (0..^(𝑁 + 1)))) = ((𝐾‘(𝐵 ∩ (0..^𝑁))) + if(𝑁𝐵, (2↑𝑁), 0)))
1033, 28, 102syl2anc 694 . . 3 (𝜑 → (𝐾‘(𝐵 ∩ (0..^(𝑁 + 1)))) = ((𝐾‘(𝐵 ∩ (0..^𝑁))) + if(𝑁𝐵, (2↑𝑁), 0)))
104101, 103oveq12d 6708 . 2 (𝜑 → ((𝐾‘(𝐴 ∩ (0..^(𝑁 + 1)))) + (𝐾‘(𝐵 ∩ (0..^(𝑁 + 1))))) = (((𝐾‘(𝐴 ∩ (0..^𝑁))) + if(𝑁𝐴, (2↑𝑁), 0)) + ((𝐾‘(𝐵 ∩ (0..^𝑁))) + if(𝑁𝐵, (2↑𝑁), 0))))
10596, 99, 1043eqtr4d 2695 1 (𝜑 → ((𝐾‘((𝐴 sadd 𝐵) ∩ (0..^(𝑁 + 1)))) + if(∅ ∈ (𝐶‘(𝑁 + 1)), (2↑(𝑁 + 1)), 0)) = ((𝐾‘(𝐴 ∩ (0..^(𝑁 + 1)))) + (𝐾‘(𝐵 ∩ (0..^(𝑁 + 1))))))