| 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 2733 | . . . 4 ⊢ (𝑤 = 𝑊 → (𝑤 = ∅ ↔ 𝑊 = ∅)) | |
| 2 | 1 | adantr 480 | . . 3 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 = ∅ ↔ 𝑊 = ∅)) |
| 3 | simpl 482 | . . . . 5 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 𝑤 = 𝑊) | |
| 4 | simpr 484 | . . . . . . 7 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 𝑛 = 𝑁) | |
| 5 | fveq2 6826 | . . . . . . . 8 ⊢ (𝑤 = 𝑊 → (♯‘𝑤) = (♯‘𝑊)) | |
| 6 | 5 | adantr 480 | . . . . . . 7 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (♯‘𝑤) = (♯‘𝑊)) |
| 7 | 4, 6 | oveq12d 7371 | . . . . . 6 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑛 mod (♯‘𝑤)) = (𝑁 mod (♯‘𝑊))) |
| 8 | 7, 6 | opeq12d 4835 | . . . . 5 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉 = 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) |
| 9 | 3, 8 | oveq12d 7371 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) = (𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉)) |
| 10 | 3, 7 | oveq12d 7371 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 prefix (𝑛 mod (♯‘𝑤))) = (𝑊 prefix (𝑁 mod (♯‘𝑊)))) |
| 11 | 9, 10 | oveq12d 7371 | . . 3 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
| 12 | 2, 11 | ifbieq2d 4505 | . 2 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤))))) = if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))))) |
| 13 | df-csh 14713 | . 2 ⊢ cyclShift = (𝑤 ∈ {𝑓 ∣ ∃𝑙 ∈ ℕ0 𝑓 Fn (0..^𝑙)}, 𝑛 ∈ ℤ ↦ if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))))) | |
| 14 | 0ex 5249 | . . 3 ⊢ ∅ ∈ V | |
| 15 | ovex 7386 | . . 3 ⊢ ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))) ∈ V | |
| 16 | 14, 15 | ifex 4529 | . 2 ⊢ if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) ∈ V |
| 17 | 12, 13, 16 | ovmpoa 7508 | 1 ⊢ ((𝑊 ∈ {𝑓 ∣ ∃𝑙 ∈ ℕ0 𝑓 Fn (0..^𝑙)} ∧ 𝑁 ∈ ℤ) → (𝑊 cyclShift 𝑁) = if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))))) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ↔ wb 206 ∧ wa 395 = wceq 1540 ∈ wcel 2109 {cab 2707 ∃wrex 3053 ∅c0 4286 ifcif 4478 〈cop 4585 Fn wfn 6481 ‘cfv 6486 (class class class)co 7353 0cc0 11028 ℕ0cn0 12402 ℤcz 12489 ..^cfzo 13575 mod cmo 13791 ♯chash 14255 ++ cconcat 14495 substr csubstr 14565 prefix cpfx 14595 cyclShift ccsh 14712 |
| 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 1910 ax-6 1967 ax-7 2008 ax-8 2111 ax-9 2119 ax-10 2142 ax-11 2158 ax-12 2178 ax-ext 2701 ax-sep 5238 ax-nul 5248 ax-pr 5374 |
| This theorem depends on definitions: df-bi 207 df-an 396 df-or 848 df-3an 1088 df-tru 1543 df-fal 1553 df-ex 1780 df-nf 1784 df-sb 2066 df-mo 2533 df-eu 2562 df-clab 2708 df-cleq 2721 df-clel 2803 df-nfc 2878 df-ne 2926 df-ral 3045 df-rex 3054 df-rab 3397 df-v 3440 df-sbc 3745 df-dif 3908 df-un 3910 df-ss 3922 df-nul 4287 df-if 4479 df-sn 4580 df-pr 4582 df-op 4586 df-uni 4862 df-br 5096 df-opab 5158 df-id 5518 df-xp 5629 df-rel 5630 df-cnv 5631 df-co 5632 df-dm 5633 df-iota 6442 df-fun 6488 df-fv 6494 df-ov 7356 df-oprab 7357 df-mpo 7358 df-csh 14713 |
| This theorem is referenced by: cshword 14715 |
| Copyright terms: Public domain | W3C validator |