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

Theorem swrdco 13629
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 6083 . . . 4 (𝐹:𝐴𝐵𝐹 Fn 𝐴)
213ad2ant3 1104 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝐹 Fn 𝐴)
3 swrdvalfn 13472 . . . . 5 ((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
433expb 1285 . . . 4 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))) → (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
543adant3 1101 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
6 swrdrn 13475 . . . . 5 ((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴)
763expb 1285 . . . 4 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))) → ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴)
873adant3 1101 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴)
9 fnco 6037 . . 3 ((𝐹 Fn 𝐴 ∧ (𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)) ∧ ran (𝑊 substr ⟨𝑀, 𝑁⟩) ⊆ 𝐴) → (𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩)) Fn (0..^(𝑁𝑀)))
102, 5, 8, 9syl3anc 1366 . 2 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩)) Fn (0..^(𝑁𝑀)))
11 wrdco 13623 . . . 4 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (𝐹𝑊) ∈ Word 𝐵)
12113adant2 1100 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝐹𝑊) ∈ Word 𝐵)
13 simp2l 1107 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑀 ∈ (0...𝑁))
14 lenco 13624 . . . . . . . . . . . 12 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (#‘(𝐹𝑊)) = (#‘𝑊))
1514eqcomd 2657 . . . . . . . . . . 11 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (#‘𝑊) = (#‘(𝐹𝑊)))
1615oveq2d 6706 . . . . . . . . . 10 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (0...(#‘𝑊)) = (0...(#‘(𝐹𝑊))))
1716eleq2d 2716 . . . . . . . . 9 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (𝑁 ∈ (0...(#‘𝑊)) ↔ 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
1817biimpd 219 . . . . . . . 8 ((𝑊 ∈ Word 𝐴𝐹:𝐴𝐵) → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
1918expcom 450 . . . . . . 7 (𝐹:𝐴𝐵 → (𝑊 ∈ Word 𝐴 → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))))
2019com13 88 . . . . . 6 (𝑁 ∈ (0...(#‘𝑊)) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
2120adantl 481 . . . . 5 ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
2221com12 32 . . . 4 (𝑊 ∈ Word 𝐴 → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
23223imp 1275 . . 3 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))
24 swrdvalfn 13472 . . 3 (((𝐹𝑊) ∈ Word 𝐵𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘(𝐹𝑊)))) → ((𝐹𝑊) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
2512, 13, 23, 24syl3anc 1366 . 2 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → ((𝐹𝑊) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
26 3anass 1059 . . . . . . 7 ((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ↔ (𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))))
2726biimpri 218 . . . . . 6 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊)))) → (𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))))
28273adant3 1101 . . . . 5 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))))
29 swrdfv 13469 . . . . . 6 (((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖) = (𝑊‘(𝑖 + 𝑀)))
3029fveq2d 6233 . . . . 5 (((𝑊 ∈ Word 𝐴𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
3128, 30sylan 487 . . . 4 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
32 wrdfn 13351 . . . . . . 7 (𝑊 ∈ Word 𝐴𝑊 Fn (0..^(#‘𝑊)))
33323ad2ant1 1102 . . . . . 6 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑊 Fn (0..^(#‘𝑊)))
3433adantr 480 . . . . 5 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → 𝑊 Fn (0..^(#‘𝑊)))
35 elfzodifsumelfzo 12573 . . . . . . 7 ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑖 ∈ (0..^(𝑁𝑀)) → (𝑖 + 𝑀) ∈ (0..^(#‘𝑊))))
36353ad2ant2 1103 . . . . . 6 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝑖 ∈ (0..^(𝑁𝑀)) → (𝑖 + 𝑀) ∈ (0..^(#‘𝑊))))
3736imp 444 . . . . 5 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝑖 + 𝑀) ∈ (0..^(#‘𝑊)))
38 fvco2 6312 . . . . 5 ((𝑊 Fn (0..^(#‘𝑊)) ∧ (𝑖 + 𝑀) ∈ (0..^(#‘𝑊))) → ((𝐹𝑊)‘(𝑖 + 𝑀)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
3934, 37, 38syl2anc 694 . . . 4 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹𝑊)‘(𝑖 + 𝑀)) = (𝐹‘(𝑊‘(𝑖 + 𝑀))))
4031, 39eqtr4d 2688 . . 3 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)) = ((𝐹𝑊)‘(𝑖 + 𝑀)))
41 fvco2 6312 . . . 4 (((𝑊 substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩))‘𝑖) = (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)))
425, 41sylan 487 . . 3 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩))‘𝑖) = (𝐹‘((𝑊 substr ⟨𝑀, 𝑁⟩)‘𝑖)))
4314ancoms 468 . . . . . . . . . . . . . 14 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (#‘(𝐹𝑊)) = (#‘𝑊))
4443eqcomd 2657 . . . . . . . . . . . . 13 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (#‘𝑊) = (#‘(𝐹𝑊)))
4544oveq2d 6706 . . . . . . . . . . . 12 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (0...(#‘𝑊)) = (0...(#‘(𝐹𝑊))))
4645eleq2d 2716 . . . . . . . . . . 11 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (𝑁 ∈ (0...(#‘𝑊)) ↔ 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
4746biimpd 219 . . . . . . . . . 10 ((𝐹:𝐴𝐵𝑊 ∈ Word 𝐴) → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
4847ex 449 . . . . . . . . 9 (𝐹:𝐴𝐵 → (𝑊 ∈ Word 𝐴 → (𝑁 ∈ (0...(#‘𝑊)) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))))
4948com13 88 . . . . . . . 8 (𝑁 ∈ (0...(#‘𝑊)) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
5049adantl 481 . . . . . . 7 ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 ∈ Word 𝐴 → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
5150com12 32 . . . . . 6 (𝑊 ∈ Word 𝐴 → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝐹:𝐴𝐵𝑁 ∈ (0...(#‘(𝐹𝑊))))))
52513imp 1275 . . . . 5 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → 𝑁 ∈ (0...(#‘(𝐹𝑊))))
5312, 13, 523jca 1261 . . . 4 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → ((𝐹𝑊) ∈ Word 𝐵𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘(𝐹𝑊)))))
54 swrdfv 13469 . . . 4 ((((𝐹𝑊) ∈ Word 𝐵𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘(𝐹𝑊)))) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (((𝐹𝑊) substr ⟨𝑀, 𝑁⟩)‘𝑖) = ((𝐹𝑊)‘(𝑖 + 𝑀)))
5553, 54sylan 487 . . 3 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → (((𝐹𝑊) substr ⟨𝑀, 𝑁⟩)‘𝑖) = ((𝐹𝑊)‘(𝑖 + 𝑀)))
5640, 42, 553eqtr4d 2695 . 2 (((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) ∧ 𝑖 ∈ (0..^(𝑁𝑀))) → ((𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩))‘𝑖) = (((𝐹𝑊) substr ⟨𝑀, 𝑁⟩)‘𝑖))
5710, 25, 56eqfnfvd 6354 1 ((𝑊 ∈ Word 𝐴 ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) ∧ 𝐹:𝐴𝐵) → (𝐹 ∘ (𝑊 substr ⟨𝑀, 𝑁⟩)) = ((𝐹𝑊) substr ⟨𝑀, 𝑁⟩))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 383  w3a 1054   = wceq 1523  wcel 2030  wss 3607  cop 4216  ran crn 5144  ccom 5147   Fn wfn 5921  wf 5922  cfv 5926  (class class class)co 6690  0cc0 9974   + caddc 9977  cmin 10304  ...cfz 12364  ..^cfzo 12504  #chash 13157  Word cword 13323   substr csubstr 13327
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1762  ax-4 1777  ax-5 1879  ax-6 1945  ax-7 1981  ax-8 2032  ax-9 2039  ax-10 2059  ax-11 2074  ax-12 2087  ax-13 2282  ax-ext 2631  ax-rep 4804  ax-sep 4814  ax-nul 4822  ax-pow 4873  ax-pr 4936  ax-un 6991  ax-cnex 10030  ax-resscn 10031  ax-1cn 10032  ax-icn 10033  ax-addcl 10034  ax-addrcl 10035  ax-mulcl 10036  ax-mulrcl 10037  ax-mulcom 10038  ax-addass 10039  ax-mulass 10040  ax-distr 10041  ax-i2m1 10042  ax-1ne0 10043  ax-1rid 10044  ax-rnegex 10045  ax-rrecex 10046  ax-cnre 10047  ax-pre-lttri 10048  ax-pre-lttrn 10049  ax-pre-ltadd 10050  ax-pre-mulgt0 10051
This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-3or 1055  df-3an 1056  df-tru 1526  df-ex 1745  df-nf 1750  df-sb 1938  df-eu 2502  df-mo 2503  df-clab 2638  df-cleq 2644  df-clel 2647  df-nfc 2782  df-ne 2824  df-nel 2927  df-ral 2946  df-rex 2947  df-reu 2948  df-rab 2950  df-v 3233  df-sbc 3469  df-csb 3567  df-dif 3610  df-un 3612  df-in 3614  df-ss 3621  df-pss 3623  df-nul 3949  df-if 4120  df-pw 4193  df-sn 4211  df-pr 4213  df-tp 4215  df-op 4217  df-uni 4469  df-int 4508  df-iun 4554  df-br 4686  df-opab 4746  df-mpt 4763  df-tr 4786  df-id 5053  df-eprel 5058  df-po 5064  df-so 5065  df-fr 5102  df-we 5104  df-xp 5149  df-rel 5150  df-cnv 5151  df-co 5152  df-dm 5153  df-rn 5154  df-res 5155  df-ima 5156  df-pred 5718  df-ord 5764  df-on 5765  df-lim 5766  df-suc 5767  df-iota 5889  df-fun 5928  df-fn 5929  df-f 5930  df-f1 5931  df-fo 5932  df-f1o 5933  df-fv 5934  df-riota 6651  df-ov 6693  df-oprab 6694  df-mpt2 6695  df-om 7108  df-1st 7210  df-2nd 7211  df-wrecs 7452  df-recs 7513  df-rdg 7551  df-1o 7605  df-er 7787  df-en 7998  df-dom 7999  df-sdom 8000  df-fin 8001  df-card 8803  df-pnf 10114  df-mnf 10115  df-xr 10116  df-ltxr 10117  df-le 10118  df-sub 10306  df-neg 10307  df-nn 11059  df-n0 11331  df-z 11416  df-uz 11726  df-fz 12365  df-fzo 12505  df-hash 13158  df-word 13331  df-substr 13335
This theorem is referenced by:  pfxco  41763
  Copyright terms: Public domain W3C validator