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

Theorem swrdval 14356
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 14354 . . 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 768 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → 𝑠 = 𝑆)
4 fveq2 6774 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
54adantl 482 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
6 op1stg 7843 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
763adant1 1129 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
85, 7sylan9eqr 2800 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (1st𝑏) = 𝐹)
9 fveq2 6774 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
109adantl 482 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
11 op2ndg 7844 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
12113adant1 1129 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
1310, 12sylan9eqr 2800 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (2nd𝑏) = 𝐿)
14 simp2 1136 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (1st𝑏) = 𝐹)
15 simp3 1137 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (2nd𝑏) = 𝐿)
1614, 15oveq12d 7293 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((1st𝑏)..^(2nd𝑏)) = (𝐹..^𝐿))
17 simp1 1135 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → 𝑠 = 𝑆)
1817dmeqd 5814 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → dom 𝑠 = dom 𝑆)
1916, 18sseq12d 3954 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠 ↔ (𝐹..^𝐿) ⊆ dom 𝑆))
2015, 14oveq12d 7293 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((2nd𝑏) − (1st𝑏)) = (𝐿𝐹))
2120oveq2d 7291 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (0..^((2nd𝑏) − (1st𝑏))) = (0..^(𝐿𝐹)))
2214oveq2d 7291 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 + (1st𝑏)) = (𝑥 + 𝐹))
2317, 22fveq12d 6781 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑠‘(𝑥 + (1st𝑏))) = (𝑆‘(𝑥 + 𝐹)))
2421, 23mpteq12dv 5165 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))) = (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))))
2519, 24ifbieq1d 4483 . . 3 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
263, 8, 13, 25syl3anc 1370 . 2 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
27 elex 3450 . . 3 (𝑆𝑉𝑆 ∈ V)
28273ad2ant1 1132 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → 𝑆 ∈ V)
29 opelxpi 5626 . . 3 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
30293adant1 1129 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
31 ovex 7308 . . . . 5 (0..^(𝐿𝐹)) ∈ V
3231mptex 7099 . . . 4 (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))) ∈ V
33 0ex 5231 . . . 4 ∅ ∈ V
3432, 33ifex 4509 . . 3 if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V
3534a1i 11 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V)
362, 26, 28, 30, 35ovmpod 7425 1 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝑆 substr ⟨𝐹, 𝐿⟩) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 396  w3a 1086   = wceq 1539  wcel 2106  Vcvv 3432  wss 3887  c0 4256  ifcif 4459  cop 4567  cmpt 5157   × cxp 5587  dom cdm 5589  cfv 6433  (class class class)co 7275  cmpo 7277  1st c1st 7829  2nd c2nd 7830  0cc0 10871   + caddc 10874  cmin 11205  cz 12319  ..^cfzo 13382   substr csubstr 14353
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 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2709  ax-rep 5209  ax-sep 5223  ax-nul 5230  ax-pr 5352  ax-un 7588
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 845  df-3an 1088  df-tru 1542  df-fal 1552  df-ex 1783  df-nf 1787  df-sb 2068  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2816  df-nfc 2889  df-ne 2944  df-ral 3069  df-rex 3070  df-reu 3072  df-rab 3073  df-v 3434  df-sbc 3717  df-csb 3833  df-dif 3890  df-un 3892  df-in 3894  df-ss 3904  df-nul 4257  df-if 4460  df-sn 4562  df-pr 4564  df-op 4568  df-uni 4840  df-iun 4926  df-br 5075  df-opab 5137  df-mpt 5158  df-id 5489  df-xp 5595  df-rel 5596  df-cnv 5597  df-co 5598  df-dm 5599  df-rn 5600  df-res 5601  df-ima 5602  df-iota 6391  df-fun 6435  df-fn 6436  df-f 6437  df-f1 6438  df-fo 6439  df-f1o 6440  df-fv 6441  df-ov 7278  df-oprab 7279  df-mpo 7280  df-1st 7831  df-2nd 7832  df-substr 14354
This theorem is referenced by:  swrd00  14357  swrdcl  14358  swrdval2  14359  swrdlend  14366  swrdnd  14367  swrdnd2  14368  swrd0  14371  repswswrd  14497
  Copyright terms: Public domain W3C validator