reserve k,n for Nat,
  x,y,z,y1,y2 for object,X,Y for set,
  f,g for Function;
reserve p,q,r,s,t for XFinSequence;
reserve D for set;

theorem
  for p being XFinSequence, i being Element of NAT, x being set holds
  len Replace(p,i,x) = len p & (i < len p implies Replace(p,i,x).i = x) & for j
  being Element of NAT st j <> i holds Replace(p,i,x).j = p.j
proof
  let p be XFinSequence;
  let i be Element of NAT, x be set;
  set f = Replace(p,i,x);
  thus len f = len p by FUNCT_7:30;
  i < len p implies not Segm len p c= Segm i by NAT_1:39;
  hence i < len p implies f.i = x by FUNCT_7:31,ORDINAL1:16;
  thus thesis by FUNCT_7:32;
end;
