
theorem
  for f,g being FinSequence, n,m being Nat
  st m>=n & g is_substring_of f,m holds g is_substring_of f,n
proof
  let f,g be FinSequence,n,m be Nat;
  assume that
A1: m>=n and
A2: g is_substring_of f,m;
  now per cases;
    case len g>0;
      then consider i being Nat such that
A3:   m<=i and
A4:   i<=len f and
A5:   mid(f,i,(i-'1)+len g)=g by A2;
      n<=i by A1,A3,XXREAL_0:2;
      hence thesis by A4,A5;
    end;
    case len g<=0;
      hence thesis;
    end;
  end;
  hence thesis;
end;
