Users' Mathboxes Mathbox for Alexander van der Vekens < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  nn0mullong Structured version   Visualization version   GIF version

Theorem nn0mullong 43267
Description: Standard algorithm (also known as "long multiplication" or "grade-school multiplication") to calculate the product of two nonnegative integers 𝑎 and 𝑏 by multiplying the multiplicand 𝑏 by each digit of the multiplier 𝑎 and then add up all the properly shifted results. Here, the binary representation of the multiplier 𝑎 is used, i.e. the above mentioned "digits" are 0 or 1. This is a similar result as provided by smumul 15589. (Contributed by AV, 7-Jun-2020.)
Assertion
Ref Expression
nn0mullong ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → (𝐴 · 𝐵) = Σ𝑘 ∈ (0..^(#b𝐴))(((𝑘(digit‘2)𝐴) · (2↑𝑘)) · 𝐵))
Distinct variable groups:   𝐴,𝑘   𝐵,𝑘

Proof of Theorem nn0mullong
StepHypRef Expression
1 nn0sumshdig 43265 . . . 4 (𝐴 ∈ ℕ0𝐴 = Σ𝑘 ∈ (0..^(#b𝐴))((𝑘(digit‘2)𝐴) · (2↑𝑘)))
21adantr 474 . . 3 ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → 𝐴 = Σ𝑘 ∈ (0..^(#b𝐴))((𝑘(digit‘2)𝐴) · (2↑𝑘)))
32oveq1d 6921 . 2 ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → (𝐴 · 𝐵) = (Σ𝑘 ∈ (0..^(#b𝐴))((𝑘(digit‘2)𝐴) · (2↑𝑘)) · 𝐵))
4 fzofi 13069 . . . 4 (0..^(#b𝐴)) ∈ Fin
54a1i 11 . . 3 ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → (0..^(#b𝐴)) ∈ Fin)
6 nn0cn 11630 . . . 4 (𝐵 ∈ ℕ0𝐵 ∈ ℂ)
76adantl 475 . . 3 ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → 𝐵 ∈ ℂ)
8 2nn 11425 . . . . . . 7 2 ∈ ℕ
98a1i 11 . . . . . 6 (((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) ∧ 𝑘 ∈ (0..^(#b𝐴))) → 2 ∈ ℕ)
10 elfzoelz 12766 . . . . . . 7 (𝑘 ∈ (0..^(#b𝐴)) → 𝑘 ∈ ℤ)
1110adantl 475 . . . . . 6 (((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) ∧ 𝑘 ∈ (0..^(#b𝐴))) → 𝑘 ∈ ℤ)
12 nn0rp0 12570 . . . . . . . 8 (𝐴 ∈ ℕ0𝐴 ∈ (0[,)+∞))
1312adantr 474 . . . . . . 7 ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → 𝐴 ∈ (0[,)+∞))
1413adantr 474 . . . . . 6 (((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) ∧ 𝑘 ∈ (0..^(#b𝐴))) → 𝐴 ∈ (0[,)+∞))
15 digvalnn0 43241 . . . . . 6 ((2 ∈ ℕ ∧ 𝑘 ∈ ℤ ∧ 𝐴 ∈ (0[,)+∞)) → (𝑘(digit‘2)𝐴) ∈ ℕ0)
169, 11, 14, 15syl3anc 1496 . . . . 5 (((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) ∧ 𝑘 ∈ (0..^(#b𝐴))) → (𝑘(digit‘2)𝐴) ∈ ℕ0)
1716nn0cnd 11681 . . . 4 (((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) ∧ 𝑘 ∈ (0..^(#b𝐴))) → (𝑘(digit‘2)𝐴) ∈ ℂ)
18 2nn0 11638 . . . . . . . 8 2 ∈ ℕ0
1918a1i 11 . . . . . . 7 (𝑘 ∈ (0..^(#b𝐴)) → 2 ∈ ℕ0)
20 elfzonn0 12809 . . . . . . 7 (𝑘 ∈ (0..^(#b𝐴)) → 𝑘 ∈ ℕ0)
2119, 20nn0expcld 13328 . . . . . 6 (𝑘 ∈ (0..^(#b𝐴)) → (2↑𝑘) ∈ ℕ0)
2221nn0cnd 11681 . . . . 5 (𝑘 ∈ (0..^(#b𝐴)) → (2↑𝑘) ∈ ℂ)
2322adantl 475 . . . 4 (((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) ∧ 𝑘 ∈ (0..^(#b𝐴))) → (2↑𝑘) ∈ ℂ)
2417, 23mulcld 10378 . . 3 (((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) ∧ 𝑘 ∈ (0..^(#b𝐴))) → ((𝑘(digit‘2)𝐴) · (2↑𝑘)) ∈ ℂ)
255, 7, 24fsummulc1 14892 . 2 ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → (Σ𝑘 ∈ (0..^(#b𝐴))((𝑘(digit‘2)𝐴) · (2↑𝑘)) · 𝐵) = Σ𝑘 ∈ (0..^(#b𝐴))(((𝑘(digit‘2)𝐴) · (2↑𝑘)) · 𝐵))
263, 25eqtrd 2862 1 ((𝐴 ∈ ℕ0𝐵 ∈ ℕ0) → (𝐴 · 𝐵) = Σ𝑘 ∈ (0..^(#b𝐴))(((𝑘(digit‘2)𝐴) · (2↑𝑘)) · 𝐵))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 386   = wceq 1658  wcel 2166  cfv 6124  (class class class)co 6906  Fincfn 8223  cc 10251  0cc0 10253   · cmul 10258  +∞cpnf 10389  cn 11351  2c2 11407  0cn0 11619  cz 11705  [,)cico 12466  ..^cfzo 12761  cexp 13155  Σcsu 14794  #bcblen 43211  digitcdig 43237
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1896  ax-4 1910  ax-5 2011  ax-6 2077  ax-7 2114  ax-8 2168  ax-9 2175  ax-10 2194  ax-11 2209  ax-12 2222  ax-13 2391  ax-ext 2804  ax-rep 4995  ax-sep 5006  ax-nul 5014  ax-pow 5066  ax-pr 5128  ax-un 7210  ax-inf2 8816  ax-cnex 10309  ax-resscn 10310  ax-1cn 10311  ax-icn 10312  ax-addcl 10313  ax-addrcl 10314  ax-mulcl 10315  ax-mulrcl 10316  ax-mulcom 10317  ax-addass 10318  ax-mulass 10319  ax-distr 10320  ax-i2m1 10321  ax-1ne0 10322  ax-1rid 10323  ax-rnegex 10324  ax-rrecex 10325  ax-cnre 10326  ax-pre-lttri 10327  ax-pre-lttrn 10328  ax-pre-ltadd 10329  ax-pre-mulgt0 10330  ax-pre-sup 10331  ax-addf 10332  ax-mulf 10333
This theorem depends on definitions:  df-bi 199  df-an 387  df-or 881  df-3or 1114  df-3an 1115  df-tru 1662  df-fal 1672  df-ex 1881  df-nf 1885  df-sb 2070  df-mo 2606  df-eu 2641  df-clab 2813  df-cleq 2819  df-clel 2822  df-nfc 2959  df-ne 3001  df-nel 3104  df-ral 3123  df-rex 3124  df-reu 3125  df-rmo 3126  df-rab 3127  df-v 3417  df-sbc 3664  df-csb 3759  df-dif 3802  df-un 3804  df-in 3806  df-ss 3813  df-pss 3815  df-nul 4146  df-if 4308  df-pw 4381  df-sn 4399  df-pr 4401  df-tp 4403  df-op 4405  df-uni 4660  df-int 4699  df-iun 4743  df-iin 4744  df-br 4875  df-opab 4937  df-mpt 4954  df-tr 4977  df-id 5251  df-eprel 5256  df-po 5264  df-so 5265  df-fr 5302  df-se 5303  df-we 5304  df-xp 5349  df-rel 5350  df-cnv 5351  df-co 5352  df-dm 5353  df-rn 5354  df-res 5355  df-ima 5356  df-pred 5921  df-ord 5967  df-on 5968  df-lim 5969  df-suc 5970  df-iota 6087  df-fun 6126  df-fn 6127  df-f 6128  df-f1 6129  df-fo 6130  df-f1o 6131  df-fv 6132  df-isom 6133  df-riota 6867  df-ov 6909  df-oprab 6910  df-mpt2 6911  df-of 7158  df-om 7328  df-1st 7429  df-2nd 7430  df-supp 7561  df-wrecs 7673  df-recs 7735  df-rdg 7773  df-1o 7827  df-2o 7828  df-oadd 7831  df-er 8010  df-map 8125  df-pm 8126  df-ixp 8177  df-en 8224  df-dom 8225  df-sdom 8226  df-fin 8227  df-fsupp 8546  df-fi 8587  df-sup 8618  df-inf 8619  df-oi 8685  df-card 9079  df-cda 9306  df-pnf 10394  df-mnf 10395  df-xr 10396  df-ltxr 10397  df-le 10398  df-sub 10588  df-neg 10589  df-div 11011  df-nn 11352  df-2 11415  df-3 11416  df-4 11417  df-5 11418  df-6 11419  df-7 11420  df-8 11421  df-9 11422  df-n0 11620  df-z 11706  df-dec 11823  df-uz 11970  df-q 12073  df-rp 12114  df-xneg 12233  df-xadd 12234  df-xmul 12235  df-ioo 12468  df-ioc 12469  df-ico 12470  df-icc 12471  df-fz 12621  df-fzo 12762  df-fl 12889  df-mod 12965  df-seq 13097  df-exp 13156  df-fac 13355  df-bc 13384  df-hash 13412  df-shft 14185  df-cj 14217  df-re 14218  df-im 14219  df-sqrt 14353  df-abs 14354  df-limsup 14580  df-clim 14597  df-rlim 14598  df-sum 14795  df-ef 15171  df-sin 15173  df-cos 15174  df-pi 15176  df-dvds 15359  df-struct 16225  df-ndx 16226  df-slot 16227  df-base 16229  df-sets 16230  df-ress 16231  df-plusg 16319  df-mulr 16320  df-starv 16321  df-sca 16322  df-vsca 16323  df-ip 16324  df-tset 16325  df-ple 16326  df-ds 16328  df-unif 16329  df-hom 16330  df-cco 16331  df-rest 16437  df-topn 16438  df-0g 16456  df-gsum 16457  df-topgen 16458  df-pt 16459  df-prds 16462  df-xrs 16516  df-qtop 16521  df-imas 16522  df-xps 16524  df-mre 16600  df-mrc 16601  df-acs 16603  df-mgm 17596  df-sgrp 17638  df-mnd 17649  df-submnd 17690  df-mulg 17896  df-cntz 18101  df-cmn 18549  df-psmet 20099  df-xmet 20100  df-met 20101  df-bl 20102  df-mopn 20103  df-fbas 20104  df-fg 20105  df-cnfld 20108  df-top 21070  df-topon 21087  df-topsp 21109  df-bases 21122  df-cld 21195  df-ntr 21196  df-cls 21197  df-nei 21274  df-lp 21312  df-perf 21313  df-cn 21403  df-cnp 21404  df-haus 21491  df-tx 21737  df-hmeo 21930  df-fil 22021  df-fm 22113  df-flim 22114  df-flf 22115  df-xms 22496  df-ms 22497  df-tms 22498  df-cncf 23052  df-limc 24030  df-dv 24031  df-log 24703  df-cxp 24704  df-logb 24906  df-blen 43212  df-dig 43238
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator