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

theorem Th99:
  for s being State of SCMPDS, I being shiftable Program of
  SCMPDS, a being Int_position,k1 being Integer st s.DataLoc(s.a,k1) < 0 & I
is_closed_on s,P & I is_halting_on s,P holds if<0(a,k1,I) is_closed_on s,P
 & if<0(a,
  k1,I) is_halting_on s,P
proof
  let s be State of SCMPDS, I be shiftable Program of SCMPDS, a be
  Int_position,k1 be Integer;
  set b=DataLoc(s.a,k1);
  set IF=if<0(a,k1,I), pIF=stop IF, pI=stop I,
   s2 = Initialize s, s3 = Initialize s,
   P2 = P +* pI, P3 = P +* pIF,
   s4 = Comput(P3,s3,1), P4 = P3;
  set i = (a,k1)>=0_goto (card I + 1);
A1:  stop I c= P2 by FUNCT_4:25;
A2:  0 in dom pIF by COMPOS_1:36;
A3: IC s3 = 0 by MEMSTR_0:47;
A4: not b in dom Start-At(0,SCMPDS) by SCMPDS_4:18;
  not a in dom Start-At(0,SCMPDS) by SCMPDS_4:18;
  then
A5: s3.DataLoc(s3.a,k1)=s3.b by FUNCT_4:11
    .= s.b by A4,FUNCT_4:11;
A6: Comput(P3, s3,0 + 1) = Following(P3,Comput(P3,s3,0)) by EXTPRO_1:3
    .= Following(P3,s3) by EXTPRO_1:2
    .= Exec(i,s3) by Th3;
  for a holds s2.a = s4.a by A6,SCMPDS_2:57;
  then
A7: DataPart s2 = DataPart s4 by SCMPDS_4:8;
  assume
  s.b < 0;
  then
A8: IC s4 = IC s3 + 1 by A6,A5,SCMPDS_2:57
    .= (0+1) by A3;
  assume
A9: I is_closed_on s,P;
  then
A10: I is_closed_on s2,P2;
  assume
  I is_halting_on s,P;
  then
A11: P2 halts_on s2;
A12: Start-At(0,SCMPDS) c= s2 & Shift(pI,1) c= P4 by Lm6,FUNCT_4:25;
A13: card pIF = card IF +1 by COMPOS_1:55
    .= card I +1+1 by Th1;
  now
    let k be Nat;
    per cases;
    suppose
      0 < k;
      then consider k1 being Nat such that
A14:  k1 + 1 = k by NAT_1:6;
      reconsider k1 as Nat;
      reconsider m = IC Comput(P2, s2,k1) as Nat;
A15:  card pIF = card pI+1 by A13,COMPOS_1:55;
       m in dom pI by A9;
      then m < card pI by AFINSQ_1:66;
      then
A16:  m+1 < card pIF by A15,XREAL_1:6;
      IC Comput(P3,s3,k) = IC Comput(P3, s4,k1) by A14,EXTPRO_1:4
        .=  (m + 1) by A10,A12,A8,A7,Th22,A1;
      hence IC Comput(P3,s3,k) in dom pIF by A16,AFINSQ_1:66;
    end;
    suppose
      k = 0;
      hence IC Comput(P3,s3,k) in dom pIF by A2,A3,EXTPRO_1:2;
    end;
  end;
  hence IF is_closed_on s,P;
A17: Comput(P3,s3,LifeSpan(P2,s2)+1)
 = Comput(P3,Comput(P3,s3,1),LifeSpan(P2
,s2))
by EXTPRO_1:4;
  CurInstr(P3,
  Comput(P3,s3,LifeSpan(P2,s2)+1))
   =CurInstr(P3,
   Comput(P3,s4,LifeSpan(P2,s2))) by A17
    .=CurInstr(P2,
    Comput(P2,s2,LifeSpan(P2,s2))) by A10,A12,A8,A7,Th22,A1
    .= halt SCMPDS by A11,EXTPRO_1:def 15;
  then P3 halts_on s3 by EXTPRO_1:29;
  hence thesis;
end;
