reserve i, j, k, l, m, n for Nat,
  a, b, c, t, u for object,
  X, Y, Z for set,
  D, D1, D2, Fml for non empty set;
reserve p, q, r, s for FinSequence;
 reserve R, R1, R2 for Rule;
 reserve A, A1, A2 for non empty set;
 reserve B, B1, B2 for set;
 reserve P, P1, P2 for Formula-sequence;
 reserve S, S1, S2 for Formula-finset;

theorem Th42:
  for B, R, P1, P2 st P1 is (B, R)-correct & P2 is (B, R)-correct holds
      P1^P2 is (B, R)-correct
proof
  let B, R, P1, P2;
  assume that
    A1: P1 is (B, R)-correct and
    A2: P2 is (B, R)-correct;
  let k;
  assume A3: k in dom (P1^P2);
  per cases;
    suppose A5: k in dom P1;
    then P1, k is_a_correct_step_wrt B, R by A1;
    then P1^<*>{}, k is_a_correct_step_wrt B, R by FINSEQ_1:34;
    hence P1^P2, k is_a_correct_step_wrt B, R by A5, Lm41;
    end;
    suppose (P1^P2).k in B;
    hence thesis;
    end;
    suppose that A10: not k in dom P1 and A11: not (P1^P2).k in B;
    consider j such that A12: j in dom P2 and A13: k = (len P1) + j
        by A3, A10, FINSEQ_1:25;
    A15: P2, j is_a_correct_step_wrt B, R by A2, A12;
    A16: (P1^P2).k = P2.j by A12, A13, FINSEQ_1:def 7;
    then consider Q being Formula-finset such that
        A20: [Q, P2.j] in R and
        A21: for t st t in Q ex i being Nat
            st i in dom P2 & i < j & P2.i = t by A11, A15;
    for t st t in Q ex u being Nat
        st u in dom (P1^P2) & u < k & (P1^P2).u = t
      proof
      let t;
      assume t in Q;
      then consider i being Nat such that
        A25: i in dom P2 and
        A26: i < j and
        A27: P2.i = t by A21;
      take u = len P1 + i;
      A30: 1 <= i & i <= len P2 by A25, FINSEQ_3:25;
      thus u in dom (P1^P2) by A25, FINSEQ_1:28;
      thus u < k by A13, A26, XREAL_1:6;
      thus (P1^P2).u = t by A27, A30, FINSEQ_1:65;
    end;
    hence thesis by A16, A20;
  end;
end;
