reserve x,y,z for set;

theorem Th27:
  for S being non void Signature for X being non empty-yielding
ManySortedSet of the carrier of S for Y being ManySortedSet of the carrier of S
  for t being Element of Free(S, X) holds S variables_in t c= X
proof
  let S be non void Signature;
  let X be non empty-yielding ManySortedSet of the carrier of S;
  let Y be ManySortedSet of the carrier of S;
  let t be Element of Free(S, X);
  set Z = X (\/) ((the carrier of S)-->{0});
  reconsider t as Term of S,Z by Th8;
  t in Union the Sorts of Free(S, X);
  then
A1: t in Union (S-Terms(X,Z)) by Th24;
  dom (S-Terms(X,Z)) = the carrier of S by PARTFUN1:def 2;
  then ex s being object st s in the carrier of S & t in S-Terms(X,Z).s by A1,
CARD_5:2;
  then variables_in t c= X by Th17;
  hence thesis;
end;
