reserve S for non empty non void ManySortedSign;
reserve X for non-empty ManySortedSet of S;
reserve x,y,z for set, i,j for Nat;

theorem
  for S being set
  for X being countable ManySortedSet of S
  ex Y being ManySortedSubset of S-->NAT,
  w being ManySortedFunction of X, S-->NAT st
  w is "1-1" & Y = rngs w &
  for x st x in S holds w.x is Enumeration of X.x & Y.x = card(X.x)
  proof let S be set;
    let X be countable ManySortedSet of S;
    set Y = S-->NAT;
    deffunc F(object) = the Enumeration of X.$1;
    consider w being  ManySortedSet of S such that
A1: for s being object st s in S holds w.s = F(s) from PBOOLE:sch 4;
    w is Function-yielding
    proof
      let x be object; assume x in dom w;
      then w.x = F(x) by A1;
      hence thesis;
    end;
    then reconsider w as ManySortedFunction of S;
    w is ManySortedFunction of X,Y
    proof
      let x be object; assume
A2:   x in S;
A3:   card (X.x) c= NAT by CARD_3:def 14;
A4:   w.x = F(x) by A1,A2;
      then
A5:   dom (w.x) = X.x by AOFA_I00:6;
A6:   Y.x = NAT by A2,FUNCOP_1:7;
      rng (w.x) c= Y.x by A4,A3,A6,AOFA_I00:6;
      hence thesis by A5,FUNCT_2:2;
    end;
    then reconsider w as ManySortedFunction of X,Y;
    reconsider Z = rngs w as ManySortedSubset of Y by Th19;
    take Z,w;
    thus w is "1-1"
    proof
      let x; let f be Function;
      assume x in dom w;
      then w.x = F(x) by A1;
      hence thesis;
    end;
    thus Z = rngs w;
    let x; assume x in S;
    then w.x = F(x) & Z.x = rng(w.x) by A1,MSSUBFAM:13;
    hence w.x is Enumeration of X.x & Z.x = card(X.x) by AOFA_I00:6;
  end;
