Users' Mathboxes 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 46161
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 46160 . 2 #b = (𝑛 ∈ V ↦ if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)))
2 eqeq1 2740 . . 3 (𝑛 = 𝑁 → (𝑛 = 0 ↔ 𝑁 = 0))
3 fveq2 6804 . . . . . 6 (𝑛 = 𝑁 → (abs‘𝑛) = (abs‘𝑁))
43oveq2d 7323 . . . . 5 (𝑛 = 𝑁 → (2 logb (abs‘𝑛)) = (2 logb (abs‘𝑁)))
54fveq2d 6808 . . . 4 (𝑛 = 𝑁 → (⌊‘(2 logb (abs‘𝑛))) = (⌊‘(2 logb (abs‘𝑁))))
65oveq1d 7322 . . 3 (𝑛 = 𝑁 → ((⌊‘(2 logb (abs‘𝑛))) + 1) = ((⌊‘(2 logb (abs‘𝑁))) + 1))
72, 6ifbieq2d 4491 . 2 (𝑛 = 𝑁 → if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))
8 elex 3455 . 2 (𝑁𝑉𝑁 ∈ V)
9 1ex 11021 . . . 4 1 ∈ V
10 ovex 7340 . . . 4 ((⌊‘(2 logb (abs‘𝑁))) + 1) ∈ V
119, 10ifex 4515 . . 3 if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V
1211a1i 11 . 2 (𝑁𝑉 → if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V)
131, 7, 8, 12fvmptd3 6930 1 (𝑁𝑉 → (#b𝑁) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))
Colors of variables: wff setvar class
Syntax hints:  wi 4   = wceq 1539  wcel 2104  Vcvv 3437  ifcif 4465  cfv 6458  (class class class)co 7307  0cc0 10921  1c1 10922   + caddc 10924  2c2 12078  cfl 13560  abscabs 14994   logb clogb 25963  #bcblen 46159
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1795  ax-4 1809  ax-5 1911  ax-6 1969  ax-7 2009  ax-8 2106  ax-9 2114  ax-10 2135  ax-11 2152  ax-12 2169  ax-ext 2707  ax-sep 5232  ax-nul 5239  ax-pr 5361  ax-1cn 10979
This theorem depends on definitions:  df-bi 206  df-an 398  df-or 846  df-3an 1089  df-tru 1542  df-fal 1552  df-ex 1780  df-nf 1784  df-sb 2066  df-mo 2538  df-eu 2567  df-clab 2714  df-cleq 2728  df-clel 2814  df-nfc 2887  df-ne 2942  df-ral 3063  df-rex 3072  df-rab 3306  df-v 3439  df-dif 3895  df-un 3897  df-in 3899  df-ss 3909  df-nul 4263  df-if 4466  df-sn 4566  df-pr 4568  df-op 4572  df-uni 4845  df-br 5082  df-opab 5144  df-mpt 5165  df-id 5500  df-xp 5606  df-rel 5607  df-cnv 5608  df-co 5609  df-dm 5610  df-iota 6410  df-fun 6460  df-fv 6466  df-ov 7310  df-blen 46160
This theorem is referenced by:  blen0  46162  blenn0  46163
  Copyright terms: Public domain W3C validator