reserve i for Nat,
  j for Element of NAT,
  X,Y,x,y,z for set;
reserve C for initialized ConstructorSignature,
  s for SortSymbol of C,
  o for OperSymbol of C,
  c for constructor OperSymbol of C;
reserve a,b for expression of C, an_Adj C;
reserve t, t1,t2 for expression of C, a_Type C;
reserve p for FinSequence of QuasiTerms C;
reserve e for expression of C;
reserve a,a9 for expression of C, an_Adj C;
reserve q for pure expression of C, a_Type C,
  A for finite Subset of QuasiAdjs C;
reserve T for quasi-type of C;

theorem Th89:
  for p being DTree-yielding FinSequence st e = [c, the carrier of C]-tree p
  holds vars e = union {vars t where t is quasi-term of C: t in rng p}
proof
  let p be DTree-yielding FinSequence;
  assume
A1: e = [c, the carrier of C]-tree p;
  set A = {variables_in t where t is quasi-term of C: t in rng p};
  set B = {vars t where t is quasi-term of C: t in rng p};
  per cases;
  suppose
A2: A = {};
    set b = the Element of B;
    now
      assume B <> {};
      then b in B;
      then consider t being quasi-term of C such that
      b = vars t and
A3:   t in rng p;
      variables_in t in A by A3;
      hence contradiction by A2;
    end;
    hence thesis by A1,A2,Th8,Th88,ZFMISC_1:2;
  end;
  suppose A <> {};
    then reconsider A as non empty set;
    set D = the set of all varcl s where s is Element of A;
A4: B c= D
    proof
      let a be object;
      assume a in B;
      then consider t being quasi-term of C such that
A5:   a = vars t and
A6:   t in rng p;
      variables_in t in A by A6;
      then reconsider s = variables_in t as Element of A;
      a = varcl s by A5;
      hence thesis;
    end;
A7: D c= B
    proof
      let a be object;
      assume a in D;
      then consider s being Element of A such that
A8:   a = varcl s;
      s in A;
      then consider t being quasi-term of C such that
A9:   s = variables_in t and
A10:  t in rng p;
      vars t = a by A8,A9;
      hence thesis by A10;
    end;
    thus vars e = varcl union A by A1,Th88
      .= union D by Th10
      .= union B by A4,A7,XBOOLE_0:def 10;
  end;
end;
