
theorem Th13:
  for I being non empty set for A being ManySortedSet of I holds 2
  c= card (product A) iff A is non-empty non trivial-yielding
proof
  let I be non empty set;
  let A be ManySortedSet of I;
A1: dom A = I by PARTFUN1:def 2;
  thus 2 c= card (product A) implies A is non-empty non trivial-yielding
  proof
    assume 2 c= card product A;
    then consider a,b being object such that
A2: a in product A and
A3: b in product A and
A4: a<>b by Th2;
    consider a1 being Function such that
A5: a=a1 & dom a1 = dom A and
A6: for e being object st e in dom A holds a1.e in A.e by A2,CARD_3:def 5;
    thus A is non-empty
    by A1,A6;
    consider b1 being Function such that
A7: b=b1 & dom b1 = dom A and
A8: for e being object st e in dom A holds b1.e in A.e by A3,CARD_3:def 5;
    consider e being object such that
A9: e in dom A and
A10: b1.e <> a1.e by A4,A5,A7,FUNCT_1:2;
    thus A is non trivial-yielding
    proof
      take A.e;
      thus A.e in rng A by A9,FUNCT_1:def 3;
      a1.e in A.e & b1.e in A.e by A6,A8,A9;
      then 2 c= card (A.e) by A10,Th2;
      hence thesis by Th4;
    end;
  end;
  assume
A11: A is non-empty non trivial-yielding;
  then consider r being set such that
A12: r in rng A and
A13: r is non trivial;
  now
    assume {} in rng A;
    then ex o being object st o in dom A & A.o = {} by FUNCT_1:def 3;
    hence contradiction by A1,A11;
  end;
  then product A is non empty by CARD_3:26;
  then consider a1 being object such that
A14: a1 in product A;
  consider p being object such that
A15: p in dom A and
A16: r = A.p by A12,FUNCT_1:def 3;
  consider a being Function such that
A17: a=a1 and
A18: dom a = dom A and
A19: for o being object st o in dom A holds a.o in A.o by A14,CARD_3:def 5;
  reconsider a as ManySortedSet of I by A1,A18,PARTFUN1:def 2,RELAT_1:def 18;
  2 c= card r by A13,Th4;
  then consider t being object such that
A20: t in r and
A21: t <> a.p by Th3;
  reconsider p as Element of I by A15,PARTFUN1:def 2;
  set b=a+*(p,t);
A22: now
    let o be object;
    assume
A23: o in dom A;
    per cases;
    suppose
      o<>p;
      then b.o = a.o by FUNCT_7:32;
      hence b.o in A.o by A19,A23;
    end;
    suppose
      o=p;
      hence b.o in A.o by A18,A15,A16,A20,FUNCT_7:31;
    end;
  end;
  dom b = I by PARTFUN1:def 2
    .= dom A by PARTFUN1:def 2;
  then
A24: b in product A by A22,CARD_3:9;
  b.p = t by A18,A15,FUNCT_7:31;
  hence thesis by A14,A17,A21,A24,Th2;
end;
