reserve p,q,r for FinSequence;
reserve u,v,x,y,y1,y2,z for object, A,D,X,Y for set;
reserve i,j,k,l,m,n for Nat;

theorem Th63:
  rng(p - A) = rng p \ A
proof
  set q = Sgm(Seg(len p) \ p " A);
A1: dom p = Seg len p by FINSEQ_1:def 3;
  thus rng(p - A) c= rng p \ A
  proof
    let x be object;
A3: rng(p * q) c= rng p by RELAT_1:26;
    assume
A4: x in rng(p - A);
A5: now
      assume
A7:   x in A;
      consider y being object such that
A8:   y in dom(p - A) and
A9:   (p - A).y = x by A4,FUNCT_1:def 3;
      set z = q.y;
A10:  y in dom q by A1,A8,FUNCT_1:11;
      then
A11:  (p - A).y = p.z by A1,FUNCT_1:13;
      z in rng q by A10,FUNCT_1:def 3;
      then z in Seg(len p) \ p " A by FINSEQ_1:def 14;
      then
A12:  not z in p " A by XBOOLE_0:def 5;
      z in dom p by A1,A8,FUNCT_1:11;
      hence contradiction by A7,A9,A11,A12,FUNCT_1:def 7;
    end;
    x in rng(p * q) by A4,FINSEQ_1:def 3;
    hence thesis by A3,A5,XBOOLE_0:def 5;
  end;
  let x be object;
  assume
A13: x in rng p \ A;
  then consider y being object such that
A14: y in dom p and
A15: p.y = x by FUNCT_1:def 3;
A16: rng q = Seg(len p) \ p " A by FINSEQ_1:def 14;
  not p.y in A by A13,A15,XBOOLE_0:def 5;
  then not y in p " A by FUNCT_1:def 7;
  then y in rng q by A14,A1,A16,XBOOLE_0:def 5;
  then consider z being object such that
A17: z in dom q and
A18: q.z = y by FUNCT_1:def 3;
A19: (p - A).z = x by A1,A15,A17,A18,FUNCT_1:13;
  z in dom(p - A) by A1,A14,A17,A18,FUNCT_1:11;
  hence thesis by A19,FUNCT_1:def 3;
end;
