Metamath Proof Explorer


Theorem swrdf1

Description: Condition for a subword to be injective. (Contributed by Thierry Arnoux, 12-Dec-2023)

Ref Expression
Hypotheses swrdf1.w φ W Word D
swrdf1.m φ M 0 N
swrdf1.n φ N 0 W
swrdf1.1 φ W : dom W 1-1 D
Assertion swrdf1 φ W substr M N : dom W substr M N 1-1 D

Proof

Step Hyp Ref Expression
1 swrdf1.w φ W Word D
2 swrdf1.m φ M 0 N
3 swrdf1.n φ N 0 W
4 swrdf1.1 φ W : dom W 1-1 D
5 swrdf W Word D M 0 N N 0 W W substr M N : 0 ..^ N M D
6 1 2 3 5 syl3anc φ W substr M N : 0 ..^ N M D
7 6 ffdmd φ W substr M N : dom W substr M N D
8 fzossz 0 ..^ N M
9 simpllr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i dom W substr M N
10 6 fdmd φ dom W substr M N = 0 ..^ N M
11 10 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j dom W substr M N = 0 ..^ N M
12 9 11 eleqtrd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i 0 ..^ N M
13 8 12 sselid φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i
14 13 zcnd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i
15 simplr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j j dom W substr M N
16 15 11 eleqtrd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j j 0 ..^ N M
17 8 16 sselid φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j j
18 17 zcnd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j j
19 2 elfzelzd φ M
20 19 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j M
21 20 zcnd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j M
22 4 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j W : dom W 1-1 D
23 elfzuz M 0 N M 0
24 fzoss1 M 0 M ..^ N 0 ..^ N
25 2 23 24 3syl φ M ..^ N 0 ..^ N
26 elfzuz3 N 0 W W N
27 fzoss2 W N 0 ..^ N 0 ..^ W
28 3 26 27 3syl φ 0 ..^ N 0 ..^ W
29 25 28 sstrd φ M ..^ N 0 ..^ W
30 29 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j M ..^ N 0 ..^ W
31 3 elfzelzd φ N
32 31 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j N
33 fzoaddel2 i 0 ..^ N M N M i + M M ..^ N
34 12 32 20 33 syl3anc φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i + M M ..^ N
35 30 34 sseldd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i + M 0 ..^ W
36 wrddm W Word D dom W = 0 ..^ W
37 1 36 syl φ dom W = 0 ..^ W
38 37 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j dom W = 0 ..^ W
39 35 38 eleqtrrd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i + M dom W
40 fzoaddel2 j 0 ..^ N M N M j + M M ..^ N
41 16 32 20 40 syl3anc φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j j + M M ..^ N
42 30 41 sseldd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j j + M 0 ..^ W
43 42 38 eleqtrrd φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j j + M dom W
44 simpr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j W substr M N i = W substr M N j
45 1 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j W Word D
46 2 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j M 0 N
47 3 ad3antrrr φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j N 0 W
48 swrdfv W Word D M 0 N N 0 W i 0 ..^ N M W substr M N i = W i + M
49 45 46 47 12 48 syl31anc φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j W substr M N i = W i + M
50 swrdfv W Word D M 0 N N 0 W j 0 ..^ N M W substr M N j = W j + M
51 45 46 47 16 50 syl31anc φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j W substr M N j = W j + M
52 44 49 51 3eqtr3d φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j W i + M = W j + M
53 f1veqaeq W : dom W 1-1 D i + M dom W j + M dom W W i + M = W j + M i + M = j + M
54 53 anassrs W : dom W 1-1 D i + M dom W j + M dom W W i + M = W j + M i + M = j + M
55 54 imp W : dom W 1-1 D i + M dom W j + M dom W W i + M = W j + M i + M = j + M
56 22 39 43 52 55 syl1111anc φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i + M = j + M
57 14 18 21 56 addcan2ad φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i = j
58 57 ex φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i = j
59 58 anasss φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i = j
60 59 ralrimivva φ i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i = j
61 dff13 W substr M N : dom W substr M N 1-1 D W substr M N : dom W substr M N D i dom W substr M N j dom W substr M N W substr M N i = W substr M N j i = j
62 7 60 61 sylanbrc φ W substr M N : dom W substr M N 1-1 D