reserve S for non void non empty ManySortedSign,
  V for non-empty ManySortedSet of the carrier of S;
reserve A for MSAlgebra over S,
  t for Term of S,V;
reserve S for non void non empty ManySortedSign,
  A for non-empty MSAlgebra over S,
  V for Variables of A,
  t for c-Term of A,V,
  f for ManySortedFunction of V, the Sorts of A;

theorem Th31:
  for s being SortSymbol of S, x being Element of (the Sorts of A)
  .s st t = root-tree [x,s] holds root-tree x is_an_evaluation_of t,f
proof
  let s be SortSymbol of S, x be Element of (the Sorts of A).s such that
A1: t = root-tree [x,s];
A2: t.{} = [x,s] by A1,TREES_4:3;
  set vt = root-tree x;
A3: dom vt = elementary_tree 0 by TREES_4:3;
  hence dom vt = dom t by A1,TREES_4:3;
  let p be Node of vt;
  reconsider e = p as empty FinSequence of NAT by A3,TARSKI:def 1,TREES_1:29;
  hereby
    let s1 be SortSymbol of S, v be Element of V.s1;
    assume t.p = [v,s1];
    then
A4: [v,s1] = t.e .= [x,s] by A1,TREES_4:3;
    then
A5: x = v by XTUPLE_0:1;
    s = s1 by A4,XTUPLE_0:1;
    hence vt.p = f.s1.v by A5,Th30;
  end;
A6: vt.{} = x by TREES_4:3;
  hereby
    let s1 be SortSymbol of S, x1 be Element of (the Sorts of A).s1;
    assume t.p = [x1,s1];
    then [x1,s1] = t.e;
    hence vt.p = x1 by A2,A6,XTUPLE_0:1;
  end;
  let o be OperSymbol of S;
  assume t.p = [o,the carrier of S];
  then the carrier of S = (t.e)`2
    .= s by A2;
  hence vt.p = Den(o, A).succ(vt,p) by Lm7;
end;
