reserve
  a,b for object, I,J for set, f for Function, R for Relation,
  i,j,n for Nat, m for (Element of NAT),
  S for non empty non void ManySortedSign,
  s,s1,s2 for SortSymbol of S,
  o for OperSymbol of S,
  X for non-empty ManySortedSet of the carrier of S,
  x,x1,x2 for (Element of X.s), x11 for (Element of X.s1),
  T for all_vars_including inheriting_operations free_in_itself
  (X,S)-terms MSAlgebra over S,
  g for Translation of Free(S,X),s1,s2,
  h for Endomorphism of Free(S,X);
reserve
  r,r1,r2 for (Element of T),
  t,t1,t2 for (Element of Free(S,X));
reserve
  Y for infinite-yielding ManySortedSet of the carrier of S,
  y,y1 for (Element of Y.s), y11 for (Element of Y.s1),
  Q for all_vars_including inheriting_operations free_in_itself
  (Y,S)-terms MSAlgebra over S,
  q,q1 for (Element of Args(o,Free(S,Y))),
  u,u1,u2 for (Element of Q),
  v,v1,v2 for (Element of Free(S,Y)),
  Z for non-trivial ManySortedSet of the carrier of S,
  z,z1 for (Element of Z.s),
  l,l1 for (Element of Free(S,Z)),
  R for all_vars_including inheriting_operations free_in_itself
  (Z,S)-terms MSAlgebra over S,
  k,k1 for Element of Args(o,Free(S,Z));
reserve c,c1,c2 for set, d,d1 for DecoratedTree;
reserve
  w for (Element of Args(o,T)),
  p,p1 for Element of Args(o,Free(S,X));
reserve C for (context of x), C1 for (context of y), C9 for (context of z),
  C11 for (context of x11), C12 for (context of y11), D for context of s,X;
reserve
  S9 for sufficiently_rich non empty non void ManySortedSign,
  s9 for SortSymbol of S9,
  o9 for s9-dependent OperSymbol of S9,
  X9 for non-trivial ManySortedSet of the carrier of S9,
  x9 for (Element of X9.s9);
reserve h1 for x-constant Homomorphism of Free(S,X), T,
  h2 for y-constant Homomorphism of Free(S,Y), Q;
reserve
  s2 for s1-reachable SortSymbol of S,
  g1 for Translation of Free(S,Y),s1,s2,
  g for Translation of Free(S,X),s1,s2;

theorem Th136:
  t c= t1 implies t = t1
  proof
    assume
A1: t c= t1;
    defpred P[Element of Free(S,X)] means for t1 st $1 c= t1 holds $1 = t1;
A2: P[x-term]
    proof
      let t1;
      assume
A3:   x-term c= t1;
      {} in dom (x-term) by TREES_1:22;
      then
A4:   t1.{} = (x-term).{} = [x,s] by A3,GRFUNC_1:2,TREES_4:3;
      per cases by Th16;
      suppose ex s,x st t1 = x-term;
        then consider s1,x11 such that
A5:     t1 = x11-term;
        thus thesis by A5,A4,TREES_4:3;
      end;
      suppose ex o,p st t1 = o-term p;
        then consider o,p such that
A6:     t1 = o-term p;
        t1.{} = [o,the carrier of S] by A6,TREES_4:def 4;
        then s in the carrier of S = s by A4,XTUPLE_0:1;
        hence thesis;
      end;
    end;
A7: for o,p st for t st t in rng p holds P[t] holds P[o-term p]
    proof
      let o,p;
      assume Z0: for t st t in rng p holds P[t];
      let t1; assume Z1: o-term p c= t1;
      {} in dom (o-term p) by TREES_1:22;
      then
A8:   t1.{} = (o-term p).{} = [o,the carrier of S]
      by Z1,GRFUNC_1:2,TREES_4:def 4;
      per cases by Th16;
      suppose ex s,x st t1 = x-term;
        then consider s1,x11 such that
A5:     t1 = x11-term;
        t1.{} = [x11,s1] by A5,TREES_4:3;
        then s1 in the carrier of S = s1 by A8,XTUPLE_0:1;
        hence thesis;
      end;
      suppose ex o,p st t1 = o-term p;
        then consider o1 being OperSymbol of S,
        p1 being Element of Args(o1,Free(S,X)) such that
A6:     t1 = o1-term p1;
        t1.{} = [o1,the carrier of S] by A6,TREES_4:def 4;
        then
A7:     o = o1 by A8,XTUPLE_0:1;
        p = p1
        proof
A8:       dom p = dom the_arity_of o = dom p1 by A7,MSUALG_6:2;
          hence
B3:       len p = len p1 by FINSEQ_3:29;
          let i; assume
A9:       1 <= i <= len p;
          then
B8:       i in dom p by FINSEQ_3:25;
          reconsider t = p.i, t1 = p1.i as Element of Free(S,X)
          by A8,A9,FUNCT_1:102,FINSEQ_3:25;
          consider j such that
B2:       i = 1+j by A9,NAT_1:10;
B7:       j < len p by A9,B2,NAT_1:13;
          then
B4:       t = (o-term p)|<*j*> & t1 = (o1-term p1)|<*j*>
          by B2,B3,TREES_4:def 4;
          then
B5:       dom t = (dom(o-term p))|<*j*> & dom t1 = (dom(o1-term p1))|<*j*>
          by TREES_2:def 10;
          (doms p).(j+1) = dom t by B2,B8,FUNCT_6:def 2;
          then {} in (doms p).(j+1) & dom(o-term p) = tree doms p &
          len doms p = len p by TREES_3:38,TREES_4:10,TREES_1:22;
          then
B6:       <*j*>^{} in dom(o-term p) by B7,TREES_3:48;
          (doms p1).(j+1) = dom t1 by B2,A9,A8,FINSEQ_3:25,FUNCT_6:def 2;
          then {} in (doms p1).(j+1) & dom(o1-term p1) = tree doms p1 &
          len doms p1 = len p1 by TREES_3:38,TREES_4:10,TREES_1:22;
          then
BB:       <*j*>^{} in dom(o1-term p1) by B3,B7,TREES_3:48;
BE:       t c= t1
          proof
            let a,b; assume
B1:         [a,b] in t;
            then reconsider a as Node of t by XTUPLE_0:def 12;
            t.a = b by B1,FUNCT_1:1;
            then
BA:         (o-term p).(<*j*>^a) = b & <*j*>^a in dom (o-term p)
            by B4,B5,B6,TREES_1:def 6,TREES_2:def 10;
            then
BC:         (o1-term p1).(<*j*>^a) = b & dom(o-term p) c= dom(o1-term p1)
            by Z1,A6,GRFUNC_1:2;
            then
BD:         a in dom t1 by BA,BB,B5,TREES_1:def 6;
            then t1.a = b by BC,B4,B5,TREES_2:def 10;
            hence thesis by BD,FUNCT_1:1;
          end;
          t in rng p by B8,FUNCT_1:def 3;
          hence thesis by BE,Z0;
        end;
        hence thesis by A6,A8,TREES_4:def 4;
      end;
    end;
    P[t] from TermInd(A2,A7);
    hence thesis by A1;
  end;
