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;
 reserve C for Extension of B;
 reserve E for Extension of R;

theorem Th52:
  for B, R, S1, S2 st S1 is (B, R)-derivable & S2 is (S1, R)-derivable holds
      S1 \/ S2 is (B, R)-derivable
proof
  let B, R, S1, S2;
  assume S1 is (B, R)-derivable & S2 is (S1, R)-derivable; then
  consider P1, P2 such that
    A3: P1 is (B, R)-correct and
    A4: S1 = rng P1 and
    A5: P2 is (S1, R)-correct and
    A6: S2 = rng P2;
    set P = P1^P2;
    A8: for k st k in dom P1 holds P, k is_a_correct_step_wrt B, R
    proof
      let k;
      assume A9: k in dom P1;
      then P1, k is_a_correct_step_wrt B, R by A3;
      then P1^<*>{}, k is_a_correct_step_wrt B, R by FINSEQ_1:34;
      hence thesis by A9, Lm41;
    end;
    A10: P is (B, R)-correct
    proof
      let k;
      assume k in dom P;
      then per cases by FINSEQ_1:25;
        suppose k in dom P1;
        hence thesis by A8;
        end;
        suppose ex i st i in dom P2 & k = len P1+i;
        then consider i such that
          A20: i in dom P2 and
          A21: k = len P1+i;
        P2,i is_a_correct_step_wrt S1,R by A5, A20;
        then per cases;
          suppose P2.i in S1;
          then consider b such that A25: b in dom P1 and A26: P1.b = P2.i
            by A4, FUNCT_1:def 3;
          A27: b in Seg len P1 by A25, FINSEQ_1:def 3;
          then reconsider n = b as Nat;
          A28: n <= len P1 by A27, FINSEQ_1:1;
          k >= len P1 by A21, NAT_1:11;
          then A29: n <= k by A28, XXREAL_0:2;
          P.n = P2.i by A25, A26, FINSEQ_1:def 7
             .= P.k by A20, A21, FINSEQ_1:def 7;
          hence thesis by A8, A25, A29, Lm52;
          end;
          suppose ex Q being Formula-finset st
              ([Q,P2.i] in R
            & for t st t in Q ex l st l in dom P2 & l < i & P2.l = t);
          then consider Q being Formula-finset such that
            A40: [Q,P2.i] in R and
            A41: for t st t in Q ex l st l in dom P2 & l < i & P2.l = t;
          A42: [Q,P.k] in R by A20, A21, A40, FINSEQ_1:def 7;
          for t st t in Q ex n st n in dom P & n < k & P.n = t
            proof
            let t;
            assume t in Q;
            then consider l such that
              A44: l in dom P2 and
              A45: l < i and
              A46: P2.l = t by A41;
            take n = l + len P1;
            thus n in dom P by A44, FINSEQ_1:28;
            thus n < k by A21, A45, XREAL_1:6;
            thus P.n = t by A44, A46, FINSEQ_1:def 7;
            end;
          hence thesis by A42;
          end;
        end;
      end;
    reconsider S = rng P as Formula-finset;
    S = S1 \/ S2 by A4, A6, FINSEQ_1:31;
    hence thesis by A10;
end;
