| 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 2741 | . . . 4 ⊢ (𝑤 = 𝑊 → (𝑤 = ∅ ↔ 𝑊 = ∅)) | |
| 2 | 1 | adantr 480 | . . 3 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 = ∅ ↔ 𝑊 = ∅)) |
| 3 | simpl 482 | . . . . 5 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 𝑤 = 𝑊) | |
| 4 | simpr 484 | . . . . . . 7 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 𝑛 = 𝑁) | |
| 5 | fveq2 6834 | . . . . . . . 8 ⊢ (𝑤 = 𝑊 → (♯‘𝑤) = (♯‘𝑊)) | |
| 6 | 5 | adantr 480 | . . . . . . 7 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (♯‘𝑤) = (♯‘𝑊)) |
| 7 | 4, 6 | oveq12d 7378 | . . . . . 6 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑛 mod (♯‘𝑤)) = (𝑁 mod (♯‘𝑊))) |
| 8 | 7, 6 | opeq12d 4825 | . . . . 5 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉 = 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) |
| 9 | 3, 8 | oveq12d 7378 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) = (𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉)) |
| 10 | 3, 7 | oveq12d 7378 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 prefix (𝑛 mod (♯‘𝑤))) = (𝑊 prefix (𝑁 mod (♯‘𝑊)))) |
| 11 | 9, 10 | oveq12d 7378 | . . 3 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
| 12 | 2, 11 | ifbieq2d 4494 | . 2 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤))))) = if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))))) |
| 13 | df-csh 14742 | . 2 ⊢ cyclShift = (𝑤 ∈ {𝑓 ∣ ∃𝑙 ∈ ℕ0 𝑓 Fn (0..^𝑙)}, 𝑛 ∈ ℤ ↦ if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))))) | |
| 14 | 0ex 5242 | . . 3 ⊢ ∅ ∈ V | |
| 15 | ovex 7393 | . . 3 ⊢ ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))) ∈ V | |
| 16 | 14, 15 | ifex 4518 | . 2 ⊢ if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) ∈ V |
| 17 | 12, 13, 16 | ovmpoa 7515 | 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 1542 ∈ wcel 2114 {cab 2715 ∃wrex 3062 ∅c0 4274 ifcif 4467 〈cop 4574 Fn wfn 6487 ‘cfv 6492 (class class class)co 7360 0cc0 11029 ℕ0cn0 12428 ℤcz 12515 ..^cfzo 13599 mod cmo 13819 ♯chash 14283 ++ cconcat 14523 substr csubstr 14594 prefix cpfx 14624 cyclShift ccsh 14741 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1797 ax-4 1811 ax-5 1912 ax-6 1969 ax-7 2010 ax-8 2116 ax-9 2124 ax-10 2147 ax-11 2163 ax-12 2185 ax-ext 2709 ax-sep 5231 ax-nul 5241 ax-pr 5370 |
| This theorem depends on definitions: df-bi 207 df-an 396 df-or 849 df-3an 1089 df-tru 1545 df-fal 1555 df-ex 1782 df-nf 1786 df-sb 2069 df-mo 2540 df-eu 2570 df-clab 2716 df-cleq 2729 df-clel 2812 df-nfc 2886 df-ne 2934 df-ral 3053 df-rex 3063 df-rab 3391 df-v 3432 df-sbc 3730 df-dif 3893 df-un 3895 df-in 3897 df-ss 3907 df-nul 4275 df-if 4468 df-sn 4569 df-pr 4571 df-op 4575 df-uni 4852 df-br 5087 df-opab 5149 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 7363 df-oprab 7364 df-mpo 7365 df-csh 14742 |
| This theorem is referenced by: cshword 14744 |
| Copyright terms: Public domain | W3C validator |