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

theorem Th63:
  p in rng f & k <= len f & k >= p..f implies f/.k in rng(f:-p)
proof
  assume that
A1: p in rng f and
A2: k <= len f and
A3: k >= p..f;
  set x = f/.k;
  per cases by A3,XXREAL_0:1;
  suppose
A4: k > p..f;
    reconsider q = x as Element of D;
    1 <= p..f by A1,FINSEQ_4:21;
    then 1 <= k by A3,XXREAL_0:2;
    then k in dom f by A2,FINSEQ_3:25;
    then
A5: q in rng(f/^(p..f)) by A4,Th58;
    f:-p = <*p*>^(f/^p..f) by FINSEQ_5:def 2;
    then rng(f:-p) = rng<*p*> \/ rng(f/^p..f) by FINSEQ_1:31;
    hence thesis by A5,XBOOLE_0:def 3;
  end;
  suppose
    k = p..f;
    then x = p by A1,FINSEQ_5:38;
    hence thesis by Th61;
  end;
end;
