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 Th37:
  for e1, e2 being finite DecoratedTree st e1 is_an_evaluation_of
  t,f & e2 is_an_evaluation_of t,f holds e1 = e2
proof
  defpred P[c-Term of A,V] means for e1, e2 being finite DecoratedTree st e1
  is_an_evaluation_of $1,f & e2 is_an_evaluation_of $1,f holds e1 = e2;
A1: now
    let s be SortSymbol of S, v be Element of V.s;
    thus P[v-term A]
    proof
      let e1,e2 be finite DecoratedTree;
      set t = v-term A;
      assume that
A2:   e1 is_an_evaluation_of t,f and
A3:   e2 is_an_evaluation_of t,f;
A4:   dom e1 = dom t by A2;
A5:   {} is Node of e1 by TREES_1:22;
A6:   (root-tree [v,s]).{} = [v,s] by TREES_4:3;
      then e1.{} = f.s.v by A2,A5;
      then
A7:   e1 = root-tree (f.s.v) by A4,TREES_4:3,5;
A8:   dom e2 = dom t by A3;
      e2.{} = f.s.v by A3,A4,A6,A5;
      hence thesis by A8,A7,TREES_4:3,5;
    end;
  end;
A9: now
    let o be OperSymbol of S, p be ArgumentSeq of o,A,V;
    assume
A10: for t being c-Term of A,V st t in rng p holds P[t];
    thus P[Sym(o,(the Sorts of A) (\/) V)-tree p]
    proof
      set t = Sym(o,(the Sorts of A) (\/) V)-tree p;
      let e1, e2 be finite DecoratedTree;
      assume that
A11:  e1 is_an_evaluation_of t qua c-Term of A,V,f and
A12:  e2 is_an_evaluation_of t qua c-Term of A,V,f;
      consider q1 being DTree-yielding FinSequence such that
A13:  len q1 = len p and
A14:  e1 = (Den(o,A).roots q1)-tree q1 and
A15:  for i being Nat, t being c-Term of A,V st i in dom p & t = p.i
ex vt being finite DecoratedTree st vt = q1.i & vt is_an_evaluation_of t,f by
A11,Th35;
      consider q2 being DTree-yielding FinSequence such that
A16:  len q2 = len p and
A17:  e2 = (Den(o,A).roots q2)-tree q2 and
A18:  for i being Nat, t being c-Term of A,V st i in dom p & t = p.i
ex vt being finite DecoratedTree st vt = q2.i & vt is_an_evaluation_of t,f by
A12,Th35;
A19:  now
        let i be Element of NAT;
        assume
A20:    i < len p;
        then reconsider t = p.(i+1) as c-Term of A,V by Lm2;
A21:    ex vt2 being finite DecoratedTree st vt2 = q2.(i+1) & vt2
        is_an_evaluation_of t,f by A18,A20,Lm9;
        ex vt1 being finite DecoratedTree st vt1 = q1.(i+1) & vt1
        is_an_evaluation_of t,f by A15,A20,Lm9;
        hence q1.(i+1) = q2.(i+1) by A10,A20,A21,Lm9;
      end;
A22:  now
        let i be Nat;
        assume i in dom q1;
        then ex k being Element of NAT st i = k+1 & k < len q1 by Lm1;
        hence q1.i = q2.i by A13,A19;
      end;
A23:  dom q2 = Seg len q2 by FINSEQ_1:def 3;
      dom q1 = Seg len q1 by FINSEQ_1:def 3;
      then q1 = q2 by A13,A16,A23,A22,FINSEQ_1:13;
      hence thesis by A14,A17;
    end;
  end;
A24: now
    let s be SortSymbol of S, x be Element of (the Sorts of A).s;
    thus P[x-term (A, V)]
    proof
      let e1,e2 be finite DecoratedTree;
      set t = x-term (A, V);
      assume that
A25:  e1 is_an_evaluation_of t,f and
A26:  e2 is_an_evaluation_of t,f;
A27:  dom e1 = dom t by A25;
A28:  {} is Node of e1 by TREES_1:22;
A29:  (root-tree [x,s]).{} = [x,s] by TREES_4:3;
      then e1.{} = x by A25,A28;
      then
A30:  e1 = root-tree x by A27,TREES_4:3,5;
A31:  dom e2 = dom t by A26;
      e2.{} = x by A26,A27,A29,A28;
      hence thesis by A31,A30,TREES_4:3,5;
    end;
  end;
  for t being c-Term of A,V holds P[t] from TermInd2(A24,A1,A9);
  hence thesis;
end;
