 reserve a,b for object;
 reserve k,l,m,n for Nat;
 reserve p,q,r,s for FinSequence;
 reserve P for non empty FinSequence-membered set;
 reserve S,T for Polish-language;
 reserve V for Polish-language of T;
 reserve K for non trivial Polish-language;
 reserve E for Polish-arity-function of K;
 reserve B for Polish-arity-function;
 reserve A for Polish-arity-function of T;
 reserve C for Extension of B;
 reserve Z for B-closed Polish-language;
 reserve J for Polish-ext-set of B;
 reserve V for full Polish-language of T;
 reserve U for T-extending Polish-language;
 reserve W for full Polish-language of U;
 reserve M for Polish-ext-set of C;
 reserve e for Element of dom C;
 reserve F, G, H for Formula of M;

theorem Th22:
  for T,U,V,W holds Polish-arity V c= Polish-arity W iff V c= W
proof
  let T,U,V,W;
  A1: T c= U by Def9;
  thus Polish-arity V c= Polish-arity W implies V c= W
  proof
    assume A2: Polish-arity V c= Polish-arity W;
    set A = Polish-arity V;
    set B = Polish-arity W;
    A5: for a st a in T holds A.a = B.a
    proof
      let a;
      assume a in T;
      then a in dom A by FUNCT_2:def 1;
      hence thesis by A2, GRFUNC_1:2;
    end;
    defpred P[Nat] means Polish-expression-hierarchy(T,A,$1)
        c= Polish-expression-hierarchy(U,B,$1);
    A10: P[0]
    proof
      let a;
      assume a in Polish-expression-hierarchy(T,A,0);
      then a in Polish-atoms(T,A) by POLNOT_1:22;
      then a in T & A.a = 0 by POLNOT_1:def 7;
      then a in U & B.a = 0 by A1, A5;
      then a in Polish-atoms(U,B) by POLNOT_1:def 7;
      hence a in Polish-expression-hierarchy(U,B,0) by POLNOT_1:22;
    end;
    A20: for k st P[k] holds P[k+1]
    proof
      let k;
      set G = Polish-expression-hierarchy(T,A,k);
      set H = Polish-expression-hierarchy(U,B,k);
      assume A21: P[k];
      let a;
      assume a in Polish-expression-hierarchy(T,A,k+1);
      then a in Polish-expression-layer(T,A,G) by POLNOT_1:23;
      then consider p,q,n such that
        A23: a = p^q and A24: p in T and A25: n = A.p and A26: q in G^^n
          by POLNOT_1:def 6;
      A27: p in U & n = B.p by A1, A5, A24, A25;
      G^^n c= H^^n by A21, POLNOT_1:17;
      then a in Polish-expression-layer(U,B,H) by A23, A26, A27, POLNOT_1:18;
      hence thesis by POLNOT_1:23;
    end;
    A30: for n holds P[n] from NAT_1:sch 2(A10, A20);
    let a;
    assume a in V;
    then a in Polish-expression-set(T,A);
    then consider n such that A31: a in Polish-expression-hierarchy(T,A,n+1)
        by POLNOT_1:28;
    Polish-expression-hierarchy(T,A,n+1)
        c= Polish-expression-hierarchy(U,B,n+1) by A30;
    then a in Polish-expression-set(U,B) by A31, POLNOT_1:26, TARSKI:def 3;
    hence a in W;
  end;
  assume A40: V c= W;
  set A = Polish-arity V;
  set B = Polish-arity W;
  A41: dom A = T & dom B = U by FUNCT_2:def 1;
  for a st a in dom A holds A.a = B.a
  proof
    let a;
    assume a in dom A;
    then reconsider t = a as Element of T by FUNCT_2:def 1;
    per cases;
    suppose A45: U is trivial;
      then T is trivial;
      then A.t = 0 by Lm5 .= B.t by A1, A45, Lm5;
      hence thesis;
    end;
    suppose U is non trivial;
      then reconsider U as non trivial Polish-language;
      reconsider B as Polish-arity-function of U;
      set n = A.t;
      set u = the Element of V^^n;
      set v = t^u;
      A50: W = Polish-WFF-set(U,B);
      V = Polish-WFF-set(T,A);
      then V is A-closed;
      then v in Polish-expression-set(U,B) by A40;
      then consider m,p,q such that
        A52: p in U and
        A53: m = B.p and
        A54: q in W^^m and
        A55: v = p^q by POLNOT_1:32;
      A56: V^^n c= W^^n by A40, POLNOT_1:17;
      T c= U by Def9;
      then t in U;
      then A57: p = t & u = q by A52, A55, POLNOT_1:43;
      then u in W^^n & u in W^^m by A54, A56;
      hence thesis by A50, A53, A57, Lm3;
    end;
  end;
  hence A c= B by A41, Def9, GRFUNC_1:2;
end;
