reserve f for Function;
reserve p,q for FinSequence;
reserve A,B,C for set,x,x1,x2,y,z for object;
reserve k,l,m,n for Nat;
reserve a for Nat;
reserve D for non empty set;
reserve d,d1,d2,d3 for Element of D;

theorem Th24:
  for k st k in dom p & k < x..p holds p.k <> x
proof
  let k;
  set q = Sgm(p " {x});
  assume that
A1: k in dom p and
A2: k < x..p and
A3: p.k = x;
A4: x in {x} by TARSKI:def 1;
    p " {x} c= dom p & dom p = Seg(len p) by FINSEQ_1:def 3,RELAT_1:132;
    then
a1: p"{x} is included_in_Seg;
  then rng q = p " {x} by FINSEQ_1:def 14;
  then k in rng q by A1,A3,A4,FUNCT_1:def 7;
  then consider y being object such that
A6: y in dom q and
A7: q.y = k by FUNCT_1:def 3;
  reconsider y as Element of NAT by A6;
A8: now
    assume not 1 < y;
    then 1 = y or y < 1 by XXREAL_0:1;
    hence contradiction by A2,A6,A7,FINSEQ_3:24,NAT_1:14;
  end;
  dom q = Seg(len q) by FINSEQ_1:def 3;
  then y <= len q by A6,FINSEQ_1:1;
  hence contradiction by a1,A2,A7,A8,FINSEQ_1:def 14;
end;
