| Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
| Mirrors > Home > MPE Home > Th. List > cshfn | Structured version Visualization version GIF version | ||
| Description: Perform a cyclical shift for a function over a half-open range of nonnegative integers. (Contributed by AV, 20-May-2018.) (Revised by AV, 17-Nov-2018.) (Revised by AV, 4-Nov-2022.) |
| Ref | Expression |
|---|---|
| cshfn | ⊢ ((𝑊 ∈ {𝑓 ∣ ∃𝑙 ∈ ℕ0 𝑓 Fn (0..^𝑙)} ∧ 𝑁 ∈ ℤ) → (𝑊 cyclShift 𝑁) = if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))))) |
| Step | Hyp | Ref | Expression |
|---|---|---|---|
| 1 | eqeq1 2744 | . . . 4 ⊢ (𝑤 = 𝑊 → (𝑤 = ∅ ↔ 𝑊 = ∅)) | |
| 2 | 1 | adantr 481 | . . 3 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 = ∅ ↔ 𝑊 = ∅)) |
| 3 | simpl 483 | . . . . 5 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 𝑤 = 𝑊) | |
| 4 | simpr 485 | . . . . . . 7 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 𝑛 = 𝑁) | |
| 5 | fveq2 6834 | . . . . . . . 8 ⊢ (𝑤 = 𝑊 → (♯‘𝑤) = (♯‘𝑊)) | |
| 6 | 5 | adantr 481 | . . . . . . 7 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (♯‘𝑤) = (♯‘𝑊)) |
| 7 | 4, 6 | oveq12d 7381 | . . . . . 6 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑛 mod (♯‘𝑤)) = (𝑁 mod (♯‘𝑊))) |
| 8 | 7, 6 | opeq12d 4819 | . . . . 5 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉 = 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) |
| 9 | 3, 8 | oveq12d 7381 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) = (𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉)) |
| 10 | 3, 7 | oveq12d 7381 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 prefix (𝑛 mod (♯‘𝑤))) = (𝑊 prefix (𝑁 mod (♯‘𝑊)))) |
| 11 | 9, 10 | oveq12d 7381 | . . 3 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
| 12 | 2, 11 | ifbieq2d 4488 | . 2 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤))))) = if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))))) |
| 13 | df-csh 14749 | . 2 ⊢ cyclShift = (𝑤 ∈ {𝑓 ∣ ∃𝑙 ∈ ℕ0 𝑓 Fn (0..^𝑙)}, 𝑛 ∈ ℤ ↦ if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))))) | |
| 14 | 0ex 5236 | . . 3 ⊢ ∅ ∈ V | |
| 15 | ovex 7396 | . . 3 ⊢ ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))) ∈ V | |
| 16 | 14, 15 | ifex 4512 | . 2 ⊢ if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) ∈ V |
| 17 | 12, 13, 16 | ovmpoa 7518 | 1 ⊢ ((𝑊 ∈ {𝑓 ∣ ∃𝑙 ∈ ℕ0 𝑓 Fn (0..^𝑙)} ∧ 𝑁 ∈ ℤ) → (𝑊 cyclShift 𝑁) = if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))))) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ↔ wb 207 ∧ wa 396 = wceq 1547 ∈ wcel 2119 {cab 2718 ∃wrex 3064 ∅c0 4268 ifcif 4461 〈cop 4568 Fn wfn 6487 ‘cfv 6492 (class class class)co 7363 0cc0 11036 ℕ0cn0 12435 ℤcz 12522 ..^cfzo 13606 mod cmo 13826 ♯chash 14290 ++ cconcat 14530 substr csubstr 14601 prefix cpfx 14631 cyclShift ccsh 14748 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1802 ax-4 1816 ax-5 1917 ax-6 1974 ax-7 2015 ax-8 2121 ax-9 2129 ax-10 2152 ax-11 2168 ax-12 2189 ax-ext 2712 ax-sep 5225 ax-nul 5235 ax-pr 5369 |
| This theorem depends on definitions: df-bi 208 df-an 397 df-or 854 df-3an 1094 df-tru 1550 df-fal 1560 df-ex 1787 df-nf 1791 df-sb 2074 df-mo 2543 df-eu 2573 df-clab 2719 df-cleq 2732 df-clel 2815 df-nfc 2889 df-ne 2936 df-ral 3055 df-rex 3065 df-rab 3393 df-v 3434 df-sbc 3731 df-dif 3893 df-un 3895 df-in 3897 df-ss 3907 df-nul 4269 df-if 4462 df-sn 4563 df-pr 4565 df-op 4569 df-uni 4846 df-br 5080 df-opab 5142 df-id 5520 df-xp 5631 df-rel 5632 df-cnv 5633 df-co 5634 df-dm 5635 df-iota 6448 df-fun 6494 df-fv 6500 df-ov 7366 df-oprab 7367 df-mpo 7368 df-csh 14749 |
| This theorem is referenced by: cshword 14751 |
| Copyright terms: Public domain | W3C validator |