
theorem Th39:
  for n being non zero Nat, p being RelStr-yielding ManySortedSet of n
  holds product p is non empty iff p is non-Empty
proof
  let n be non zero Nat, p be RelStr-yielding ManySortedSet of n;
  hereby
    assume product p is non empty;
    then product Carrier p is non empty by YELLOW_1:def 4;
    then consider z being object such that
A1: z in product Carrier p by XBOOLE_0:def 1;
A2: ex g being Function st ( z = g)&( dom g = dom (Carrier p))&
( for i being object st i in dom (Carrier p) holds g.i in (Carrier p).i)
by A1,
CARD_3:def 5;
    now
      let S be 1-sorted;
      assume S in rng p;
      then consider x being object such that
A3:   x in dom p and
A4:   S = p.x by FUNCT_1:def 3;
A5:   x in n by A3;
      then
A6:   x in dom (Carrier p) by PARTFUN1:def 2;
      ex R being 1-sorted st ( R = p.x)&( (Carrier p).x = the
      carrier of R) by A5,PRALG_1:def 15;
      hence S is non empty by A2,A4,A6;
    end;
    hence p is non-Empty by WAYBEL_3:def 7;
  end;
  assume
A7: p is non-Empty;
A8: dom Carrier p = n by PARTFUN1:def 2;
    :: Funkcja Kuratowskiego !!!
  deffunc F(object) = the Element of (Carrier p).$1;
  consider g being Function such that
A9: dom g = dom Carrier p and
  A10: for
 i being object st i in dom Carrier p holds g.i = F(i) from FUNCT_1:sch 3;
  set x = g;
  now
    take g;
    thus x = g;
    thus dom g = dom Carrier p by A9;
    thus
    for i being object st i in dom Carrier p holds g.i in (Carrier p).i
    proof
      let i be object such that
A11:  i in dom Carrier p;
      i in dom p by A8,A11,PARTFUN1:def 2;
      then
A12:  p.i in rng p by FUNCT_1:def 3;
      then reconsider pi1 = p.i as RelStr by YELLOW_1:def 3;
      pi1 is non empty by A7,A12,WAYBEL_3:def 7;
      then
A13:  the carrier of pi1 is non empty;
      i in n by A11;
      then
A14:  ex R being 1-sorted st ( R = p.i)&( (Carrier p).i = the
      carrier of R) by PRALG_1:def 15;
      g.i = the Element of (Carrier p).i by A10,A11;
      hence thesis by A13,A14;
    end;
  end;
  then product Carrier p is non empty by CARD_3:def 5;
  hence thesis by YELLOW_1:def 4;
end;
