reserve x, x1, x2, y, z, X9 for set,
  X, Y for finite set,
  n, k, m for Nat,
  f for Function;

theorem Th1:
  for X,Y,x,y st (Y={} implies X={}) & not x in X holds card Funcs(
  X,Y) = card{F where F is Function of X\/{x},Y\/{y}:rng (F|X) c=Y & F.x=y}
proof
  defpred P[set,set,set] means 1=1;
  let X,Y,x,y;
  assume
A1: Y={} implies X={};
  set F2={f where f is Function of (X\/{x}),(Y\/{y}): P[f,X\/{x},Y\/{y}]&rng (
  f|X) c=Y & f.x=y};
A2: for f be Function of X\/{x},Y\/{y} st f.x=y holds P[f,X\/{x},Y\/{y}] iff
  P[f|X,X,Y];
  set F1={f where f is Function of X,Y:P[f,X,Y]};
  assume
A3: not x in X;
  set F3={F where F is Function of X\/{x},Y\/{y}:rng (F|X) c=Y & F.x=y};
A4: Funcs(X,Y) c= F1
  proof
    let F be object;
    assume F in Funcs(X,Y);
    then F is Function of X,Y by FUNCT_2:66;
    hence thesis;
  end;
A5: F2 c= F3
  proof
    let F be object;
    assume F in F2;
    then
    ex f be Function of (X\/{x}),(Y\/{y}) st f=F & P[f,X\/{x},Y\/{y}]&rng
    (f|X) c=Y & f.x=y;
    hence thesis;
  end;
A6: Y is empty implies X is empty by A1;
A7: card F1=card F2 from STIRL2_1:sch 4(A6,A3,A2);
A8: F3 c= F2
  proof
    let F be object;
    assume F in F3;
    then ex f be Function of (X\/{x}),(Y\/{y}) st f=F & rng (f|X) c=Y & f.x=y;
    hence thesis;
  end;
  F1 c= Funcs(X,Y)
  proof
    let F be object;
    assume F in F1;
    then ex f be Function of X,Y st f=F & P[f,X,Y];
    hence thesis by A1,FUNCT_2:8;
  end;
  then Funcs(X,Y) = F1 by A4;
  hence thesis by A5,A8,A7,XBOOLE_0:def 10;
end;
