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

theorem Th35:
  for S being non empty non void ManySortedSign
  for X being non-empty ManySortedSet of the carrier of S
  for A being vf-free all_vars_including inheriting_operations free_in_itself
  (X,S)-terms VarMSAlgebra over S
  for s being SortSymbol of S
  for t being Element of A,s holds vf t is ManySortedSubset of FreeGen X
  proof
    let S be non empty non void ManySortedSign;
    let X be non-empty ManySortedSet of the carrier of S;
    let A be vf-free all_vars_including inheriting_operations free_in_itself
    (X,S)-terms VarMSAlgebra over S;
    let s be SortSymbol of S;
    let t be Element of A,s;
    let x be object; assume x in the carrier of S; then
    reconsider r = x as SortSymbol of S;
    let y be object; assume y in (vf t).x; then
    y in {t|p where p is Element of dom t: ((t|p).{})`2 = r} by Def11; then
    consider p being Element of dom t such that
A1: y = t|p & ((t|p).{})`2 = r;
    t is Element of (the Sorts of A).s; then
    reconsider tp = t|p as Element of A by MSAFREE4:44;
A2: tp is Term of S,X by MSAFREE4:42;
    per cases by A2,MSATERM:2;
    suppose tp.{} in [:the carrier' of S, {the carrier of S}:]; then
      r in {the carrier of S} by A1,MCART_1:10; then
      r = the carrier of S by TARSKI:def 1; then
      r in r;
      hence thesis;
    end;
    suppose
      ex s being SortSymbol of S, v being Element of X.s st tp.{} = [v,s]; then
      consider s1 being SortSymbol of S, v being Element of X.s1 such that
A3:   tp.{} = [v,s1];
      tp = root-tree [v,s1] by A2,A3,MSATERM:5; then
      tp in FreeGen(s1, X) by MSAFREE:def 15; then
      tp in (FreeGen X).s1 by MSAFREE:def 16;
      hence y in (FreeGen X).x by A1,A3;
    end;
  end;
