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

Theorem swrdval 13371
 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 13258 . . 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 793 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → 𝑠 = 𝑆)
4 fveq2 6158 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
54adantl 482 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
6 op1stg 7140 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
763adant1 1077 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
85, 7sylan9eqr 2677 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (1st𝑏) = 𝐹)
9 fveq2 6158 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
109adantl 482 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
11 op2ndg 7141 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
12113adant1 1077 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
1310, 12sylan9eqr 2677 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (2nd𝑏) = 𝐿)
14 simp2 1060 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (1st𝑏) = 𝐹)
15 simp3 1061 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (2nd𝑏) = 𝐿)
1614, 15oveq12d 6633 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((1st𝑏)..^(2nd𝑏)) = (𝐹..^𝐿))
17 simp1 1059 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → 𝑠 = 𝑆)
1817dmeqd 5296 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → dom 𝑠 = dom 𝑆)
1916, 18sseq12d 3619 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠 ↔ (𝐹..^𝐿) ⊆ dom 𝑆))
2015, 14oveq12d 6633 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((2nd𝑏) − (1st𝑏)) = (𝐿𝐹))
2120oveq2d 6631 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (0..^((2nd𝑏) − (1st𝑏))) = (0..^(𝐿𝐹)))
2214oveq2d 6631 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 + (1st𝑏)) = (𝑥 + 𝐹))
2317, 22fveq12d 6164 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑠‘(𝑥 + (1st𝑏))) = (𝑆‘(𝑥 + 𝐹)))
2421, 23mpteq12dv 4703 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))) = (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))))
2519, 24ifbieq1d 4087 . . 3 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
263, 8, 13, 25syl3anc 1323 . 2 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
27 elex 3202 . . 3 (𝑆𝑉𝑆 ∈ V)
28273ad2ant1 1080 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → 𝑆 ∈ V)
29 opelxpi 5118 . . 3 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
30293adant1 1077 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
31 ovex 6643 . . . . 5 (0..^(𝐿𝐹)) ∈ V
3231mptex 6451 . . . 4 (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))) ∈ V
33 0ex 4760 . . . 4 ∅ ∈ V
3432, 33ifex 4134 . . 3 if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V
3534a1i 11 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V)
362, 26, 28, 30, 35ovmpt2d 6753 1 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝑆 substr ⟨𝐹, 𝐿⟩) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ∧ wa 384   ∧ w3a 1036   = wceq 1480   ∈ wcel 1987  Vcvv 3190   ⊆ wss 3560  ∅c0 3897  ifcif 4064  ⟨cop 4161   ↦ cmpt 4683   × cxp 5082  dom cdm 5084  ‘cfv 5857  (class class class)co 6615   ↦ cmpt2 6617  1st c1st 7126  2nd c2nd 7127  0cc0 9896   + caddc 9899   − cmin 10226  ℤcz 11337  ..^cfzo 12422   substr csubstr 13250 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1719  ax-4 1734  ax-5 1836  ax-6 1885  ax-7 1932  ax-8 1989  ax-9 1996  ax-10 2016  ax-11 2031  ax-12 2044  ax-13 2245  ax-ext 2601  ax-rep 4741  ax-sep 4751  ax-nul 4759  ax-pow 4813  ax-pr 4877  ax-un 6914 This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3an 1038  df-tru 1483  df-ex 1702  df-nf 1707  df-sb 1878  df-eu 2473  df-mo 2474  df-clab 2608  df-cleq 2614  df-clel 2617  df-nfc 2750  df-ne 2791  df-ral 2913  df-rex 2914  df-reu 2915  df-rab 2917  df-v 3192  df-sbc 3423  df-csb 3520  df-dif 3563  df-un 3565  df-in 3567  df-ss 3574  df-nul 3898  df-if 4065  df-sn 4156  df-pr 4158  df-op 4162  df-uni 4410  df-iun 4494  df-br 4624  df-opab 4684  df-mpt 4685  df-id 4999  df-xp 5090  df-rel 5091  df-cnv 5092  df-co 5093  df-dm 5094  df-rn 5095  df-res 5096  df-ima 5097  df-iota 5820  df-fun 5859  df-fn 5860  df-f 5861  df-f1 5862  df-fo 5863  df-f1o 5864  df-fv 5865  df-ov 6618  df-oprab 6619  df-mpt2 6620  df-1st 7128  df-2nd 7129  df-substr 13258 This theorem is referenced by:  swrd00  13372  swrdcl  13373  swrdval2  13374  swrdlend  13385  swrdnd  13386  swrdnd2  13387  swrd0  13388  repswswrd  13484
 Copyright terms: Public domain W3C validator