reserve D,D1,D2 for non empty set,
        d,d1,d2 for XFinSequence of D,
        n,k,i,j for Nat;
reserve A,B for object,
        v for Element of (n+k)-tuples_on {A,B},
        f,g for FinSequence;

theorem
  card Domin_0(n+k,k) = card DominatedElection(0,n+1,1,k)
proof
  set D=Domin_0(n+k,k),B=DominatedElection(0,n+1,1,k);
  set Z=<*0*>;
  defpred F[object,object] means for d be XFinSequence of NAT st d=$1
    holds $2=Z^(XFS2FS d);
  A1:for x being object st x in D ex y being object st y in B & F[x,y]
  proof
    let x be object;
    assume
A2:   x in D;
    then consider p be XFinSequence of NAT such that
A3:   p = x  and
      p is dominated_by_0 & dom p = n+k & Sum p = k by CATALAN2:def 2;
    take y = Z^(XFS2FS p);
    thus thesis by Th24,A3,A2;
  end;
  consider f be Function of D,B such that
A4:for x being object st x in D holds F[x,f.x] from FUNCT_2:sch 1(A1);
  per cases;
  suppose B <>{};
    then
A5:   dom f = D by FUNCT_2:def 1;
    B c= rng f
    proof
      let y be object;
      assume
A6:     y in B;
      then y in Election(0,n+1,1,k);
      then reconsider g=y as Element of (n+1+k)-tuples_on {0,1};
      g is (0,n+1,1,k)-dominated-election by A6,Def3;
      then
A7:     g.1 = 0 by Th23;
      consider d be Element of {0,1}, dg be FinSequence of {0,1} such that
A8:     d = g.1
      and
A9:     g = <*d*>^dg by FINSEQ_3:102;
      {0,1} c= NAT;
      then rng FS2XFS dg c= NAT;
      then reconsider G=FS2XFS dg as XFinSequence of NAT by RELAT_1:def 19;
A10:    XFS2FS G = dg;
      then
A11:    G in D by A6,A8,A9,A7,Th24;
      f.G = g by A10,A6,A8,A9,A7,Th24,A4;
      hence thesis by A11,A5,FUNCT_1:def 3;
    end;
    then
A12:  rng f = B;
    f is one-to-one
    proof
      let x1,x2 be object such that
A13:      x1 in dom f
        and
A14:      x2 in dom f
        and
A15:      f.x1 = f.x2;
      consider p1 be XFinSequence of NAT such that
A16:      p1 = x1
        and
          p1 is dominated_by_0 & dom p1 = n+k & Sum p1 = k
        by A13,CATALAN2:def 2;
      consider p2 be XFinSequence of NAT such that
A17:      p2 = x2
        and
          p2 is dominated_by_0 & dom p2 = n+k & Sum p2 = k
        by A14,CATALAN2:def 2;
A18:  f.p1 = Z^(XFS2FS p1) by A16, A13,A4;
      f.p2 = Z^(XFS2FS p2) by A14,A17,A4;
      then XFS2FS p1 = XFS2FS p2 by A18,A15,A16,A17,FINSEQ_1:33;
      hence thesis by Th4,A16,A17;
    end;
    hence thesis by WELLORD2:def 4,A5,A12,CARD_1:5;
  end;
  suppose
A19:  B={};
    D={}
    proof
      assume D<>{};
      then consider x be object such that
A20:    x in D by XBOOLE_0:def 1;
      ex y being object st y in B & F[x,y] by A20,A1;
      hence thesis by A19;
    end;
    hence thesis by A19;
  end;
end;
