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

Theorem blenval 42890
 Description: The binary length of an integer. (Contributed by AV, 20-May-2020.)
Assertion
Ref Expression
blenval (𝑁𝑉 → (#b𝑁) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))

Proof of Theorem blenval
Dummy variable 𝑛 is distinct from all other variables.
StepHypRef Expression
1 df-blen 42889 . . 3 #b = (𝑛 ∈ V ↦ if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)))
21a1i 11 . 2 (𝑁𝑉 → #b = (𝑛 ∈ V ↦ if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1))))
3 eqeq1 2775 . . . 4 (𝑛 = 𝑁 → (𝑛 = 0 ↔ 𝑁 = 0))
4 fveq2 6333 . . . . . . 7 (𝑛 = 𝑁 → (abs‘𝑛) = (abs‘𝑁))
54oveq2d 6812 . . . . . 6 (𝑛 = 𝑁 → (2 logb (abs‘𝑛)) = (2 logb (abs‘𝑁)))
65fveq2d 6337 . . . . 5 (𝑛 = 𝑁 → (⌊‘(2 logb (abs‘𝑛))) = (⌊‘(2 logb (abs‘𝑁))))
76oveq1d 6811 . . . 4 (𝑛 = 𝑁 → ((⌊‘(2 logb (abs‘𝑛))) + 1) = ((⌊‘(2 logb (abs‘𝑁))) + 1))
83, 7ifbieq2d 4251 . . 3 (𝑛 = 𝑁 → if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))
98adantl 467 . 2 ((𝑁𝑉𝑛 = 𝑁) → if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))
10 elex 3364 . 2 (𝑁𝑉𝑁 ∈ V)
11 1ex 10241 . . . 4 1 ∈ V
12 ovex 6827 . . . 4 ((⌊‘(2 logb (abs‘𝑁))) + 1) ∈ V
1311, 12ifex 4296 . . 3 if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V
1413a1i 11 . 2 (𝑁𝑉 → if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V)
152, 9, 10, 14fvmptd 6432 1 (𝑁𝑉 → (#b𝑁) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   = wceq 1631   ∈ wcel 2145  Vcvv 3351  ifcif 4226   ↦ cmpt 4864  ‘cfv 6030  (class class class)co 6796  0cc0 10142  1c1 10143   + caddc 10145  2c2 11276  ⌊cfl 12799  abscabs 14182   logb clogb 24723  #bcblen 42888 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1870  ax-4 1885  ax-5 1991  ax-6 2057  ax-7 2093  ax-9 2154  ax-10 2174  ax-11 2190  ax-12 2203  ax-13 2408  ax-ext 2751  ax-sep 4916  ax-nul 4924  ax-pr 5035  ax-1cn 10200 This theorem depends on definitions:  df-bi 197  df-an 383  df-or 837  df-3an 1073  df-tru 1634  df-ex 1853  df-nf 1858  df-sb 2050  df-eu 2622  df-mo 2623  df-clab 2758  df-cleq 2764  df-clel 2767  df-nfc 2902  df-ral 3066  df-rex 3067  df-rab 3070  df-v 3353  df-sbc 3588  df-csb 3683  df-dif 3726  df-un 3728  df-in 3730  df-ss 3737  df-nul 4064  df-if 4227  df-sn 4318  df-pr 4320  df-op 4324  df-uni 4576  df-br 4788  df-opab 4848  df-mpt 4865  df-id 5158  df-xp 5256  df-rel 5257  df-cnv 5258  df-co 5259  df-dm 5260  df-iota 5993  df-fun 6032  df-fv 6038  df-ov 6799  df-blen 42889 This theorem is referenced by:  blen0  42891  blenn0  42892
 Copyright terms: Public domain W3C validator