reserve x,y,z for set;
reserve f,f1,f2,f3 for FinSequence,
  p,p1,p2,p3 for set,
  i,k for Nat;

theorem Th2:
  for f being FinSequence holds k in dom f &
  (for i st 1 <= i & i < k holds f.i <> f.k) implies (f.k)..f = k
proof
  let f be FinSequence;
  assume that
A1: k in dom f and
A2: for i st 1 <= i & i < k holds f.i <> f.k;
  assume
A3: f.k..f <> k;
  f.k..f <= k by A1,FINSEQ_4:24;
  then
A4: f.k..f < k by A3,XXREAL_0:1;
A5: f.k in rng f by A1,FUNCT_1:def 3;
  then f.(f.k..f) = f.k by FINSEQ_4:19;
  hence contradiction by A2,A5,A4,FINSEQ_4:21;
end;
