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 Th57:
  for Fy,X st dom Fy=X for XF be XFinSequence of NAT st dom XF=
card X & for n st n in dom XF holds ex x,y st x<>y & for f st f in Choose(X,n+1
  ,x,y) holds card(Intersection(Fy,f,x))=XF.n holds ex F be XFinSequence of INT
st dom F=card X & card union rng Fy = Sum F & for n st n in dom F holds F.n=((-
  1)|^n)*XF.n*(card X choose (n+1))
proof
  let Fy,X such that
A1: dom Fy=X;
  let XF be XFinSequence of NAT such that
A2: dom XF=card X & for n st n in dom XF holds ex x,y st x<>y & for f st
  f in Choose(X,n+1,x,y) holds card(Intersection(Fy,f,x))=XF.n;
  defpred f[object,object] means
  for n st n=$1 holds $2=((-1)|^n)*(XF.n)*(card X choose (n+1));
A3: for x being object st x in card X ex y being object st y in INT & f[x,y]
  proof
A4: card X is Subset of NAT by STIRL2_1:8;
    let x be object;
    assume x in card X;
    then reconsider x9=x as Element of NAT by A4;
    reconsider xx=((-1)|^x9)*(XF.x9) as Integer;
    reconsider ch=card X choose (x9+1) as Integer;
    take xx*ch;
    thus thesis by INT_1:def 2;
  end;
  consider F be Function of card X,INT such that
A5: for x being object st x in card X holds f[x,F.x] from FUNCT_2:sch 1(A3);
A6: dom F =card X by FUNCT_2:def 1;
  then reconsider F as XFinSequence by AFINSQ_1:5;
  reconsider F as XFinSequence of INT;
  take F;
  for n st n in dom F holds F.n=((-1)|^n)*Card_Intersection(Fy,n+1)
  proof
    let n such that
A7: n in dom F;
    ex x,y st x<>y & for f st f in Choose(X,n+1,x,y) holds card(
    Intersection(Fy,f,x))=XF.n by A2,A6,A7;
    then
A8: Card_Intersection(Fy,n+1)=(XF.n)*(card X choose (n+1)) by A1,Th56;
    F.n=((-1)|^n)*(XF.n)*(card X choose (n+1)) by A5,A6,A7;
    hence thesis by A8;
  end;
  hence thesis by A1,A5,A6,Th55;
end;
