MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  swrdco Structured version   Visualization version   GIF version

Theorem swrdco 13380
Description: Mapping of words commutes with the substring operation. (Contributed by AV, 11-Nov-2018.)
Assertion
Ref Expression
swrdco ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩)) = ((𝐹𝑊) substr ⟨𝑀, 𝑁⟩))

Proof of Theorem swrdco
Dummy variable 𝑖 is distinct from all other variables.
StepHypRef Expression
1 ffn 5944 . . . 4 (𝐹:𝐴𝐵𝐹 Fn 𝐴)
213ad2ant3 1076 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝐹 Fn 𝐴)
3 swrdvalfn 13224 . . . . 5 ((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
433expb 1257 . . . 4 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))) → (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
543adant3 1073 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
6 swrdrn 13227 . . . . 5 ((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴)
763expb 1257 . . . 4 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))) → ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴)
873adant3 1073 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴)
9 fnco 5899 . . 3 ((𝐹 Fn 𝐴 ∧ (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)) ∧ ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴) → (𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩)) Fn (0..^(𝑁𝑀)))
102, 5, 8, 9syl3anc 1317 . 2 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩)) Fn (0..^(𝑁𝑀)))
11 wrdco 13374 . . . 4 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (𝐹𝑊) ∈ Word 𝐵)
12113adant2 1072 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝐹𝑊) ∈ Word 𝐵)
13 simp2l 1079 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑀 ∈ (0...𝑁))
14 lenco 13375 . . . . . . . . . . . 12 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (#‘(𝐹𝑊)) = (#‘𝑊))
1514eqcomd 2615 . . . . . . . . . . 11 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (#‘𝑊) = (#‘(𝐹𝑊)))
1615oveq2d 6543 . . . . . . . . . 10 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (0...(#‘𝑊)) = (0...(#‘(𝐹𝑊))))
1716eleq2d 2672 . . . . . . . . 9 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (𝑁 ∈ (0...(#‘𝑊)) ↔ 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
1817biimpd 217 . . . . . . . 8 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
1918expcom 449 . . . . . . 7 (𝐹:𝐴𝐵 → (𝑊 ∈ Word 𝐴 → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))))
2019com13 85 . . . . . 6 (𝑁 ∈ (0...(#‘𝑊)) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
2120adantl 480 . . . . 5 ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
2221com12 32 . . . 4 (𝑊 ∈ Word 𝐴 → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
23223imp 1248 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))
24 swrdvalfn 13224 . . 3 (((𝐹𝑊) ∈ Word 𝐵𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘(𝐹𝑊)))) → ((𝐹𝑊) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
2512, 13, 23, 24syl3anc 1317 . 2 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → ((𝐹𝑊) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
26 3anass 1034 . . . . . . 7 ((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ↔ (𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))))
2726biimpri 216 . . . . . 6 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))) → (𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))))
28273adant3 1073 . . . . 5 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))))
29 swrdfv 13222 . . . . . 6 (((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖) = (𝑊‘(𝑖 + 𝑀)))
3029fveq2d 6092 . . . . 5 (((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
3128, 30sylan 486 . . . 4 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
32 wrdfn 13120 . . . . . . 7 (𝑊 ∈ Word 𝐴𝑊 Fn (0..^(#‘𝑊)))
33323ad2ant1 1074 . . . . . 6 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑊 Fn (0..^(#‘𝑊)))
3433adantr 479 . . . . 5 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → 𝑊 Fn (0..^(#‘𝑊)))
35 elfzodifsumelfzo 12356 . . . . . . 7 ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑖 ∈ (0..^(𝑁𝑀)) → (𝑖 + 𝑀) ∈ (0..^(#‘𝑊))))
36353ad2ant2 1075 . . . . . 6 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝑖 ∈ (0..^(𝑁𝑀)) → (𝑖 + 𝑀) ∈ (0..^(#‘𝑊))))
3736imp 443 . . . . 5 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝑖 + 𝑀) ∈ (0..^(#‘𝑊)))
38 fvco2 6168 . . . . 5 ((𝑊 Fn (0..^(#‘𝑊)) ∧ (𝑖 + 𝑀) ∈ (0..^(#‘𝑊))) → ((𝐹𝑊)‘(𝑖 + 𝑀)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
3934, 37, 38syl2anc 690 . . . 4 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹𝑊)‘(𝑖 + 𝑀)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
4031, 39eqtr4d 2646 . . 3 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)) = ((𝐹𝑊)‘(𝑖 + 𝑀)))
41 fvco2 6168 . . . 4 (((𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩))‘𝑖) = (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)))
425, 41sylan 486 . . 3 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩))‘𝑖) = (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)))
4314ancoms 467 . . . . . . . . . . . . . 14 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (#‘(𝐹𝑊)) = (#‘𝑊))
4443eqcomd 2615 . . . . . . . . . . . . 13 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (#‘𝑊) = (#‘(𝐹𝑊)))
4544oveq2d 6543 . . . . . . . . . . . 12 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (0...(#‘𝑊)) = (0...(#‘(𝐹𝑊))))
4645eleq2d 2672 . . . . . . . . . . 11 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (𝑁 ∈ (0...(#‘𝑊)) ↔ 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
4746biimpd 217 . . . . . . . . . 10 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
4847ex 448 . . . . . . . . 9 (𝐹:𝐴𝐵 → (𝑊 ∈ Word 𝐴 → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))))
4948com13 85 . . . . . . . 8 (𝑁 ∈ (0...(#‘𝑊)) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
5049adantl 480 . . . . . . 7 ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
5150com12 32 . . . . . 6 (𝑊 ∈ Word 𝐴 → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
52513imp 1248 . . . . 5 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))
5312, 13, 523jca 1234 . . . 4 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → ((𝐹𝑊) ∈ Word 𝐵𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
54 swrdfv 13222 . . . 4 ((((𝐹𝑊) ∈ Word 𝐵𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘(𝐹𝑊)))) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (((𝐹𝑊) substr ⟨𝑀, 𝑁⟩)‘𝑖) = ((𝐹𝑊)‘(𝑖 + 𝑀)))
5553, 54sylan 486 . . 3 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (((𝐹𝑊) substr ⟨𝑀, 𝑁⟩)‘𝑖) = ((𝐹𝑊)‘(𝑖 + 𝑀)))
5640, 42, 553eqtr4d 2653 . 2 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩))‘𝑖) = (((𝐹𝑊) substr ⟨𝑀, 𝑁⟩)‘𝑖))
5710, 25, 56eqfnfvd 6207 1 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩)) = ((𝐹𝑊) substr ⟨𝑀, 𝑁⟩))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382  w3a 1030   = wceq 1474  wcel 1976  wss 3539  cop 4130  ran crn 5029  ccom 5032   Fn wfn 5785  wf 5786  cfv 5790  (class class class)co 6527  0cc0 9792   + caddc 9795  cmin 10117  ...cfz 12152  ..^cfzo 12289  #chash 12934  Word cword 13092   substr csubstr 13096
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1712  ax-4 1727  ax-5 1826  ax-6 1874  ax-7 1921  ax-8 1978  ax-9 1985  ax-10 2005  ax-11 2020  ax-12 2033  ax-13 2233  ax-ext 2589  ax-rep 4693  ax-sep 4703  ax-nul 4712  ax-pow 4764  ax-pr 4828  ax-un 6824  ax-cnex 9848  ax-resscn 9849  ax-1cn 9850  ax-icn 9851  ax-addcl 9852  ax-addrcl 9853  ax-mulcl 9854  ax-mulrcl 9855  ax-mulcom 9856  ax-addass 9857  ax-mulass 9858  ax-distr 9859  ax-i2m1 9860  ax-1ne0 9861  ax-1rid 9862  ax-rnegex 9863  ax-rrecex 9864  ax-cnre 9865  ax-pre-lttri 9866  ax-pre-lttrn 9867  ax-pre-ltadd 9868  ax-pre-mulgt0 9869
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1700  df-sb 1867  df-eu 2461  df-mo 2462  df-clab 2596  df-cleq 2602  df-clel 2605  df-nfc 2739  df-ne 2781  df-nel 2782  df-ral 2900  df-rex 2901  df-reu 2902  df-rab 2904  df-v 3174  df-sbc 3402  df-csb 3499  df-dif 3542  df-un 3544  df-in 3546  df-ss 3553  df-pss 3555  df-nul 3874  df-if 4036  df-pw 4109  df-sn 4125  df-pr 4127  df-tp 4129  df-op 4131  df-uni 4367  df-int 4405  df-iun 4451  df-br 4578  df-opab 4638  df-mpt 4639  df-tr 4675  df-eprel 4939  df-id 4943  df-po 4949  df-so 4950  df-fr 4987  df-we 4989  df-xp 5034  df-rel 5035  df-cnv 5036  df-co 5037  df-dm 5038  df-rn 5039  df-res 5040  df-ima 5041  df-pred 5583  df-ord 5629  df-on 5630  df-lim 5631  df-suc 5632  df-iota 5754  df-fun 5792  df-fn 5793  df-f 5794  df-f1 5795  df-fo 5796  df-f1o 5797  df-fv 5798  df-riota 6489  df-ov 6530  df-oprab 6531  df-mpt2 6532  df-om 6935  df-1st 7036  df-2nd 7037  df-wrecs 7271  df-recs 7332  df-rdg 7370  df-1o 7424  df-er 7606  df-en 7819  df-dom 7820  df-sdom 7821  df-fin 7822  df-card 8625  df-pnf 9932  df-mnf 9933  df-xr 9934  df-ltxr 9935  df-le 9936  df-sub 10119  df-neg 10120  df-nn 10868  df-n0 11140  df-z 11211  df-uz 11520  df-fz 12153  df-fzo 12290  df-hash 12935  df-word 13100  df-substr 13104
This theorem is referenced by:  pfxco  40099
  Copyright terms: Public domain W3C validator