let D be non empty set ; :: thesis: for f, g being FinSequence of D st g is_substring_of f, 0 holds
g is_substring_of f,1

let f, g be FinSequence of D; :: thesis: ( g is_substring_of f, 0 implies g is_substring_of f,1 )
assume A1: g is_substring_of f, 0 ; :: thesis: g is_substring_of f,1
now
per cases ( len g > 0 or len g <= 0 ) ;
case A2: len g > 0 ; :: thesis: g is_substring_of f,1
then consider i being Element of NAT such that
A3: ( 0 <= i & i <= len f & mid f,i,((i -' 1) + (len g)) = g ) by A1, Def7;
A4: len g >= 0 + 1 by A2, NAT_1:13;
now
per cases ( i = 0 or i <> 0 ) ;
case A5: i = 0 ; :: thesis: g is_substring_of f,1
0 - 1 < 0 ;
then A6: i -' 1 = 0 by A5, XREAL_0:def 2;
then A7: (f /^ (0 -' 1)) | (((len g) -' 0 ) + 1) = g by A3, A5, JORDAN3:def 1;
(len g) -' 0 = (len g) - 0 by XREAL_0:def 2
.= len g ;
then A8: f | ((len g) + 1) = g by A5, A6, A7, FINSEQ_5:31;
now
per cases ( (len g) + 1 >= len f or (len g) + 1 < len f ) ;
case A9: (len g) + 1 < len f ; :: thesis: contradiction
dom (f | (Seg ((len g) + 1))) = (dom f) /\ (Seg ((len g) + 1)) by RELAT_1:90
.= (Seg (len f)) /\ (Seg ((len g) + 1)) by FINSEQ_1:def 3
.= Seg ((len g) + 1) by A9, FINSEQ_1:9 ;
then len g = (len g) + 1 by A8, FINSEQ_1:def 3;
hence contradiction ; :: thesis: verum
end;
end;
end;
hence g is_substring_of f,1 ; :: thesis: verum
end;
end;
end;
hence g is_substring_of f,1 ; :: thesis: verum
end;
end;
end;
hence g is_substring_of f,1 ; :: thesis: verum