
theorem Th14:
  for X being set st X is mutually-disjoint holds Sum Card id X = card union X
proof
  let X be set;
  set D = disjoin Card id X;
  assume A1: X is mutually-disjoint;
  per cases;
  suppose A2: X <> {} & X <> {{}};
    reconsider P = X \ {{}} as a_partition of union X by A1, Th11;
    reconsider U = union X as non empty set by A2, SCMYCIEL:18;
    reconsider P as non empty a_partition of U;
    deffunc e(object) = the Enumeration of ((proj P).$1);
    deffunc F(object) = [e($1).$1, (proj P).$1];
    consider f being Function such that
      A3: dom f = union X & for z being object st z in union X holds f.z = F(z)
      from FUNCT_1:sch 3;
    A4: dom D = dom Card id X by CARD_3:def 3
      .= dom id X by CARD_3:def 2
      .= X;
    :: show that rng f = Union D
    now
      let y be object;
      hereby
        assume y in rng f;
        then consider z being object such that
          A5: z in dom f & f.z = y by FUNCT_1:def 3;
        set x = (proj P).z;
        A6: y = [e(z).z,x] by A3, A5;
        A7: x in P by A3, A5, FUNCT_2:5;
        then A8: D.x = [: card x, {x} :] by Th13;
        A9: D.x in rng D by A4, A7, FUNCT_1:3;
        y in D.x
        proof
          z in x by A3, A5, EQREL_1:def 9;
          then z in dom e(z) by AOFA_I00:6;
          then A10: e(z).z in rng e(z) by FUNCT_1:3;
          x in {x} by TARSKI:def 1;
          hence thesis by A6, A8, A10, ZFMISC_1:def 2;
        end;
        then y in union rng D by A9, TARSKI:def 4;
        hence y in Union D by CARD_3:def 4;
      end;
      assume y in Union D;
      then y in union rng D by CARD_3:def 4;
      then consider Y being set such that
        A11: y in Y & Y in rng D by TARSKI:def 4;
      consider x being object such that
        A12: x in dom D & D.x = Y by A11, FUNCT_1:def 3;
      reconsider x as set by TARSKI:1;
      y in [: card x, {x} :] by A4, A11, A12, Th13;
      then consider a,b being object such that
        A13: a in card x & b in {x} & y = [a,b] by ZFMISC_1:def 2;
      a in rng the Enumeration of x by A13, AOFA_I00:6;
      then consider z being object such that
        A14: z in dom the Enumeration of x and
        A15: (the Enumeration of x).z = a by FUNCT_1:def 3;
      A16: z in x by A14;
      then A17: z in U by A4, A12, TARSKI:def 4;
      not x in {{}} by A16, TARSKI:def 1;
      then x in P by A4, A12, XBOOLE_0:def 5;
      then (proj P).z = x by A16, EQREL_1:65;
      then a = e(z).z & b = (proj P).z by A13, A15, TARSKI:def 1;
      then y = f.z by A3, A13, A17;
      hence y in rng f by A3, A17, FUNCT_1:3;
    end;
    then A18: rng f = Union D by TARSKI:2;
    :: show that f is one-to-one
    now
      let z1,z2 be object;
      assume A19: z1 in dom f & z2 in dom f & f.z1 = f.z2;
      then f.z1 = [e(z1).z1,(proj P).z1] & f.z2 = [e(z2).z2,(proj P).z2] by A3;
      then A20: e(z1).z1 = e(z2).z2 & (proj P).z1 = (proj P).z2
        by A19, XTUPLE_0:1;
      then z1 in (proj P).z1 & z2 in (proj P).z1 by A3, A19, EQREL_1:def 9;
      then z1 in dom e(z1) & z2 in dom e(z1) by AOFA_I00:6;
      hence z1 = z2 by A20, FUNCT_1:def 4;
    end;
    then card Union D = card union X by A3, A18, CARD_1:70, FUNCT_1:def 4;
    hence thesis by CARD_3:def 7;
  end;
  suppose A21: X = {};
    set f = the empty Function;
    thus Sum Card id X
       = card Union disjoin Card id X by CARD_3:def 7
      .= card union rng disjoin Card id X by CARD_3:def 4
      .= card union rng disjoin f by A21
      .= card union X by A21, CARD_3:3;
  end;
  suppose A22: X = {{}};
    thus Sum Card id X
       = card Union disjoin Card id X by CARD_3:def 7
      .= card union rng disjoin Card id X by CARD_3:def 4
      .= card union rng disjoin Card ({} .--> {}) by A22, FUNCT_4:96
      .= card union rng disjoin Card (X --> {}) by A22, FUNCOP_1:def 9
      .= card union rng disjoin (X --> card {}) by CARD_3:2
      .= card union rng disjoin ({} .--> {}) by A22, FUNCOP_1:def 9
      .= card union rng ({} .--> [:{},{{}}:]) by CARD_3:4
      .= card union X by A22, FUNCOP_1:88;
  end;
end;
