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

Theorem swrdval 14284
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 14282 . . 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 6756 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
54adantl 481 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
6 op1stg 7816 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
763adant1 1128 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
85, 7sylan9eqr 2801 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (1st𝑏) = 𝐹)
9 fveq2 6756 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
109adantl 481 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
11 op2ndg 7817 . . . . 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 7273 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((1st𝑏)..^(2nd𝑏)) = (𝐹..^𝐿))
17 simp1 1134 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → 𝑠 = 𝑆)
1817dmeqd 5803 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → dom 𝑠 = dom 𝑆)
1916, 18sseq12d 3950 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠 ↔ (𝐹..^𝐿) ⊆ dom 𝑆))
2015, 14oveq12d 7273 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((2nd𝑏) − (1st𝑏)) = (𝐿𝐹))
2120oveq2d 7271 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (0..^((2nd𝑏) − (1st𝑏))) = (0..^(𝐿𝐹)))
2214oveq2d 7271 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 + (1st𝑏)) = (𝑥 + 𝐹))
2317, 22fveq12d 6763 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑠‘(𝑥 + (1st𝑏))) = (𝑆‘(𝑥 + 𝐹)))
2421, 23mpteq12dv 5161 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))) = (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))))
2519, 24ifbieq1d 4480 . . 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 3440 . . 3 (𝑆𝑉𝑆 ∈ V)
28273ad2ant1 1131 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → 𝑆 ∈ V)
29 opelxpi 5617 . . 3 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
30293adant1 1128 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
31 ovex 7288 . . . . 5 (0..^(𝐿𝐹)) ∈ V
3231mptex 7081 . . . 4 (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))) ∈ V
33 0ex 5226 . . . 4 ∅ ∈ V
3432, 33ifex 4506 . . 3 if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V
3534a1i 11 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V)
362, 26, 28, 30, 35ovmpod 7403 1 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝑆 substr ⟨𝐹, 𝐿⟩) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 395  w3a 1085   = wceq 1539  wcel 2108  Vcvv 3422  wss 3883  c0 4253  ifcif 4456  cop 4564  cmpt 5153   × cxp 5578  dom cdm 5580  cfv 6418  (class class class)co 7255  cmpo 7257  1st c1st 7802  2nd c2nd 7803  0cc0 10802   + caddc 10805  cmin 11135  cz 12249  ..^cfzo 13311   substr csubstr 14281
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1799  ax-4 1813  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2110  ax-9 2118  ax-10 2139  ax-11 2156  ax-12 2173  ax-ext 2709  ax-rep 5205  ax-sep 5218  ax-nul 5225  ax-pr 5347  ax-un 7566
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 844  df-3an 1087  df-tru 1542  df-fal 1552  df-ex 1784  df-nf 1788  df-sb 2069  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2817  df-nfc 2888  df-ne 2943  df-ral 3068  df-rex 3069  df-reu 3070  df-rab 3072  df-v 3424  df-sbc 3712  df-csb 3829  df-dif 3886  df-un 3888  df-in 3890  df-ss 3900  df-nul 4254  df-if 4457  df-sn 4559  df-pr 4561  df-op 4565  df-uni 4837  df-iun 4923  df-br 5071  df-opab 5133  df-mpt 5154  df-id 5480  df-xp 5586  df-rel 5587  df-cnv 5588  df-co 5589  df-dm 5590  df-rn 5591  df-res 5592  df-ima 5593  df-iota 6376  df-fun 6420  df-fn 6421  df-f 6422  df-f1 6423  df-fo 6424  df-f1o 6425  df-fv 6426  df-ov 7258  df-oprab 7259  df-mpo 7260  df-1st 7804  df-2nd 7805  df-substr 14282
This theorem is referenced by:  swrd00  14285  swrdcl  14286  swrdval2  14287  swrdlend  14294  swrdnd  14295  swrdnd2  14296  swrd0  14299  repswswrd  14425
  Copyright terms: Public domain W3C validator