reserve x for set,
  m,n for Nat,
  a,b,c for Int_position,
  i for Instruction of SCMPDS,
  s,s1,s2 for State of SCMPDS,
  k1,k2 for Integer,
  loc,l1 for Nat,
  I,J for Program of SCMPDS,
  N for with_non-empty_elements set;
reserve P,P1,P2,Q for Instruction-Sequence of SCMPDS;

theorem Th17:
 for s being 0-started State of SCMPDS
  for I being parahalting Program of SCMPDS,
      J being Program of SCMPDS, k being Nat
   st k <= LifeSpan(P +* stop I,s)
 holds Comput(P +* stop I,s,k) = Comput(P+*(I ';' J),s,k)
proof
  let s be 0-started State of SCMPDS;
  let I be parahalting Program of SCMPDS,J be Program of SCMPDS,
      k be Nat;
  set spI= stop I, P1 = P +* spI, P2 = P +* (I ';' J);
  set n=LifeSpan(P1,s);
  defpred X[Nat] means
   $1 <= n implies Comput(P1,s,$1) = Comput(P2,s,$1);
A1: for n being Nat st X[n] holds X[n+1]
  proof
    let m be Nat;
    assume
A2: m <= n implies Comput(P1,s,m) =  Comput(P2,s,m);
A3: Comput(P2,s,m+1) = Following(P2,Comput(P2,s,m)) by EXTPRO_1:3;
  spI c= P1 by FUNCT_4:25;
  then
A4: IC Comput(P1,s,m) in dom spI by SCMPDS_4:def 6;
A5: Comput(P1,s,m+1) = Following(P1,Comput(P1,s,m)) by EXTPRO_1:3;
    assume
A6: m+1 <= n;
A7: m < n by A6,NAT_1:13;
    then IC Comput(P1,s,m) in dom I by Th12;
    then
A8: IC Comput(P1,s,m) in dom (I ';' J) by FUNCT_4:12;
A9: IC Comput(P1,s,m) in dom I by A7,Th12;
    CurInstr(P1,Comput(P1,s,m))
       = P1.IC Comput(P1,s,m) by PBOOLE:143
      .= spI.IC Comput(P1,s,m) by A4,FUNCT_4:13
      .= I.IC Comput(P1,s,m) by A9,AFINSQ_1:def 3
      .= (I ';' J).IC Comput(P1,s,m) by A9,AFINSQ_1:def 3
      .= P2.IC Comput(P1,s,m) by A8,FUNCT_4:13
      .=CurInstr(P2,Comput(P2,s,m)) by A6,A2,NAT_1:13,PBOOLE:143;
    hence thesis by A2,A6,A5,A3,NAT_1:13;
  end;
A10: X[0];
   for k being Nat holds X[k] from NAT_1:sch 2(A10, A1);
  hence thesis;
end;
