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

Theorem swrdval 14337
Description: Value of a subword. (Contributed by Stefan O'Rear, 15-Aug-2015.)
Assertion
Ref Expression
swrdval ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝑆 substr ⟨𝐹, 𝐿⟩) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
Distinct variable groups:   𝑥,𝑆   𝑥,𝐹   𝑥,𝐿   𝑥,𝑉

Proof of Theorem swrdval
Dummy variables 𝑠 𝑏 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 df-substr 14335 . . 3 substr = (𝑠 ∈ V, 𝑏 ∈ (ℤ × ℤ) ↦ if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅))
21a1i 11 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → substr = (𝑠 ∈ V, 𝑏 ∈ (ℤ × ℤ) ↦ if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅)))
3 simprl 767 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → 𝑠 = 𝑆)
4 fveq2 6768 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
54adantl 481 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
6 op1stg 7829 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
763adant1 1128 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
85, 7sylan9eqr 2801 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (1st𝑏) = 𝐹)
9 fveq2 6768 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
109adantl 481 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
11 op2ndg 7830 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
12113adant1 1128 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
1310, 12sylan9eqr 2801 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (2nd𝑏) = 𝐿)
14 simp2 1135 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (1st𝑏) = 𝐹)
15 simp3 1136 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (2nd𝑏) = 𝐿)
1614, 15oveq12d 7286 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((1st𝑏)..^(2nd𝑏)) = (𝐹..^𝐿))
17 simp1 1134 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → 𝑠 = 𝑆)
1817dmeqd 5811 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → dom 𝑠 = dom 𝑆)
1916, 18sseq12d 3958 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠 ↔ (𝐹..^𝐿) ⊆ dom 𝑆))
2015, 14oveq12d 7286 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((2nd𝑏) − (1st𝑏)) = (𝐿𝐹))
2120oveq2d 7284 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (0..^((2nd𝑏) − (1st𝑏))) = (0..^(𝐿𝐹)))
2214oveq2d 7284 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 + (1st𝑏)) = (𝑥 + 𝐹))
2317, 22fveq12d 6775 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑠‘(𝑥 + (1st𝑏))) = (𝑆‘(𝑥 + 𝐹)))
2421, 23mpteq12dv 5169 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))) = (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))))
2519, 24ifbieq1d 4488 . . 3 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
263, 8, 13, 25syl3anc 1369 . 2 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
27 elex 3448 . . 3 (𝑆𝑉𝑆 ∈ V)
28273ad2ant1 1131 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → 𝑆 ∈ V)
29 opelxpi 5625 . . 3 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
30293adant1 1128 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
31 ovex 7301 . . . . 5 (0..^(𝐿𝐹)) ∈ V
3231mptex 7093 . . . 4 (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))) ∈ V
33 0ex 5234 . . . 4 ∅ ∈ V
3432, 33ifex 4514 . . 3 if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V
3534a1i 11 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V)
362, 26, 28, 30, 35ovmpod 7416 1 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝑆 substr ⟨𝐹, 𝐿⟩) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 395  w3a 1085   = wceq 1541  wcel 2109  Vcvv 3430  wss 3891  c0 4261  ifcif 4464  cop 4572  cmpt 5161   × cxp 5586  dom cdm 5588  cfv 6430  (class class class)co 7268  cmpo 7270  1st c1st 7815  2nd c2nd 7816  0cc0 10855   + caddc 10858  cmin 11188  cz 12302  ..^cfzo 13364   substr csubstr 14334
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1801  ax-4 1815  ax-5 1916  ax-6 1974  ax-7 2014  ax-8 2111  ax-9 2119  ax-10 2140  ax-11 2157  ax-12 2174  ax-ext 2710  ax-rep 5213  ax-sep 5226  ax-nul 5233  ax-pr 5355  ax-un 7579
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 844  df-3an 1087  df-tru 1544  df-fal 1554  df-ex 1786  df-nf 1790  df-sb 2071  df-mo 2541  df-eu 2570  df-clab 2717  df-cleq 2731  df-clel 2817  df-nfc 2890  df-ne 2945  df-ral 3070  df-rex 3071  df-reu 3072  df-rab 3074  df-v 3432  df-sbc 3720  df-csb 3837  df-dif 3894  df-un 3896  df-in 3898  df-ss 3908  df-nul 4262  df-if 4465  df-sn 4567  df-pr 4569  df-op 4573  df-uni 4845  df-iun 4931  df-br 5079  df-opab 5141  df-mpt 5162  df-id 5488  df-xp 5594  df-rel 5595  df-cnv 5596  df-co 5597  df-dm 5598  df-rn 5599  df-res 5600  df-ima 5601  df-iota 6388  df-fun 6432  df-fn 6433  df-f 6434  df-f1 6435  df-fo 6436  df-f1o 6437  df-fv 6438  df-ov 7271  df-oprab 7272  df-mpo 7273  df-1st 7817  df-2nd 7818  df-substr 14335
This theorem is referenced by:  swrd00  14338  swrdcl  14339  swrdval2  14340  swrdlend  14347  swrdnd  14348  swrdnd2  14349  swrd0  14352  repswswrd  14478
  Copyright terms: Public domain W3C validator