reserve
  a,b for object, I,J for set, f for Function, R for Relation,
  i,j,n for Nat, m for (Element of NAT),
  S for non empty non void ManySortedSign,
  s,s1,s2 for SortSymbol of S,
  o for OperSymbol of S,
  X for non-empty ManySortedSet of the carrier of S,
  x,x1,x2 for (Element of X.s), x11 for (Element of X.s1),
  T for all_vars_including inheriting_operations free_in_itself
  (X,S)-terms MSAlgebra over S,
  g for Translation of Free(S,X),s1,s2,
  h for Endomorphism of Free(S,X);
reserve
  r,r1,r2 for (Element of T),
  t,t1,t2 for (Element of Free(S,X));
reserve
  Y for infinite-yielding ManySortedSet of the carrier of S,
  y,y1 for (Element of Y.s), y11 for (Element of Y.s1),
  Q for all_vars_including inheriting_operations free_in_itself
  (Y,S)-terms MSAlgebra over S,
  q,q1 for (Element of Args(o,Free(S,Y))),
  u,u1,u2 for (Element of Q),
  v,v1,v2 for (Element of Free(S,Y)),
  Z for non-trivial ManySortedSet of the carrier of S,
  z,z1 for (Element of Z.s),
  l,l1 for (Element of Free(S,Z)),
  R for all_vars_including inheriting_operations free_in_itself
  (Z,S)-terms MSAlgebra over S,
  k,k1 for Element of Args(o,Free(S,Z));
reserve c,c1,c2 for set, d,d1 for DecoratedTree;
reserve
  w for (Element of Args(o,T)),
  p,p1 for Element of Args(o,Free(S,X));

theorem
  vf (o-term p) = union {vf t: t in rng p}
  proof
B1: dom (X variables_in (o-term p)) = the carrier of S by PARTFUN1:def 2;
    thus vf (o-term p) c= union {vf t: t in rng p}
    proof
      let a; assume a in vf (o-term p);
      then a in Union(X variables_in (o-term p)) by ThR1;
      then consider b such that
A1:   b in dom (X variables_in (o-term p)) & a in (X variables_in (o-term p)).b
      by CARD_5:2;
      reconsider b as SortSymbol of S by A1;
      consider t being DecoratedTree such that
A2:   t in rng p & a in (X variables_in t).b by A1,MSAFREE3:13;
      reconsider t as Element of Free(S,X) by A2,RELAT_1:167;
A3:   dom (X variables_in t) = the carrier of S by PARTFUN1:def 2;
      a in Union(X variables_in t) = vf t in {vf t1: t1 in rng p}
      by A2,A3,ThR1,CARD_5:2;
      hence a in union {vf t1: t1 in rng p} by TARSKI:def 4;
    end;
    let a; assume a in union {vf t: t in rng p};
    then consider I such that
A4: a in I in {vf t: t in rng p} by TARSKI:def 4;
    consider t such that
A5: I = vf t & t in rng p by A4;
    a in Union(X variables_in t) by A4,A5,ThR1;
    then consider b such that
A6: b in dom(X variables_in t) & a in (X variables_in t).b by CARD_5:2;
    reconsider b as SortSymbol of S by A6;
    a in (X variables_in (o-term p)).b by A5,A6,MSAFREE3:13;
    then a in Union(X variables_in (o-term p)) by B1,CARD_5:2;
    hence thesis by ThR1;
  end;
