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;

theorem Th2:
  for P, Q, R holds (P^Q)^R = P^(Q^R)
proof
  let P, Q, R;
  for a holds a in (P^Q)^R iff a in P^(Q^R)
    proof
    let a;
    thus a in (P^Q)^R implies a in P^(Q^R)
      proof
      assume a in (P^Q)^R;
      then consider u,r such that A2: a = u^r and A3: u in P^Q and A4: r in R
          by Def2;
      consider p, q such that A5: u = p^q and A6: p in P and A7: q in Q
          by A3, Def2;
      A8: a = p^(q^r) by A2, A5, FINSEQ_1:32;
      q^r in (Q^R) by A4, A7, Def2;
      hence a in P^(Q^R) by A6, A8, Def2;
      end;
      assume a in P^(Q^R);
      then consider p,t such that A9: a = p^t and A10: p in P and A11: t in Q^R
          by Def2;
      consider q,r such that A12: t = q^r and A13: q in Q and A14: r in R
          by A11, Def2;
 A15: a = (p^q)^r by A9, A12, FINSEQ_1:32;
      p^q in (P^Q) by A10, A13, Def2;
      hence a in (P^Q)^R by A14, A15, Def2;
    end;
  hence thesis by TARSKI:2;
end;
