| Mathbox for Alexander van der Vekens |
< Previous
Next >
Nearby theorems |
||
| Mirrors > Home > MPE Home > Th. List > Mathboxes > blenval | Structured version Visualization version GIF version | ||
| Description: The binary length of an integer. (Contributed by AV, 20-May-2020.) |
| Ref | Expression |
|---|---|
| blenval | ⊢ (𝑁 ∈ 𝑉 → (#b‘𝑁) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1))) |
| Step | Hyp | Ref | Expression |
|---|---|---|---|
| 1 | df-blen 48812 | . 2 ⊢ #b = (𝑛 ∈ V ↦ if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1))) | |
| 2 | eqeq1 2740 | . . 3 ⊢ (𝑛 = 𝑁 → (𝑛 = 0 ↔ 𝑁 = 0)) | |
| 3 | fveq2 6834 | . . . . . 6 ⊢ (𝑛 = 𝑁 → (abs‘𝑛) = (abs‘𝑁)) | |
| 4 | 3 | oveq2d 7374 | . . . . 5 ⊢ (𝑛 = 𝑁 → (2 logb (abs‘𝑛)) = (2 logb (abs‘𝑁))) |
| 5 | 4 | fveq2d 6838 | . . . 4 ⊢ (𝑛 = 𝑁 → (⌊‘(2 logb (abs‘𝑛))) = (⌊‘(2 logb (abs‘𝑁)))) |
| 6 | 5 | oveq1d 7373 | . . 3 ⊢ (𝑛 = 𝑁 → ((⌊‘(2 logb (abs‘𝑛))) + 1) = ((⌊‘(2 logb (abs‘𝑁))) + 1)) |
| 7 | 2, 6 | ifbieq2d 4506 | . 2 ⊢ (𝑛 = 𝑁 → if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1))) |
| 8 | elex 3461 | . 2 ⊢ (𝑁 ∈ 𝑉 → 𝑁 ∈ V) | |
| 9 | 1ex 11128 | . . . 4 ⊢ 1 ∈ V | |
| 10 | ovex 7391 | . . . 4 ⊢ ((⌊‘(2 logb (abs‘𝑁))) + 1) ∈ V | |
| 11 | 9, 10 | ifex 4530 | . . 3 ⊢ if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V |
| 12 | 11 | a1i 11 | . 2 ⊢ (𝑁 ∈ 𝑉 → if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1)) ∈ V) |
| 13 | 1, 7, 8, 12 | fvmptd3 6964 | 1 ⊢ (𝑁 ∈ 𝑉 → (#b‘𝑁) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1))) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 = wceq 1541 ∈ wcel 2113 Vcvv 3440 ifcif 4479 ‘cfv 6492 (class class class)co 7358 0cc0 11026 1c1 11027 + caddc 11029 2c2 12200 ⌊cfl 13710 abscabs 15157 logb clogb 26730 #bcblen 48811 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1796 ax-4 1810 ax-5 1911 ax-6 1968 ax-7 2009 ax-8 2115 ax-9 2123 ax-10 2146 ax-11 2162 ax-12 2184 ax-ext 2708 ax-sep 5241 ax-nul 5251 ax-pr 5377 ax-1cn 11084 |
| This theorem depends on definitions: df-bi 207 df-an 396 df-or 848 df-3an 1088 df-tru 1544 df-fal 1554 df-ex 1781 df-nf 1785 df-sb 2068 df-mo 2539 df-eu 2569 df-clab 2715 df-cleq 2728 df-clel 2811 df-nfc 2885 df-ne 2933 df-ral 3052 df-rex 3061 df-rab 3400 df-v 3442 df-dif 3904 df-un 3906 df-ss 3918 df-nul 4286 df-if 4480 df-sn 4581 df-pr 4583 df-op 4587 df-uni 4864 df-br 5099 df-opab 5161 df-mpt 5180 df-id 5519 df-xp 5630 df-rel 5631 df-cnv 5632 df-co 5633 df-dm 5634 df-iota 6448 df-fun 6494 df-fv 6500 df-ov 7361 df-blen 48812 |
| This theorem is referenced by: blen0 48814 blenn0 48815 |
| Copyright terms: Public domain | W3C validator |