| 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 48437 | . 2 ⊢ #b = (𝑛 ∈ V ↦ if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1))) | |
| 2 | eqeq1 2738 | . . 3 ⊢ (𝑛 = 𝑁 → (𝑛 = 0 ↔ 𝑁 = 0)) | |
| 3 | fveq2 6887 | . . . . . 6 ⊢ (𝑛 = 𝑁 → (abs‘𝑛) = (abs‘𝑁)) | |
| 4 | 3 | oveq2d 7430 | . . . . 5 ⊢ (𝑛 = 𝑁 → (2 logb (abs‘𝑛)) = (2 logb (abs‘𝑁))) |
| 5 | 4 | fveq2d 6891 | . . . 4 ⊢ (𝑛 = 𝑁 → (⌊‘(2 logb (abs‘𝑛))) = (⌊‘(2 logb (abs‘𝑁)))) |
| 6 | 5 | oveq1d 7429 | . . 3 ⊢ (𝑛 = 𝑁 → ((⌊‘(2 logb (abs‘𝑛))) + 1) = ((⌊‘(2 logb (abs‘𝑁))) + 1)) |
| 7 | 2, 6 | ifbieq2d 4534 | . 2 ⊢ (𝑛 = 𝑁 → if(𝑛 = 0, 1, ((⌊‘(2 logb (abs‘𝑛))) + 1)) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1))) |
| 8 | elex 3485 | . 2 ⊢ (𝑁 ∈ 𝑉 → 𝑁 ∈ V) | |
| 9 | 1ex 11240 | . . . 4 ⊢ 1 ∈ V | |
| 10 | ovex 7447 | . . . 4 ⊢ ((⌊‘(2 logb (abs‘𝑁))) + 1) ∈ V | |
| 11 | 9, 10 | ifex 4558 | . . 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 7020 | 1 ⊢ (𝑁 ∈ 𝑉 → (#b‘𝑁) = if(𝑁 = 0, 1, ((⌊‘(2 logb (abs‘𝑁))) + 1))) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 = wceq 1539 ∈ wcel 2107 Vcvv 3464 ifcif 4507 ‘cfv 6542 (class class class)co 7414 0cc0 11138 1c1 11139 + caddc 11141 2c2 12304 ⌊cfl 13813 abscabs 15256 logb clogb 26762 #bcblen 48436 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1794 ax-4 1808 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 2706 ax-sep 5278 ax-nul 5288 ax-pr 5414 ax-1cn 11196 |
| This theorem depends on definitions: df-bi 207 df-an 396 df-or 848 df-3an 1088 df-tru 1542 df-fal 1552 df-ex 1779 df-nf 1783 df-sb 2064 df-mo 2538 df-eu 2567 df-clab 2713 df-cleq 2726 df-clel 2808 df-nfc 2884 df-ne 2932 df-ral 3051 df-rex 3060 df-rab 3421 df-v 3466 df-dif 3936 df-un 3938 df-ss 3950 df-nul 4316 df-if 4508 df-sn 4609 df-pr 4611 df-op 4615 df-uni 4890 df-br 5126 df-opab 5188 df-mpt 5208 df-id 5560 df-xp 5673 df-rel 5674 df-cnv 5675 df-co 5676 df-dm 5677 df-iota 6495 df-fun 6544 df-fv 6550 df-ov 7417 df-blen 48437 |
| This theorem is referenced by: blen0 48439 blenn0 48440 |
| Copyright terms: Public domain | W3C validator |