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 Th51:
  for B, R, a st B, R |- a holds a in B or ex S st [S, a] in R
    & for b st b in S holds B, R |- b
proof
  let B, R, a;
  assume that
    A1: B, R |- a and
    A2: not a in B;
  consider P such that
    A3: a in rng P and
    A4: P is (B, R)-correct by A1;
  consider c such that
    A5: c in dom P and
    A6: P.c = a by A3, FUNCT_1:def 3;
  c in Seg len P by A5, FINSEQ_1:def 3;
  then reconsider n = c as Nat;
  P, n is_a_correct_step_wrt B, R by A4, A5;
  then consider Q being Formula-finset such that
    A10: [Q, P.n] in R and
    A11: for t st t in Q ex k
            st k in dom P & k < n & P.k = t by A2, A6;
  take Q;
  thus [Q, a] in R by A6, A10;
  let u;
  assume u in Q;
  then consider k such that
    A15: k in dom P and
         k < n and
    A17: P.k = u by A11;
  u in rng P by A15, A17, FUNCT_1:3;
  hence B, R |- u by A4;
end;
