reserve x,y,z for set;

theorem Th32:
  for S being non void Signature for Y being non-empty
  ManySortedSet of the carrier of S for t being Term of S,Y for p being Element
  of dom t holds variables_in (t|p) c= variables_in t
proof
  let S be non void Signature;
  let Y be non-empty ManySortedSet of the carrier of S;
  let t be Term of S,Y;
  let p be Element of dom t;
  reconsider q = t|p as Term of S,Y;
  let s be object;
  assume
A1: s in the carrier of S;
  let x be object;
  assume x in (variables_in (t|p)).s;
  then x in {a`1 where a is Element of rng q: a`2 = s} by A1,Def2;
  then consider a being Element of rng (t|p) such that
A2: x = a`1 & a`2 = s;
  rng (t|p) c= rng t & a in rng (t|p) by TREES_2:32;
  then x in {b`1 where b is Element of rng t: b`2 = s} by A2;
  hence thesis by A1,Def2;
end;
