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 31863
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 14784 . . . . . . . 8 (♯‘⟨“𝐴𝐵”⟩) = 2
21oveq2i 7369 . . . . . . 7 (1 mod (♯‘⟨“𝐴𝐵”⟩)) = (1 mod 2)
3 1re 11160 . . . . . . . 8 1 ∈ ℝ
4 2rp 12925 . . . . . . . 8 2 ∈ ℝ+
5 0le1 11683 . . . . . . . 8 0 ≤ 1
6 1lt2 12329 . . . . . . . 8 1 < 2
7 modid 13807 . . . . . . . 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 4836 . . . . 5 ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩ = ⟨1, 2⟩
1110oveq2i 7369 . . . 4 (⟨“𝐴𝐵”⟩ substr ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩) = (⟨“𝐴𝐵”⟩ substr ⟨1, 2⟩)
12 s2cl 14773 . . . . . 6 ((𝐴𝑉𝐵𝑉) → ⟨“𝐴𝐵”⟩ ∈ Word 𝑉)
13 tpid2g 4733 . . . . . . . . 9 (1 ∈ ℝ → 1 ∈ {0, 1, 2})
143, 13ax-mp 5 . . . . . . . 8 1 ∈ {0, 1, 2}
15 fz0tp 13548 . . . . . . . 8 (0...2) = {0, 1, 2}
1614, 15eleqtrri 2833 . . . . . . 7 1 ∈ (0...2)
17 tpid3g 4734 . . . . . . . . . 10 (2 ∈ ℝ+ → 2 ∈ {0, 1, 2})
184, 17ax-mp 5 . . . . . . . . 9 2 ∈ {0, 1, 2}
1918, 15eleqtrri 2833 . . . . . . . 8 2 ∈ (0...2)
201oveq2i 7369 . . . . . . . 8 (0...(♯‘⟨“𝐴𝐵”⟩)) = (0...2)
2119, 20eleqtrri 2833 . . . . . . 7 2 ∈ (0...(♯‘⟨“𝐴𝐵”⟩))
22 swrdval2 14540 . . . . . . 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 12284 . . . . . . . . 9 (2 − 1) = 1
2625oveq2i 7369 . . . . . . . 8 (0..^(2 − 1)) = (0..^1)
27 fzo01 13660 . . . . . . . 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 4604 . . . . . . . . . . 11 (𝑖 ∈ {0} → 𝑖 = 0)
3331, 32syl 17 . . . . . . . . . 10 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → 𝑖 = 0)
3433oveq1d 7373 . . . . . . . . 9 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (𝑖 + 1) = (0 + 1))
35 0p1e1 12280 . . . . . . . . 9 (0 + 1) = 1
3634, 35eqtrdi 2789 . . . . . . . 8 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (𝑖 + 1) = 1)
3736fveq2d 6847 . . . . . . 7 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (⟨“𝐴𝐵”⟩‘(𝑖 + 1)) = (⟨“𝐴𝐵”⟩‘1))
38 s2fv1 14783 . . . . . . . 8 (𝐵𝑉 → (⟨“𝐴𝐵”⟩‘1) = 𝐵)
3938ad2antlr 726 . . . . . . 7 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (⟨“𝐴𝐵”⟩‘1) = 𝐵)
4037, 39eqtrd 2773 . . . . . 6 (((𝐴𝑉𝐵𝑉) ∧ 𝑖 ∈ (0..^(2 − 1))) → (⟨“𝐴𝐵”⟩‘(𝑖 + 1)) = 𝐵)
4129, 40mpteq12dva 5195 . . . . 5 ((𝐴𝑉𝐵𝑉) → (𝑖 ∈ (0..^(2 − 1)) ↦ (⟨“𝐴𝐵”⟩‘(𝑖 + 1))) = (𝑖 ∈ {0} ↦ 𝐵))
42 fconstmpt 5695 . . . . . 6 ({0} × {𝐵}) = (𝑖 ∈ {0} ↦ 𝐵)
43 0nn0 12433 . . . . . . . 8 0 ∈ ℕ0
44 simpr 486 . . . . . . . 8 ((𝐴𝑉𝐵𝑉) → 𝐵𝑉)
45 xpsng 7086 . . . . . . . 8 ((0 ∈ ℕ0𝐵𝑉) → ({0} × {𝐵}) = {⟨0, 𝐵⟩})
4643, 44, 45sylancr 588 . . . . . . 7 ((𝐴𝑉𝐵𝑉) → ({0} × {𝐵}) = {⟨0, 𝐵⟩})
47 s1val 14492 . . . . . . . 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 7369 . . . 4 (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩))) = (⟨“𝐴𝐵”⟩ prefix 1)
54 pfx1s2 31844 . . . 4 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ prefix 1) = ⟨“𝐴”⟩)
5553, 54eqtrid 2785 . . 3 ((𝐴𝑉𝐵𝑉) → (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩))) = ⟨“𝐴”⟩)
5652, 55oveq12d 7376 . 2 ((𝐴𝑉𝐵𝑉) → ((⟨“𝐴𝐵”⟩ substr ⟨(1 mod (♯‘⟨“𝐴𝐵”⟩)), (♯‘⟨“𝐴𝐵”⟩)⟩) ++ (⟨“𝐴𝐵”⟩ prefix (1 mod (♯‘⟨“𝐴𝐵”⟩)))) = (⟨“𝐵”⟩ ++ ⟨“𝐴”⟩))
57 1z 12538 . . 3 1 ∈ ℤ
58 cshword 14685 . . 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 14743 . . 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 4587  {ctp 4591  cop 4593   class class class wbr 5106  cmpt 5189   × cxp 5632  cfv 6497  (class class class)co 7358  cr 11055  0cc0 11056  1c1 11057   + caddc 11059   < clt 11194  cle 11195  cmin 11390  2c2 12213  0cn0 12418  cz 12504  +crp 12920  ...cfz 13430  ..^cfzo 13573   mod cmo 13780  chash 14236  Word cword 14408   ++ cconcat 14464  ⟨“cs1 14489   substr csubstr 14534   prefix cpfx 14564   cyclShift ccsh 14682  ⟨“cs2 14736
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 5243  ax-sep 5257  ax-nul 5264  ax-pow 5321  ax-pr 5385  ax-un 7673  ax-cnex 11112  ax-resscn 11113  ax-1cn 11114  ax-icn 11115  ax-addcl 11116  ax-addrcl 11117  ax-mulcl 11118  ax-mulrcl 11119  ax-mulcom 11120  ax-addass 11121  ax-mulass 11122  ax-distr 11123  ax-i2m1 11124  ax-1ne0 11125  ax-1rid 11126  ax-rnegex 11127  ax-rrecex 11128  ax-cnre 11129  ax-pre-lttri 11130  ax-pre-lttrn 11131  ax-pre-ltadd 11132  ax-pre-mulgt0 11133  ax-pre-sup 11134
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 2941  df-nel 3047  df-ral 3062  df-rex 3071  df-rmo 3352  df-reu 3353  df-rab 3407  df-v 3446  df-sbc 3741  df-csb 3857  df-dif 3914  df-un 3916  df-in 3918  df-ss 3928  df-pss 3930  df-nul 4284  df-if 4488  df-pw 4563  df-sn 4588  df-pr 4590  df-tp 4592  df-op 4594  df-uni 4867  df-int 4909  df-iun 4957  df-br 5107  df-opab 5169  df-mpt 5190  df-tr 5224  df-id 5532  df-eprel 5538  df-po 5546  df-so 5547  df-fr 5589  df-we 5591  df-xp 5640  df-rel 5641  df-cnv 5642  df-co 5643  df-dm 5644  df-rn 5645  df-res 5646  df-ima 5647  df-pred 6254  df-ord 6321  df-on 6322  df-lim 6323  df-suc 6324  df-iota 6449  df-fun 6499  df-fn 6500  df-f 6501  df-f1 6502  df-fo 6503  df-f1o 6504  df-fv 6505  df-riota 7314  df-ov 7361  df-oprab 7362  df-mpo 7363  df-om 7804  df-1st 7922  df-2nd 7923  df-frecs 8213  df-wrecs 8244  df-recs 8318  df-rdg 8357  df-1o 8413  df-er 8651  df-en 8887  df-dom 8888  df-sdom 8889  df-fin 8890  df-sup 9383  df-inf 9384  df-card 9880  df-pnf 11196  df-mnf 11197  df-xr 11198  df-ltxr 11199  df-le 11200  df-sub 11392  df-neg 11393  df-div 11818  df-nn 12159  df-2 12221  df-n0 12419  df-xnn0 12491  df-z 12505  df-uz 12769  df-rp 12921  df-fz 13431  df-fzo 13574  df-fl 13703  df-mod 13781  df-hash 14237  df-word 14409  df-concat 14465  df-s1 14490  df-substr 14535  df-pfx 14565  df-csh 14683  df-s2 14743
This theorem is referenced by:  cycpm2tr  32017
  Copyright terms: Public domain W3C validator