reserve X for set, R,R1,R2 for Relation;
reserve x,y,z for set;
reserve n,m,k for Nat;

theorem Th16:
  for A being FinSequence st x in rng A holds A <- x in dom A & x = A.(A <- x)
  proof
    let A be FinSequence;
    assume x in rng A; then A"{x} <> {} by FUNCT_1:72; then
    consider y be object such that
A1: y in A"{x} by XBOOLE_0:def 1;
A2: A"{x} c= dom A by RELAT_1:132; then
    y in dom A by A1; then
    reconsider y as Element of NAT;
    defpred P[Nat] means $1 in A"{x};
    y = y; then
A3: ex n st P[n] by A1;
    consider n such that
A4: P[n] & for m st P[m] holds n <= m from NAT_1:sch 5(A3);
A5: A<-x c= n by A4,SETFAM_1:3;
    for z st z in A"{x} holds Segm n c= z
     proof let z;
      assume
A6:      z in A"{x};
       then z in dom A by A2;
       then reconsider z as Element of NAT;
       P[z] by A6;
       then n <= z by A4;
       then Segm n c= Segm z by NAT_1:39;
      hence thesis;
     end;
then
    n c= A<-x by A1,SETFAM_1:5; then
A7: A<-x = n by A5;
    hence A <- x in dom A by A4,FUNCT_1:def 7;
    A.(A<-x) in {x} by A4,A7,FUNCT_1:def 7;
    hence x = A.(A <- x) by TARSKI:def 1;
  end;
