reserve x for set,
  m,n for Nat,
  a,b for Int_position,
  i,j,k for Instruction of SCMPDS,
  s,s1,s2 for State of SCMPDS,
  k1,k2 for Integer,
  loc,l for Nat,
  I,J,K for Program of SCMPDS;
reserve P,P1,P2,Q for Instruction-Sequence of SCMPDS;

theorem Th16:
  for s1 being 0-started State of SCMPDS
  for I being halt-free shiftable Program of SCMPDS st
   stop I c= P1 &
   I is_closed_on s1,P1 & I is_halting_on s1,P1
  for n being
  Nat st Shift(I,n) c= P2 & IC s2 =  n & DataPart
  s1 = DataPart s2 holds IC Comput(P2,s2,LifeSpan(P1,s1)) = card I + n &
  DataPart Comput(P1,s1,LifeSpan(P1,s1)) = DataPart
       Comput(P2,s2,LifeSpan(P1,s1))
proof
  let s1 be 0-started State of SCMPDS;
  let I be halt-free shiftable Program of SCMPDS;
  assume that
A1: stop I c= P1 and
A2: I is_closed_on s1,P1 and
A3: I is_halting_on s1,P1;
A4: Start-At(0,SCMPDS) c= s1 by MEMSTR_0:29;
A5: P1 +* stop I = P1 by A1,FUNCT_4:98;
  let n be Nat;
  assume that
A6: Shift(I,n) c= P2 and
A7: IC s2 =  n and
A8: DataPart s1 = DataPart s2;
  1+(0 qua Nat) <= LifeSpan(P1,s1) by A1,A3,Th15,INT_1:7;
  then consider i be Nat such that
A9: 1+i=LifeSpan(P1,s1) by NAT_1:10;
A10: Initialize s1 = s1 by A4,FUNCT_4:98;
  reconsider i as Nat;
A11: i < LifeSpan(P1,s1) by A9,XREAL_1:29;
  then
A12: IC Comput(P1,s1,i) + n = IC Comput(P2,s2,i) by A1,A2,A3,A6,A7,A8,Th14;
  set L1=IC Comput(P1,s1,i);
A13: L1 in dom I by A1,A2,A3,A9,Th13,XREAL_1:29;
  set i2=CurInstr(P2,Comput(P2,s2,i));
A14: Comput(P1,s1,i+1) = Following(P1,Comput(P1,s1,i)) by EXTPRO_1:3
    .= Exec(i2,Comput(P1,s1,i)) by A1,A2,A3,A6,A7,A8,A11,Th14;
A15: I c= stop I by AFINSQ_1:74;
  then
A16: dom I c= dom stop I by RELAT_1:11;
A17: Comput(P2,s2,i+1) = Following(P2,Comput(P2,s2,i)) by EXTPRO_1:3
    .=Exec(i2,Comput(P2,s2,i));
  reconsider m = L1 as Nat;
  i2=CurInstr(P1,Comput(P1,s1,i)) by A1,A2,A3,A6,A7,A8,A11,Th14;
  then
A18: i2=P1.L1 by PBOOLE:143
    .=(stop I).L1 by A1,A13,A16,GRFUNC_1:2
    .=I.L1 by A13,A15,GRFUNC_1:2;
  then
A19: InsCode i2 <> 1 by A13,SCMPDS_4:def 9;
A20: DataPart Comput(P1,s1,i) = DataPart Comput(P2,s2,i)
      by A1,A2,A3,A6,A7,A8,A11,Th14;
A21: i2 valid_at m by A13,A18,SCMPDS_4:def 9;
A22: InsCode i2 <> 3 by A13,A18,SCMPDS_4:def 9;
   IC Comput(P1,s1,i+1)= card I by A2,A3,A9,A5,A10,SCMPDS_6:29;
  hence IC Comput(P2,s2,LifeSpan(P1,s1)) =  card I +
n by A9,A12,A19,A22,A21,A14,A20,A17,SCMPDS_4:28;
  thus thesis by A9,A12,A19,A22,A21,A14,A20,A17,SCMPDS_4:28;
end;
