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 48442
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 48441 . 2 #b = (𝑛 ∈ V ↦ if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)))
2 eqeq1 2740 . . 3 (𝑛 = 𝑁 → (𝑛 = 0 ↔ 𝑁 = 0))
3 fveq2 6911 . . . . . 6 (𝑛 = 𝑁 → (abs‘𝑛) = (abs‘𝑁))
43oveq2d 7451 . . . . 5 (𝑛 = 𝑁 → (2 logb (abs‘𝑛)) = (2 logb (abs‘𝑁)))
54fveq2d 6915 . . . 4 (𝑛 = 𝑁 → (⌊‘(2 logb (abs‘𝑛))) = (⌊‘(2 logb (abs‘𝑁))))
65oveq1d 7450 . . 3 (𝑛 = 𝑁 → ((⌊‘(2 logb (abs‘𝑛))) + 1) = ((⌊‘(2 logb (abs‘𝑁))) + 1))
72, 6ifbieq2d 4558 . 2 (𝑛 = 𝑁 → if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))
8 elex 3500 . 2 (𝑁𝑉𝑁 ∈ V)
9 1ex 11261 . . . 4 1 ∈ V
10 ovex 7468 . . . 4 ((⌊‘(2 logb (abs‘𝑁))) + 1) ∈ V
119, 10ifex 4582 . . 3 if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V
1211a1i 11 . 2 (𝑁𝑉 → if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V)
131, 7, 8, 12fvmptd3 7043 1 (𝑁𝑉 → (#b𝑁) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)))
Colors of variables: wff setvar class
Syntax hints:  wi 4   = wceq 1538  wcel 2107  Vcvv 3479  ifcif 4532  cfv 6566  (class class class)co 7435  0cc0 11159  1c1 11160   + caddc 11162  2c2 12325  cfl 13833  abscabs 15276   logb clogb 26830  #bcblen 48440
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1793  ax-4 1807  ax-5 1909  ax-6 1966  ax-7 2006  ax-8 2109  ax-9 2117  ax-10 2140  ax-11 2156  ax-12 2176  ax-ext 2707  ax-sep 5303  ax-nul 5313  ax-pr 5439  ax-1cn 11217
This theorem depends on definitions:  df-bi 207  df-an 396  df-or 848  df-3an 1088  df-tru 1541  df-fal 1551  df-ex 1778  df-nf 1782  df-sb 2064  df-mo 2539  df-eu 2568  df-clab 2714  df-cleq 2728  df-clel 2815  df-nfc 2891  df-ne 2940  df-ral 3061  df-rex 3070  df-rab 3435  df-v 3481  df-dif 3967  df-un 3969  df-ss 3981  df-nul 4341  df-if 4533  df-sn 4633  df-pr 4635  df-op 4639  df-uni 4914  df-br 5150  df-opab 5212  df-mpt 5233  df-id 5584  df-xp 5696  df-rel 5697  df-cnv 5698  df-co 5699  df-dm 5700  df-iota 6519  df-fun 6568  df-fv 6574  df-ov 7438  df-blen 48441
This theorem is referenced by:  blen0  48443  blenn0  48444
  Copyright terms: Public domain W3C validator