Users' Mathboxes Mathbox for Thierry Arnoux < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  cshw1s2 Structured version   Visualization version   GIF version

Theorem cshw1s2 32155
Description: Cyclically shifting a length 2 word swaps its symbols. (Contributed by Thierry Arnoux, 19-Sep-2023.)
Assertion
Ref Expression
cshw1s2 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ cyclShift 1) = ⟨“𝐵𝐴”⟩)

Proof of Theorem cshw1s2
Dummy variable 𝑖 is distinct from all other variables.
StepHypRef Expression
1 s2len 14840 . . . . . . . 8 (♯‘⟨“𝐴𝐵”⟩) = 2
21oveq2i 7420 . . . . . . 7 (1 mod (♯‘⟨“𝐴𝐵”⟩)) = (1 mod 2)
3 1re 11214 . . . . . . . 8 1 ∈ ℝ
4 2rp 12979 . . . . . . . 8 2 ∈ ℝ+
5 0le1 11737 . . . . . . . 8 0 ≤ 1
6 1lt2 12383 . . . . . . . 8 1 < 2
7 modid 13861 . . . . . . . 8 (((1 ∈ ℝ ∧ 2 ∈ ℝ+) ∧ (0 ≤ 1 ∧ 1 < 2)) → (1 mod 2) = 1)
83, 4, 5, 6, 7mp4an 692 . . . . . . 7 (1 mod 2) = 1
92, 8eqtri 2761 . . . . . 6 (1 mod (♯‘⟨“𝐴𝐵”⟩)) = 1
109, 1opeq12i 4879 . . . . 5 ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩ = ⟨1, 2⟩
1110oveq2i 7420 . . . 4 (⟨“𝐴𝐵”⟩ substr ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩) = (⟨“𝐴𝐵”⟩ substr ⟨1, 2⟩)
12 s2cl 14829 . . . . . 6 ((𝐴𝑉𝐵𝑉) → ⟨“𝐴𝐵”⟩ ∈ Word 𝑉)
13 tpid2g 4776 . . . . . . . . 9 (1 ∈ ℝ → 1 ∈ {0, 1, 2})
143, 13ax-mp 5 . . . . . . . 8 1 ∈ {0, 1, 2}
15 fz0tp 13602 . . . . . . . 8 (0...2) = {0, 1, 2}
1614, 15eleqtrri 2833 . . . . . . 7 1 ∈ (0...2)
17 tpid3g 4777 . . . . . . . . . 10 (2 ∈ ℝ+ → 2 ∈ {0, 1, 2})
184, 17ax-mp 5 . . . . . . . . 9 2 ∈ {0, 1, 2}
1918, 15eleqtrri 2833 . . . . . . . 8 2 ∈ (0...2)
201oveq2i 7420 . . . . . . . 8 (0...(♯‘⟨“𝐴𝐵”⟩)) = (0...2)
2119, 20eleqtrri 2833 . . . . . . 7 2 ∈ (0...(♯‘⟨“𝐴𝐵”⟩))
22 swrdval2 14596 . . . . . . 7 ((⟨“𝐴𝐵”⟩ ∈ Word 𝑉 ∧ 1 ∈ (0...2) ∧ 2 ∈ (0...(♯‘⟨“𝐴𝐵”⟩))) → (⟨“𝐴𝐵”⟩ substr ⟨1, 2⟩) = (𝑖 ∈ (0..^(2 − 1)) ↦ (⟨“𝐴𝐵”⟩‘(𝑖 + 1))))
2316, 21, 22mp3an23 1454 . . . . . 6 (⟨“𝐴𝐵”⟩ ∈ Word 𝑉 → (⟨“𝐴𝐵”⟩ substr ⟨1, 2⟩) = (𝑖 ∈ (0..^(2 − 1)) ↦ (⟨“𝐴𝐵”⟩‘(𝑖 + 1))))
2412, 23syl 17 . . . . 5 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ substr ⟨1, 2⟩) = (𝑖 ∈ (0..^(2 − 1)) ↦ (⟨“𝐴𝐵”⟩‘(𝑖 + 1))))
25 2m1e1 12338 . . . . . . . . 9 (2 − 1) = 1
2625oveq2i 7420 . . . . . . . 8 (0..^(2 − 1)) = (0..^1)
27 fzo01 13714 . . . . . . . 8 (0..^1) = {0}
2826, 27eqtri 2761 . . . . . . 7 (0..^(2 − 1)) = {0}
2928a1i 11 . . . . . 6 ((𝐴𝑉𝐵𝑉) → (0..^(2 − 1)) = {0})
30 simpr 486 . . . . . . . . . . . 12 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → 𝑖 ∈ (0..^(2 − 1)))
3130, 28eleqtrdi 2844 . . . . . . . . . . 11 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → 𝑖 ∈ {0})
32 elsni 4646 . . . . . . . . . . 11 (𝑖 ∈ {0} → 𝑖 = 0)
3331, 32syl 17 . . . . . . . . . 10 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → 𝑖 = 0)
3433oveq1d 7424 . . . . . . . . 9 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (𝑖 + 1) = (0 + 1))
35 0p1e1 12334 . . . . . . . . 9 (0 + 1) = 1
3634, 35eqtrdi 2789 . . . . . . . 8 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (𝑖 + 1) = 1)
3736fveq2d 6896 . . . . . . 7 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (⟨“𝐴𝐵”⟩‘(𝑖 + 1)) = (⟨“𝐴𝐵”⟩‘1))
38 s2fv1 14839 . . . . . . . 8 (𝐵𝑉 → (⟨“𝐴𝐵”⟩‘1) = 𝐵)
3938ad2antlr 726 . . . . . . 7 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (⟨“𝐴𝐵”⟩‘1) = 𝐵)
4037, 39eqtrd 2773 . . . . . 6 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (⟨“𝐴𝐵”⟩‘(𝑖 + 1)) = 𝐵)
4129, 40mpteq12dva 5238 . . . . 5 ((𝐴𝑉𝐵𝑉) → (𝑖 ∈ (0..^(2 − 1)) ↦ (⟨“𝐴𝐵”⟩‘(𝑖 + 1))) = (𝑖 ∈ {0} ↦ 𝐵))
42 fconstmpt 5739 . . . . . 6 ({0} × {𝐵}) = (𝑖 ∈ {0} ↦ 𝐵)
43 0nn0 12487 . . . . . . . 8 0 ∈ ℕ0
44 simpr 486 . . . . . . . 8 ((𝐴𝑉𝐵𝑉) → 𝐵𝑉)
45 xpsng 7137 . . . . . . . 8 ((0 ∈ ℕ0𝐵𝑉) → ({0} × {𝐵}) = {⟨0, 𝐵⟩})
4643, 44, 45sylancr 588 . . . . . . 7 ((𝐴𝑉𝐵𝑉) → ({0} × {𝐵}) = {⟨0, 𝐵⟩})
47 s1val 14548 . . . . . . . 8 (𝐵𝑉 → ⟨“𝐵”⟩ = {⟨0, 𝐵⟩})
4847adantl 483 . . . . . . 7 ((𝐴𝑉𝐵𝑉) → ⟨“𝐵”⟩ = {⟨0, 𝐵⟩})
4946, 48eqtr4d 2776 . . . . . 6 ((𝐴𝑉𝐵𝑉) → ({0} × {𝐵}) = ⟨“𝐵”⟩)
5042, 49eqtr3id 2787 . . . . 5 ((𝐴𝑉𝐵𝑉) → (𝑖 ∈ {0} ↦ 𝐵) = ⟨“𝐵”⟩)
5124, 41, 503eqtrd 2777 . . . 4 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ substr ⟨1, 2⟩) = ⟨“𝐵”⟩)
5211, 51eqtrid 2785 . . 3 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ substr ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩) = ⟨“𝐵”⟩)
539oveq2i 7420 . . . 4 (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩))) = (⟨“𝐴𝐵”⟩ prefix 1)
54 pfx1s2 32136 . . . 4 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ prefix 1) = ⟨“𝐴”⟩)
5553, 54eqtrid 2785 . . 3 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩))) = ⟨“𝐴”⟩)
5652, 55oveq12d 7427 . 2 ((𝐴𝑉𝐵𝑉) → ((⟨“𝐴𝐵”⟩ substr ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩) ++ (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩)))) = (⟨“𝐵”⟩ ++ ⟨“𝐴”⟩))
57 1z 12592 . . 3 1 ∈ ℤ
58 cshword 14741 . . 3 ((⟨“𝐴𝐵”⟩ ∈ Word 𝑉 ∧ 1 ∈ ℤ) → (⟨“𝐴𝐵”⟩ cyclShift 1) = ((⟨“𝐴𝐵”⟩ substr ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩) ++ (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩)))))
5912, 57, 58sylancl 587 . 2 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ cyclShift 1) = ((⟨“𝐴𝐵”⟩ substr ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩) ++ (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩)))))
60 df-s2 14799 . . 3 ⟨“𝐵𝐴”⟩ = (⟨“𝐵”⟩ ++ ⟨“𝐴”⟩)
6160a1i 11 . 2 ((𝐴𝑉𝐵𝑉) → ⟨“𝐵𝐴”⟩ = (⟨“𝐵”⟩ ++ ⟨“𝐴”⟩))
6256, 59, 613eqtr4d 2783 1 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ cyclShift 1) = ⟨“𝐵𝐴”⟩)
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 397   = wceq 1542  wcel 2107  {csn 4629  {ctp 4633  cop 4635   class class class wbr 5149  cmpt 5232   × cxp 5675  cfv 6544  (class class class)co 7409  cr 11109  0cc0 11110  1c1 11111   + caddc 11113   < clt 11248  cle 11249  cmin 11444  2c2 12267  0cn0 12472  cz 12558  +crp 12974  ...cfz 13484  ..^cfzo 13627   mod cmo 13834  chash 14290  Word cword 14464   ++ cconcat 14520  ⟨“cs1 14545   substr csubstr 14590   prefix cpfx 14620   cyclShift ccsh 14738  ⟨“cs2 14792
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2109  ax-9 2117  ax-10 2138  ax-11 2155  ax-12 2172  ax-ext 2704  ax-rep 5286  ax-sep 5300  ax-nul 5307  ax-pow 5364  ax-pr 5428  ax-un 7725  ax-cnex 11166  ax-resscn 11167  ax-1cn 11168  ax-icn 11169  ax-addcl 11170  ax-addrcl 11171  ax-mulcl 11172  ax-mulrcl 11173  ax-mulcom 11174  ax-addass 11175  ax-mulass 11176  ax-distr 11177  ax-i2m1 11178  ax-1ne0 11179  ax-1rid 11180  ax-rnegex 11181  ax-rrecex 11182  ax-cnre 11183  ax-pre-lttri 11184  ax-pre-lttrn 11185  ax-pre-ltadd 11186  ax-pre-mulgt0 11187  ax-pre-sup 11188
This theorem depends on definitions:  df-bi 206  df-an 398  df-or 847  df-3or 1089  df-3an 1090  df-tru 1545  df-fal 1555  df-ex 1783  df-nf 1787  df-sb 2069  df-mo 2535  df-eu 2564  df-clab 2711  df-cleq 2725  df-clel 2811  df-nfc 2886  df-ne 2942  df-nel 3048  df-ral 3063  df-rex 3072  df-rmo 3377  df-reu 3378  df-rab 3434  df-v 3477  df-sbc 3779  df-csb 3895  df-dif 3952  df-un 3954  df-in 3956  df-ss 3966  df-pss 3968  df-nul 4324  df-if 4530  df-pw 4605  df-sn 4630  df-pr 4632  df-tp 4634  df-op 4636  df-uni 4910  df-int 4952  df-iun 5000  df-br 5150  df-opab 5212  df-mpt 5233  df-tr 5267  df-id 5575  df-eprel 5581  df-po 5589  df-so 5590  df-fr 5632  df-we 5634  df-xp 5683  df-rel 5684  df-cnv 5685  df-co 5686  df-dm 5687  df-rn 5688  df-res 5689  df-ima 5690  df-pred 6301  df-ord 6368  df-on 6369  df-lim 6370  df-suc 6371  df-iota 6496  df-fun 6546  df-fn 6547  df-f 6548  df-f1 6549  df-fo 6550  df-f1o 6551  df-fv 6552  df-riota 7365  df-ov 7412  df-oprab 7413  df-mpo 7414  df-om 7856  df-1st 7975  df-2nd 7976  df-frecs 8266  df-wrecs 8297  df-recs 8371  df-rdg 8410  df-1o 8466  df-er 8703  df-en 8940  df-dom 8941  df-sdom 8942  df-fin 8943  df-sup 9437  df-inf 9438  df-card 9934  df-pnf 11250  df-mnf 11251  df-xr 11252  df-ltxr 11253  df-le 11254  df-sub 11446  df-neg 11447  df-div 11872  df-nn 12213  df-2 12275  df-n0 12473  df-xnn0 12545  df-z 12559  df-uz 12823  df-rp 12975  df-fz 13485  df-fzo 13628  df-fl 13757  df-mod 13835  df-hash 14291  df-word 14465  df-concat 14521  df-s1 14546  df-substr 14591  df-pfx 14621  df-csh 14739  df-s2 14799
This theorem is referenced by:  cycpm2tr  32309
  Copyright terms: Public domain W3C validator