reserve S for non void non empty ManySortedSign,
  U0 for MSAlgebra over S;
reserve S for non void non empty ManySortedSign,
  X for ManySortedSet of the carrier of S,
  o for OperSymbol of S,
  b for Element of ([:the carrier' of S,{the
  carrier of S}:] \/ Union (coprod X))*;
reserve x for set;

theorem Th11:
  for S be non void non empty ManySortedSign, X be non-empty
ManySortedSet of the carrier of S holds union rng (FreeSort X) = TS (DTConMSA(X
  ))
proof
  let S be non void non empty ManySortedSign, X be non-empty ManySortedSet of
  the carrier of S;
  set D = DTConMSA(X);
A1: dom (FreeSort X) = the carrier of S by PARTFUN1:def 2;
  thus union rng (FreeSort X) c= TS D
  proof
    let x be object;
    assume x in union rng (FreeSort X);
    then consider A be set such that
A2: x in A and
A3: A in rng (FreeSort X) by TARSKI:def 4;
    consider s be object such that
A4: s in dom (FreeSort X) and
A5: (FreeSort X).s = A by A3,FUNCT_1:def 3;
    reconsider s as SortSymbol of S by A4;
    A = FreeSort(X,s) by A5,Def11
      .= {a where a is Element of TS(D): (ex x be set st x in X.s & a =
root-tree [x,s]) or ex o1 be OperSymbol of S st [o1,the carrier of S] = a.{} &
    the_result_sort_of o1 = s};
    then ex a be Element of TS(D) st a = x &( (ex x be set st x in X.s & a =
root-tree [x,s]) or ex o1 be OperSymbol of S st [o1,the carrier of S] =a.{} &
    the_result_sort_of o1 = s) by A2;
    hence thesis;
  end;
  let x be object;
  assume x in TS D;
  then reconsider t = x as Element of TS(D);
A6: rng t c= the carrier of D & the carrier of D = (Terminals D) \/ (
  NonTerminals D) by LANG1:1,RELAT_1:def 19;
  {} in dom t by TREES_1:22;
  then
A7: t.{} in rng t by FUNCT_1:def 3;
A8: NonTerminals D = [:the carrier' of S,{the carrier of S}:] by Th6;
A9: Terminals D = Union (coprod X) by Th6;
  per cases by A7,A6,XBOOLE_0:def 3;
  suppose
A10: t.{} in Terminals D;
    then reconsider a = t.{} as Terminal of D;
    a in union rng(coprod X) by A9,A10,CARD_3:def 4;
    then consider A be set such that
A11: a in A and
A12: A in rng(coprod X) by TARSKI:def 4;
    consider s be object such that
A13: s in dom(coprod X) and
A14: (coprod X).s = A by A12,FUNCT_1:def 3;
    reconsider s as SortSymbol of S by A13;
    A = coprod(s,X) by A14,Def3;
    then t = root-tree a & ex b be set st b in X.s & a = [b,s] by A11,Def2,
DTCONSTR:9;
    then t in FreeSort(X,s);
    then
A15: t in (FreeSort X).s by Def11;
    (FreeSort X).s in rng (FreeSort X) by A1,FUNCT_1:def 3;
    hence thesis by A15,TARSKI:def 4;
  end;
  suppose
    t.{} in NonTerminals D;
    then reconsider a = t.{} as NonTerminal of D;
    consider o being OperSymbol of S, x2 being Element of {the carrier of S}
    such that
A16: a = [o,x2] by A8,DOMAIN_1:1;
    set rs = the_result_sort_of o;
    x2 = the carrier of S by TARSKI:def 1;
    then t in FreeSort(X,rs) by A16;
    then
A17: t in (FreeSort X).rs by Def11;
    (FreeSort X).rs in rng (FreeSort X) by A1,FUNCT_1:def 3;
    hence thesis by A17,TARSKI:def 4;
  end;
end;
