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

theorem Th61:
  for F be Function st dom F=X & F is one-to-one ex XF be
  XFinSequence of INT st Sum XF=card {h where h is Function of X,rng F: h is
  one-to-one & for x st x in X holds h.x<>F.x}& dom XF = card X +1 & for n st n
  in dom XF holds XF.n=((-1)|^n)*(card X!)/(n!)
proof
  let F9 be Function such that
A1: dom F9=X and
A2: F9 is one-to-one;
  X,rng F9 are_equipotent by A1,A2,WELLORD2:def 4;
  then card X=card rng F9 by CARD_1:5;
  then reconsider rngF=rng F9 as finite set;
  reconsider F=F9 as Function of X,rngF by A1,FUNCT_2:1;
  set S={h where h is Function of X,rng F9: h is one-to-one & for x st x in X
  holds h.x<>F9.x};
  rng F9=rng F;
  then consider Xf be XFinSequence of INT such that
A3: dom Xf = card X and
A4: (card X)!-Sum Xf=card S and
A5: for n st n in dom Xf holds Xf.n=((-1)|^n)*(card X!)/((n+1)!) by A1,A2,Lm4;
  reconsider c = (card X)! as Element of INT by INT_1:def 2;
A6: len <%c%>=1 by AFINSQ_1:33;
  set F1 = (-1)(#)Xf;
A7:  dom F1=card X by A3,VALUED_1:def 5;
reconsider F1 as XFinSequence of INT;
set XF=<%c%>^F1;
  take XF;
  (-1)*Sum Xf =Sum F1 by AFINSQ_2:64;
  then c -Sum Xf=c +Sum F1 .=addint.(c,Sum F1) by BINOP_2:def 20
    .=addint.(addint "**" <%c%>,Sum F1) by AFINSQ_2:37
    .=addint.(addint "**" <%c%>,addint "**" F1) by AFINSQ_2:50
    .=addint "**" XF by AFINSQ_2:42
    .=Sum XF by AFINSQ_2:50;
  hence Sum XF=card S by A4;
  len F1=card X by A3,VALUED_1:def 5;
  hence
A8: dom XF = card X +1 by A6,AFINSQ_1:def 3;
  let n such that
A9: n in dom XF;
  per cases;
  suppose
A10: n=0;
    then ((-1)|^n)=1 by NEWTON:4;
    hence thesis by A10,AFINSQ_1:35,NEWTON:12;
  end;
  suppose
    n>0;
    then reconsider n1=n-1 as Element of NAT by NAT_1:20;
    n1+1=n;
    then
A11: (-1)*((-1)|^n1)=(-1)|^n by NEWTON:6;
    n < len XF by A9,AFINSQ_1:86;
    then n < card X +1 by A8;
    then n1+1 <= card X by NAT_1:13;
    then n1 < len F1 by A7,NAT_1:13;
    then
A12: n1 in dom F1 by AFINSQ_1:86;
    len <% c %>=1 by AFINSQ_1:33;
    then XF.(n1+1)=F1.n1 by A12,AFINSQ_1:def 3;
    then
A13: XF.(n1+1)=(-1)*Xf.n1 by VALUED_1:6;
    Xf.n1=(((-1)|^n1)*(card X!))/((n1+1)!) by A3,A5,A7,A12;
    then XF.n=((-1)*(((-1)|^n1)*(card X!)))/(n!) by A13,XCMPLX_1:74;
    hence thesis by A11;
  end;
end;
