reserve x, y, z for object,
  i, j, n for Nat,
  p, q, r for FinSequence,
  v for FinSequence of NAT;
reserve T,T9 for DecoratedTree,
  x,y for set;
reserve D1, D2 for non empty set,
  T for DecoratedTree of D1,D2,
  d1 for Element of D1,
  d2 for Element of D2,
  F for non empty DTree-set of D1,D2,
  F1 for non empty (DTree-set of D1),
  F2 for non empty DTree-set of D2;

theorem Th28:
  for D1,D2, d1,d2, F,F2
  for p being FinSequence of F, p2 being FinSequence of F2 st dom p2 = dom p &
  for i st i in dom p for T st T = p.i holds p2.i = T`2
  holds ([d1,d2]-tree p)`2 = d2-tree p2
proof
  let D1,D2, d1,d2, F,F2;
  let p be FinSequence of F, p2 be FinSequence of F2 such that
A1: dom p2 = dom p and
A2: for i st i in dom p for T st T = p.i holds p2.i = T`2;
  set W = [d1,d2]-tree p, W2 = d2-tree p2;
A3: len doms p = len p by TREES_3:38;
A4: len doms p2 = len p2 by TREES_3:38;
A5: len p = len p2 by A1,FINSEQ_3:29;
then A6: dom doms p = dom doms p2 by A3,A4,FINSEQ_3:29;
A7: dom doms p = dom p by A3,FINSEQ_3:29;
 now
    let i be Nat;
    assume
A8: i in dom p;
    then reconsider T = p.i as Element of F by Lm1;
A9: p2.i = T`2 by A2,A8;
A10: (doms p).i = dom T by A8,FUNCT_6:22;
 (doms p2).i = dom T`2 by A1,A8,A9,FUNCT_6:22;
    hence (doms p).i = (doms p2).i by A10,Th24;
  end;
then A11: doms p = doms p2 by A6,A7,FINSEQ_1:13;
 dom W`2 = dom W by Th24
    .= tree(doms p) by Th10;
  hence dom W`2 = dom W2 by A11,Th10;
  let x be Node of W`2;
  reconsider a = x as Node of W by Th24;
A12: W`2.x = (W.a)`2 by TREES_3:39;
  per cases;
  suppose
 x = {};
then  W.x = [d1,d2] & W2.x = d2 by Def4;
    hence thesis by A12;
  end;
  suppose
 x <> {};
    then consider n being Nat, T being DecoratedTree,
    q being Node of T such that
A13: n < len p and
A14: T = p.(n+1) and
A15: a = <*n*>^q by Th11;
    reconsider T as Element of F by A13,A14,Lm3;
    reconsider q as Node of T`2 by Th24;
A16: p2.(n+1) = T`2 by A2,A13,A14,Lm2;
A17: W.a = T.q by A13,A14,A15,Th12;
 W2.a = T`2.q by A5,A13,A15,A16,Th12;
    hence thesis by A12,A17,TREES_3:39;
  end;
end;
