reserve x,y,z for set;

theorem Th10:
  for S being ManySortedSign, s,x being object holds (s in the
  carrier of S implies (S variables_in root-tree [x,s]).s = {x}) &
 for s9 being object st s9 <> s or not s in the carrier of S
  holds (S variables_in root-tree [x,s]).s9 = {}
proof
  let S be ManySortedSign, s,x be object;
  reconsider t = root-tree [x,s] as DecoratedTree;
A1: [x,s]`2 = s;
  t = {[{},[x,s]]} by TREES_4:6;
  then
A2: rng t = {[x,s]} by RELAT_1:9;
A3: [x,s]`1 = x;
  hereby
    assume s in the carrier of S;
    then
A4: (S variables_in t).s = {a`1 where a is Element of rng t: a`2 = s} by Def2;
    thus (S variables_in root-tree [x,s]).s = {x}
    proof
      hereby
        let y be object;
        assume y in (S variables_in root-tree [x,s]).s;
        then consider a being Element of rng t such that
A5:     y = a`1 and
        a`2 = s by A4;
        a = [x,s] by A2,TARSKI:def 1;
        hence y in {x} by A5,TARSKI:def 1;
      end;
      [x,s] in rng t by A2,TARSKI:def 1;
      then x in {a`1 where a is Element of rng t: a`2 = s} by A3,A1;
      hence thesis by A4,ZFMISC_1:31;
    end;
  end;
  let s9 be object such that
A6: s9 <> s or not s in the carrier of S;
  set y = the Element of (S variables_in root-tree [x,s]).s9;
  assume
A7: (S variables_in root-tree [x,s]).s9 <> {};
  then
A8: y in (S variables_in t).s9;
  dom (S variables_in t) = the carrier of S by PARTFUN1:def 2;
  then
A9: s9 in the carrier of S by A7,FUNCT_1:def 2;
  then (S variables_in t).s9 = {a`1 where a is Element of rng t:a`2 = s9} by
Def2;
  then ex a being Element of rng t st y = a`1 & a`2 = s9 by A8;
  hence thesis by A2,A1,A6,A9,TARSKI:def 1;
end;
