| 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 6842 | . . . . . . . 8 ⊢ (𝑤 = 𝑊 → (♯‘𝑤) = (♯‘𝑊)) | |
| 6 | 5 | adantr 480 | . . . . . . 7 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (♯‘𝑤) = (♯‘𝑊)) |
| 7 | 4, 6 | oveq12d 7386 | . . . . . 6 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑛 mod (♯‘𝑤)) = (𝑁 mod (♯‘𝑊))) |
| 8 | 7, 6 | opeq12d 4839 | . . . . 5 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉 = 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) |
| 9 | 3, 8 | oveq12d 7386 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) = (𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉)) |
| 10 | 3, 7 | oveq12d 7386 | . . . 4 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → (𝑤 prefix (𝑛 mod (♯‘𝑤))) = (𝑊 prefix (𝑁 mod (♯‘𝑊)))) |
| 11 | 9, 10 | oveq12d 7386 | . . 3 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
| 12 | 2, 11 | ifbieq2d 4508 | . 2 ⊢ ((𝑤 = 𝑊 ∧ 𝑛 = 𝑁) → if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤))))) = if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))))) |
| 13 | df-csh 14724 | . 2 ⊢ cyclShift = (𝑤 ∈ {𝑓 ∣ ∃𝑙 ∈ ℕ0 𝑓 Fn (0..^𝑙)}, 𝑛 ∈ ℤ ↦ if(𝑤 = ∅, ∅, ((𝑤 substr 〈(𝑛 mod (♯‘𝑤)), (♯‘𝑤)〉) ++ (𝑤 prefix (𝑛 mod (♯‘𝑤)))))) | |
| 14 | 0ex 5254 | . . 3 ⊢ ∅ ∈ V | |
| 15 | ovex 7401 | . . 3 ⊢ ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊)))) ∈ V | |
| 16 | 14, 15 | ifex 4532 | . 2 ⊢ if(𝑊 = ∅, ∅, ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) ∈ V |
| 17 | 12, 13, 16 | ovmpoa 7523 | 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 4287 ifcif 4481 〈cop 4588 Fn wfn 6495 ‘cfv 6500 (class class class)co 7368 0cc0 11038 ℕ0cn0 12413 ℤcz 12500 ..^cfzo 13582 mod cmo 13801 ♯chash 14265 ++ cconcat 14505 substr csubstr 14576 prefix cpfx 14606 cyclShift ccsh 14723 |
| 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 5243 ax-nul 5253 ax-pr 5379 |
| 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 3402 df-v 3444 df-sbc 3743 df-dif 3906 df-un 3908 df-in 3910 df-ss 3920 df-nul 4288 df-if 4482 df-sn 4583 df-pr 4585 df-op 4589 df-uni 4866 df-br 5101 df-opab 5163 df-id 5527 df-xp 5638 df-rel 5639 df-cnv 5640 df-co 5641 df-dm 5642 df-iota 6456 df-fun 6502 df-fv 6508 df-ov 7371 df-oprab 7372 df-mpo 7373 df-csh 14724 |
| This theorem is referenced by: cshword 14726 |
| Copyright terms: Public domain | W3C validator |