
theorem Th2:
  for E being non empty finite set, k being Element of NAT, x1,x2
being set st x1<>x2 holds card Choose(E,k,x1,x2) = card the_subsets_of_card(k,E
  )
proof
  let E be non empty finite set;
  let k be Element of NAT;
  let x1,x2 be set;
  set f = {[fX,X] where fX is Function of E,{x1,x2}, X is Subset of E: card (
  fX"{x1}) = k & fX"{x1} = X};
  now
    let x be object;
    assume x in f;
    then consider y be Function of E,{x1,x2}, z be Subset of E such that
A1: x = [y,z] and
    card (y"{x1}) = k and
    y"{x1} = z;
    reconsider y,z as object;
    take y,z;
    thus x = [y,z] by A1;
  end;
  then reconsider f as Relation-like set by RELAT_1:def 1;
  now
    let x,y1,y2 be object;
    assume [x,y1] in f;
    then consider fX1 be Function of E,{x1,x2}, X1 be Subset of E such that
A2: [x,y1]=[fX1,X1] and
    card (fX1"{x1}) = k and
A3: fX1"{x1} = X1;
A4: x=fX1 by A2,XTUPLE_0:1;
    assume [x,y2] in f;
    then consider fX2 be Function of E,{x1,x2}, X2 be Subset of E such that
A5: [x,y2]=[fX2,X2] and
    card (fX2"{x1}) = k and
A6: fX2"{x1} = X2;
    x=fX2 by A5,XTUPLE_0:1;
    hence y1 = y2 by A2,A3,A5,A6,A4,XTUPLE_0:1;
  end;
  then reconsider f as Function by FUNCT_1:def 1;
  assume
A7: x1<>x2;
  now
    let y1,y2 be object;
    assume that
A8: y1 in dom f and
A9: y2 in dom f;
    assume
A10: f.y1 = f.y2;
    [y2,f.y2] in f by A9,FUNCT_1:1;
    then consider fX2 be Function of E,{x1,x2}, X2 be Subset of E such that
A11: [y2,f.y2]=[fX2,X2] and
    card (fX2"{x1}) = k and
A12: fX2"{x1} = X2;
A13: y2=fX2 by A11,XTUPLE_0:1;
    [y1,f.y1] in f by A8,FUNCT_1:1;
    then consider fX1 be Function of E,{x1,x2}, X1 be Subset of E such that
A14: [y1,f.y1]=[fX1,X1] and
    card (fX1"{x1}) = k and
A15: fX1"{x1} = X1;
    dom fX1 = E by FUNCT_2:def 1;
    then
A16: dom fX1 = dom fX2 by FUNCT_2:def 1;
    f.y1=X1 by A14,XTUPLE_0:1;
    then
A17: fX1"{x1} = fX2"{x1} by A10,A15,A11,A12,XTUPLE_0:1;
A18: for z being object st z in dom fX1 holds fX1.z = fX2.z
    proof
      given z be object such that
A19:  z in dom fX1 and
A20:  fX1.z <> fX2.z;
A21:  fX1.z in {x1,x2} by A19,FUNCT_2:5;
      fX2.z in {x1,x2} by A19,FUNCT_2:5;
      then
A22:  fX2.z = x1 or fX2.z = x2 by TARSKI:def 2;
      per cases by A20,A21,A22,TARSKI:def 2;
      suppose
A23:    fX1.z = x1 & fX2.z = x2;
        then
A24:    fX1.z in {x1} by TARSKI:def 1;
        [z,fX1.z] in fX1 by A19,FUNCT_1:1;
        then z in fX2"{x1} by A17,A24,RELAT_1:def 14;
        then consider z9 be object such that
A25:    [z,z9] in fX2 and
A26:    z9 in {x1} by RELAT_1:def 14;
        z9 = fX2.z by A25,FUNCT_1:1;
        hence contradiction by A7,A23,A26,TARSKI:def 1;
      end;
      suppose
A27:    fX1.z = x2 & fX2.z = x1;
        then
A28:    fX2.z in {x1} by TARSKI:def 1;
        [z,fX2.z] in fX2 by A16,A19,FUNCT_1:1;
        then z in fX1"{x1} by A17,A28,RELAT_1:def 14;
        then consider z9 be object such that
A29:    [z,z9] in fX1 and
A30:    z9 in {x1} by RELAT_1:def 14;
        z9 = fX1.z by A29,FUNCT_1:1;
        hence contradiction by A7,A27,A30,TARSKI:def 1;
      end;
    end;
    y1=fX1 by A14,XTUPLE_0:1;
    hence y1 = y2 by A13,A16,A18,FUNCT_1:2;
  end;
  then
A31: f is one-to-one by FUNCT_1:def 4;
  for y being object holds y in the_subsets_of_card(k,E) iff
     ex x being object st [x,y] in f
  proof
    let y be object;
    hereby
      assume y in the_subsets_of_card(k,E);
      then consider X be Subset of E such that
A32:  y=X & card X = k;
      defpred P[set,set] means ($1 in X & $2=x1) or (not $1 in X & $2=x2);
A33:  for z1 being Element of E ex z2 being Element of {x1,x2} st P[z1,z2 ]
      proof
        let z1 be Element of E;
        per cases;
        suppose
A34:      z1 in X;
          reconsider z2=x1 as Element of {x1,x2} by TARSKI:def 2;
          take z2;
          thus thesis by A34;
        end;
        suppose
A35:      not z1 in X;
          reconsider z2=x2 as Element of {x1,x2} by TARSKI:def 2;
          take z2;
          thus thesis by A35;
        end;
      end;
      ex f being Function of E,{x1,x2} st for z being Element of E holds
      P[z,f.z] from FUNCT_2:sch 3(A33);
      then consider f9 be Function of E,{x1,x2} such that
A36:  for z being Element of E holds P[z,f9.z];
      reconsider x=f9 as object;
      take x;
      now
        let z be object;
        hereby
          assume
A37:      z in X;
          then reconsider z9=z as Element of E;
          set z99=f9.z9;
          z in E by A37;
          then z in dom f9 by FUNCT_2:def 1;
          then
A38:      [z,f9.z] in f9 by FUNCT_1:1;
          f9.z9=x1 by A36,A37;
          then z99 in {x1} by TARSKI:def 1;
          hence z in f9"{x1} by A38,RELAT_1:def 14;
        end;
        assume z in f9"{x1};
        then consider z9 be object such that
A39:    [z,z9] in f9 and
A40:    z9 in {x1} by RELAT_1:def 14;
        z in dom f9 by A39,XTUPLE_0:def 12;
        then reconsider z99=z as Element of E;
        z9=x1 by A40,TARSKI:def 1;
        then f9.z99 = x1 by A39,FUNCT_1:1;
        hence z in X by A7,A36;
      end;
      then X = f9"{x1} by TARSKI:2;
      hence [x,y] in f by A32;
    end;
    given x be object such that
A41: [x,y] in f;
    consider fX be Function of E,{x1,x2}, X be Subset of E such that
A42: [x,y]=[fX,X] and
A43: card (fX"{x1}) = k & fX"{x1} = X by A41;
    y = X by A42,XTUPLE_0:1;
    hence thesis by A43;
  end;
  then
A44: rng f = the_subsets_of_card(k,E) by XTUPLE_0:def 13;
  for x being object holds x in Choose(E,k,x1,x2) iff
    ex y being object st [x,y] in f
  proof
    let x be object;
    thus x in Choose(E,k,x1,x2) implies
      ex y being object st [x,y] in f
    proof
      assume x in Choose(E,k,x1,x2);
      then consider fX be Function of E,{x1,x2} such that
A45:  fX = x & card (fX"{x1})=k by CARD_FIN:def 1;
      set y = fX"{x1};
      take y;
      thus thesis by A45;
    end;
    thus (ex y being object st [x,y] in f)
      implies x in Choose(E,k,x1,x2)
    proof
      given y be object such that
A46:  [x,y] in f;
      consider fX be Function of E,{x1,x2}, X be Subset of E such that
A47:  [x,y]=[fX,X] and
A48:  card (fX"{x1}) = k and
      fX"{x1} = X by A46;
      x=fX by A47,XTUPLE_0:1;
      hence thesis by A48,CARD_FIN:def 1;
    end;
  end;
  then dom f = Choose(E,k,x1,x2) by XTUPLE_0:def 12;
  then Choose(E,k,x1,x2), the_subsets_of_card(k,E) are_equipotent by A31,A44;
  hence thesis by CARD_1:5;
end;
