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 Th33:
  for o being OperSymbol of S, p being ArgumentSeq of o,A,V for q
  being DTree-yielding FinSequence st len q = len p & 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 =
q.i & vt is_an_evaluation_of t,f ex vt being finite DecoratedTree st vt = (Den(
  o,A).roots q)-tree q & vt is_an_evaluation_of (Sym(o,(the Sorts of A) (\/) V)
  -tree p qua c-Term of A,V), f
proof
  let o be OperSymbol of S, p be ArgumentSeq of o,A,V;
A1: Sym(o,(the Sorts of A) (\/) V) = [o,the carrier of S] by MSAFREE:def 9;
A2: dom doms p = dom p by TREES_3:37;
A3: tree doms p = dom ([o,the carrier of S]-tree p) by TREES_4:10;
A4: dom p = Seg len p by FINSEQ_1:def 3;
  let q be DTree-yielding FinSequence such that
A5: len q = len p and
A6: 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 = q.i & vt is_an_evaluation_of t,f;
A7: dom q = Seg len q by FINSEQ_1:def 3;
  now
    let x be object;
A8: rng p c= S-Terms ((the Sorts of A) (\/) V) by FINSEQ_1:def 4;
    assume
A9: x in dom doms q;
    then
A10: x in dom q by TREES_3:37;
    then p.x in rng p by A5,A4,A7,FUNCT_1:def 3;
    then reconsider t = p.x as c-Term of A,V by A8;
    reconsider i = x as Nat by A9;
    consider vt being finite DecoratedTree such that
A11: vt = q.i and
    vt is_an_evaluation_of t,f by A5,A6,A4,A7,A10;
    (doms q).x = dom vt by A10,A11,FUNCT_6:22;
    hence (doms q).x is finite Tree;
  end;
  then reconsider r = doms q as FinTree-yielding FinSequence by TREES_3:23;
A12: now
    let i be Nat;
A13: rng p c= S-Terms ((the Sorts of A) (\/) V) by FINSEQ_1:def 4;
    assume
A14: i in dom p;
    then p.i in rng p by FUNCT_1:def 3;
    then reconsider t = p.i as c-Term of A,V by A13;
    consider vt being finite DecoratedTree such that
A15: vt = q.i and
A16: vt is_an_evaluation_of t,f by A6,A14;
    thus r.i = dom vt by A5,A4,A7,A14,A15,FUNCT_6:22
      .= dom t by A16
      .= (doms p).i by A14,FUNCT_6:22;
  end;
  set vt = (Den(o,A).roots q)-tree q;
A17: len doms q = len q by TREES_3:38;
A18: dom vt = tree r by TREES_4:10;
  then reconsider vt as finite DecoratedTree by FINSET_1:10;
  take vt;
  thus vt = (Den(o,A).roots q)-tree q;
  dom doms q = dom q by TREES_3:37;
  hence dom vt = dom(Sym(o,(the Sorts of A) (\/) V)-tree p)
   by A1,A5,A4,A7,A18,A3,A2,A12,FINSEQ_1:13;
  let n be Node of vt;
A19: ([o,the carrier of S]-tree p).{} = [o,the carrier of S] by TREES_4:def 4;
  hereby
    let s be SortSymbol of S, v be Element of V.s;
    assume
A20: (Sym(o,(the Sorts of A) (\/) V)-tree p).n = [v,s];
    now
      assume n = {};
      then s = the carrier of S by A1,A19,A20,XTUPLE_0:1;
      hence contradiction by Lm7;
    end;
    then consider w being FinSequence of NAT,
     i being Element of NAT such that
A21: n = <*i*>^w by FINSEQ_2:130;
A22: w in (doms q).(i+1) by A18,A21,TREES_3:48;
A23: i < len p by A5,A18,A17,A21,TREES_3:48;
    then reconsider t = p.(i+1) as c-Term of A,V by Lm2;
    consider e being finite DecoratedTree such that
A24: e = q.(i+1) and
A25: e is_an_evaluation_of t,f by A6,A23,Lm9;
    i+1 in dom p by A23,Lm9;
    then reconsider w as Node of e by A5,A4,A7,A22,A24,FUNCT_6:22;
    dom e = dom t by A25;
    then
A26: t.w = [v,s] by A20,A21,A23,TREES_4:12;
    thus vt.n = e.w by A5,A21,A23,A24,TREES_4:12
      .= f.s.v by A25,A26;
  end;
  hereby
    let s be SortSymbol of S, x be Element of (the Sorts of A).s;
    assume
A27: (Sym(o,(the Sorts of A) (\/) V)-tree p).n = [x,s];
    now
      assume n = {};
      then s = the carrier of S by A1,A19,A27,XTUPLE_0:1;
      hence contradiction by Lm7;
    end;
    then consider w being FinSequence of NAT,
    i being Element of NAT such that
A28: n = <*i*>^w by FINSEQ_2:130;
A29: w in (doms q).(i+1) by A18,A28,TREES_3:48;
A30: i < len p by A5,A18,A17,A28,TREES_3:48;
    then reconsider t = p.(i+1) as c-Term of A,V by Lm2;
    consider e being finite DecoratedTree such that
A31: e = q.(i+1) and
A32: e is_an_evaluation_of t,f by A6,A30,Lm9;
    i+1 in dom p by A30,Lm9;
    then reconsider w as Node of e by A5,A4,A7,A29,A31,FUNCT_6:22;
    dom e = dom t by A32;
    then
A33: t.w = [x,s] by A27,A28,A30,TREES_4:12;
    thus vt.n = e.w by A5,A28,A30,A31,TREES_4:12
      .= x by A32,A33;
  end;
  let o1 be OperSymbol of S;
  assume
A34: (Sym(o,(the Sorts of A) (\/) V)-tree p).n = [o1,the carrier of S];
  per cases;
  suppose
A35: n = {};
    then
    (Sym(o,(the Sorts of A) (\/) V)-tree p).n
       = Sym(o,(the Sorts of A) (\/) V) by TREES_4:def 4
      .= [o,the carrier of S] by MSAFREE:def 9;
    then
A36: o = o1 by A34,XTUPLE_0:1;
    succ(vt,n) = roots q by A35,TREES_9:30;
    hence thesis by A35,A36,TREES_4:def 4;
  end;
  suppose
    n <> {};
    then consider w being FinSequence of NAT,
    i being Element of NAT such that
A37: n = <*i*>^w by FINSEQ_2:130;
    reconsider ii = <*i*> as Node of vt by A37,TREES_1:21;
A38: w in (doms q).(i+1) by A18,A37,TREES_3:48;
A39: i < len p by A5,A18,A17,A37,TREES_3:48;
    then reconsider t = p.(i+1) as c-Term of A,V by Lm2;
    consider e being finite DecoratedTree such that
A40: e = q.(i+1) and
A41: e is_an_evaluation_of t,f by A6,A39,Lm9;
A42: e = vt|ii by A5,A39,A40,TREES_4:def 4;
    i+1 in dom p by A39,Lm9;
    then reconsider w as Node of e by A5,A4,A7,A38,A40,FUNCT_6:22;
    dom e = dom t by A41;
    then t.w = [o1,the carrier of S] by A34,A37,A39,TREES_4:12;
    then e.w = Den(o1, A).succ(e,w) by A41
      .= Den(o1, A).succ(vt,n) by A37,A42,TREES_9:31;
    hence thesis by A5,A37,A39,A40,TREES_4:12;
  end;
end;
