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

Theorem swrdval 13806
 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 13804 . . 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 758 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → 𝑠 = 𝑆)
4 fveq2 6499 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
54adantl 474 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (1st𝑏) = (1st ‘⟨𝐹, 𝐿⟩))
6 op1stg 7513 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
763adant1 1110 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (1st ‘⟨𝐹, 𝐿⟩) = 𝐹)
85, 7sylan9eqr 2837 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (1st𝑏) = 𝐹)
9 fveq2 6499 . . . . 5 (𝑏 = ⟨𝐹, 𝐿⟩ → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
109adantl 474 . . . 4 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩) → (2nd𝑏) = (2nd ‘⟨𝐹, 𝐿⟩))
11 op2ndg 7514 . . . . 5 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
12113adant1 1110 . . . 4 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (2nd ‘⟨𝐹, 𝐿⟩) = 𝐿)
1310, 12sylan9eqr 2837 . . 3 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → (2nd𝑏) = 𝐿)
14 simp2 1117 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (1st𝑏) = 𝐹)
15 simp3 1118 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (2nd𝑏) = 𝐿)
1614, 15oveq12d 6994 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((1st𝑏)..^(2nd𝑏)) = (𝐹..^𝐿))
17 simp1 1116 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → 𝑠 = 𝑆)
1817dmeqd 5624 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → dom 𝑠 = dom 𝑆)
1916, 18sseq12d 3891 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠 ↔ (𝐹..^𝐿) ⊆ dom 𝑆))
2015, 14oveq12d 6994 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → ((2nd𝑏) − (1st𝑏)) = (𝐿𝐹))
2120oveq2d 6992 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (0..^((2nd𝑏) − (1st𝑏))) = (0..^(𝐿𝐹)))
2214oveq2d 6992 . . . . . 6 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 + (1st𝑏)) = (𝑥 + 𝐹))
2317, 22fveq12d 6506 . . . . 5 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑠‘(𝑥 + (1st𝑏))) = (𝑆‘(𝑥 + 𝐹)))
2421, 23mpteq12dv 5012 . . . 4 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))) = (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))))
2519, 24ifbieq1d 4373 . . 3 ((𝑠 = 𝑆 ∧ (1st𝑏) = 𝐹 ∧ (2nd𝑏) = 𝐿) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
263, 8, 13, 25syl3anc 1351 . 2 (((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) ∧ (𝑠 = 𝑆𝑏 = ⟨𝐹, 𝐿⟩)) → if(((1st𝑏)..^(2nd𝑏)) ⊆ dom 𝑠, (𝑥 ∈ (0..^((2nd𝑏) − (1st𝑏))) ↦ (𝑠‘(𝑥 + (1st𝑏)))), ∅) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
27 elex 3434 . . 3 (𝑆𝑉𝑆 ∈ V)
28273ad2ant1 1113 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → 𝑆 ∈ V)
29 opelxpi 5444 . . 3 ((𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
30293adant1 1110 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ⟨𝐹, 𝐿⟩ ∈ (ℤ × ℤ))
31 ovex 7008 . . . . 5 (0..^(𝐿𝐹)) ∈ V
3231mptex 6812 . . . 4 (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))) ∈ V
33 0ex 5068 . . . 4 ∅ ∈ V
3432, 33ifex 4398 . . 3 if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V
3534a1i 11 . 2 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅) ∈ V)
362, 26, 28, 30, 35ovmpod 7118 1 ((𝑆𝑉𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝑆 substr ⟨𝐹, 𝐿⟩) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ∧ wa 387   ∧ w3a 1068   = wceq 1507   ∈ wcel 2050  Vcvv 3416   ⊆ wss 3830  ∅c0 4179  ifcif 4350  ⟨cop 4447   ↦ cmpt 5008   × cxp 5405  dom cdm 5407  ‘cfv 6188  (class class class)co 6976   ∈ cmpo 6978  1st c1st 7499  2nd c2nd 7500  0cc0 10335   + caddc 10338   − cmin 10670  ℤcz 11793  ..^cfzo 12849   substr csubstr 13803 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1758  ax-4 1772  ax-5 1869  ax-6 1928  ax-7 1965  ax-8 2052  ax-9 2059  ax-10 2079  ax-11 2093  ax-12 2106  ax-13 2301  ax-ext 2751  ax-rep 5049  ax-sep 5060  ax-nul 5067  ax-pow 5119  ax-pr 5186  ax-un 7279 This theorem depends on definitions:  df-bi 199  df-an 388  df-or 834  df-3an 1070  df-tru 1510  df-ex 1743  df-nf 1747  df-sb 2016  df-mo 2547  df-eu 2584  df-clab 2760  df-cleq 2772  df-clel 2847  df-nfc 2919  df-ne 2969  df-ral 3094  df-rex 3095  df-reu 3096  df-rab 3098  df-v 3418  df-sbc 3683  df-csb 3788  df-dif 3833  df-un 3835  df-in 3837  df-ss 3844  df-nul 4180  df-if 4351  df-sn 4442  df-pr 4444  df-op 4448  df-uni 4713  df-iun 4794  df-br 4930  df-opab 4992  df-mpt 5009  df-id 5312  df-xp 5413  df-rel 5414  df-cnv 5415  df-co 5416  df-dm 5417  df-rn 5418  df-res 5419  df-ima 5420  df-iota 6152  df-fun 6190  df-fn 6191  df-f 6192  df-f1 6193  df-fo 6194  df-f1o 6195  df-fv 6196  df-ov 6979  df-oprab 6980  df-mpo 6981  df-1st 7501  df-2nd 7502  df-substr 13804 This theorem is referenced by:  swrd00  13807  swrdcl  13808  swrdval2  13809  swrdlend  13821  swrdnd  13822  swrdnd2  13823  swrd0  13826  repswswrd  14003
 Copyright terms: Public domain W3C validator