reserve k,m,n for Nat,
  a, b, c for object,
  x, y, X, Y, Z for set,
  D for non empty set;
reserve p, q, r, s, t, u, v for FinSequence;
reserve P, Q, R, P1, P2, Q1, Q2, R1, R2 for FinSequence-membered set;
reserve S, T for non empty FinSequence-membered set;
reserve A for Function of P, NAT;
reserve U, V, W for Subset of P*;

theorem Th33:
  for P, A holds Polish-expression-set(P, A) is A-closed
proof
  let P, A, p, n, q;
  assume that
  A1: p in dom A and
  A2: n = A.p and
  A3: q in Polish-expression-set(P, A)^^n;
  consider m such that A4: q in Polish-expression-hierarchy(P, A, m)^^n
    by A3, Th27;
  set U = Polish-expression-hierarchy(P, A, m);
  dom A = P by FUNCT_2:def 1;
  then p^q in Polish-expression-layer(P, A, U) by A1, A2, A4, Th18;
  then p^q in Polish-expression-hierarchy(P, A, m+1) by Th23;
  hence thesis by Th26, TARSKI:def 3;
end;
