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 Th86:
  p is one-to-one implies len(p - A) = len p - card(A /\ rng p)
proof
A1: p " A c= dom p by RELAT_1:132;
  assume
A2: p is one-to-one;
  p " A,A /\ rng p are_equipotent
  proof
    deffunc F(object) = p.$1;
    consider f being Function such that
A3: dom f = p " A and
A4: for x being object st x in p " A holds f.x = F(x) from FUNCT_1:sch 3;
    take f;
    thus f is one-to-one
    proof
      let x,y be object;
      assume that
A5:   x in dom f and
A6:   y in dom f and
A7:   f.x = f.y;
A8:   f.y = p.y by A3,A4,A6;
      p.x = f.x by A3,A4,A5;
      hence thesis by A2,A1,A3,A5,A6,A7,A8;
    end;
    thus dom f = p " A by A3;
    thus rng f c= A /\ rng p
    proof
      let x be object;
      assume x in rng f;
      then consider y being object such that
A9:   y in dom f and
A10:  f.y = x by FUNCT_1:def 3;
A11:  p.y in A by A3,A9,FUNCT_1:def 7;
      y in dom p by A3,A9,FUNCT_1:def 7;
      then
A12:  p.y in rng p by FUNCT_1:def 3;
      p.y = f.y by A3,A4,A9;
      hence thesis by A10,A11,A12,XBOOLE_0:def 4;
    end;
    let x be object;
    assume
A13: x in A /\ rng p;
    then x in rng p by XBOOLE_0:def 4;
    then consider y being object such that
A14: y in dom p and
A15: p.y = x by FUNCT_1:def 3;
    p.y in A by A13,A15,XBOOLE_0:def 4;
    then
A16: y in p " A by A14,FUNCT_1:def 7;
    then f.y = x by A4,A15;
    hence thesis by A3,A16,FUNCT_1:def 3;
  end;
  then card(p " A) = card(A /\ rng p) by CARD_1:5;
  hence thesis by Th57;
end;
