 reserve i,j,n,k,l for Nat;
 reserve T,S,X,Y,Z for Subset of MC-wff;
 reserve p,q,r,t,F,H,G for Element of MC-wff;
 reserve s,U,V for MC-formula;
reserve f,g for FinSequence of [:MC-wff,Proof_Step_Kinds_IPC:];

theorem Th8:
  1 <= n & n <= len g & g,n is_a_correct_step_wrt_IPC X implies
  (f^g),(n+len f) is_a_correct_step_wrt_IPC X
proof
  assume that
A1: 1 <= n and
A2: n <= len g and
A3: g,n is_a_correct_step_wrt_IPC X;
  n in dom g by A1,A2,FINSEQ_3:25; then
A4: g.n = (f^g).(n+len f) by FINSEQ_1:def 7;
 n + len f <= len f + len g by A2,XREAL_1:6;
 then n+len f <= len(f^g) by FINSEQ_1:22;
 then ((f^g).(n+len f))`2 = 0 or ... or ((f^g).(n+len f))`2 = 10
           by A1,Th3,NAT_1:12;
 then per cases;
  case ((f^g).(n+len f))`2 = 0;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 1;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 2;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 3;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 4;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 5;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 6;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 7;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 8;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 9;
    hence thesis by A3,A4,Def3;
  end;
  case ((f^g).(n+len f))`2 = 10;
    then consider i,j,r,t such that
A5: 1 <= i and
A6: i < n and
A7: 1 <= j and
A8: j < i and
A9: r = (g.j)`1 & t = (g.n)`1 & (g.i)`1 = r => t by A3,A4,Def3;
A10: 1 <= i+len f & i+len f < n+len f by A5,A6,NAT_1:12,XREAL_1:6;
A11: 1 <= j+len f & j+len f < i+len f by A7,A8,NAT_1:12,XREAL_1:6;
A12: i <= len g by A2,A6,XXREAL_0:2; then
A13: j <= len g by A8,XXREAL_0:2;
    i in dom g by A5,A12,FINSEQ_3:25; then
A18:g.i = (f^g).(i+len f) by FINSEQ_1:def 7;
    j in dom g by A7,A13,FINSEQ_3:25; then
    g.j = (f^g).(j+len f) by FINSEQ_1:def 7;
    hence thesis by A4,A9,A10,A11,A18;
  end;
end;
