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 Th92:
  for s being State of SCMPDS,I being Program of SCMPDS,J being
  halt-free shiftable Program of SCMPDS,a being Int_position,k1 being Integer
  st s.DataLoc(s.a,k1) >= 0 & J is_closed_on s,P & J is_halting_on s,P
   holds IExec(if<0(a,k1,I,J),P,Initialize s)
    = IExec(J,P,Initialize s) +* Start-At((card I+card J+2),SCMPDS)
proof
  let s be State of SCMPDS,I be Program of SCMPDS,J be halt-free shiftable
  Program of SCMPDS,a be Int_position,k1 be Integer;
  set b=DataLoc(s.a,k1);
  set pJ=stop J, s1 = Initialize s, P1 = P +* pJ,
  IF=if<0(a,k1,I,J), pIF=
  stop IF, s3 = Initialize s, P3 = P +* pIF,
  s4 = Comput(P3,s3,1), P4 = P3;
  set i = (a,k1)>=0_goto (card I + 2);
  set G =Goto (card J+1), iG=i ';' I ';' G;
  set SAl=Start-At((card I+card J+2),SCMPDS);
A1: IF = i ';' (I ';' G) ';' J by SCMPDS_4:14
    .= i ';' (I ';' G ';' J) by SCMPDS_4:14;
A2: 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 A1,Th3;
A3: 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
A4: s3.DataLoc(s3.a,k1)=s3.b by FUNCT_4:11
    .= s.b by A3,FUNCT_4:11;
A5: IC s3 = 0 by MEMSTR_0:47;
  assume
  s.b >= 0;
  then
A6: IC s4 = ICplusConst(s3,card I + 2) by A2,A4,SCMPDS_2:57
    .= (0+(card I + 2)) by A5,Th4;
  for a holds s1.a = s4.a by A2,SCMPDS_2:57;
  then
A7: DataPart s1 = DataPart s4 by SCMPDS_4:8;
  card iG = card (i ';' I) + card G by AFINSQ_1:17
    .=card (i ';' I) + 1 by COMPOS_1:54
    .=card I +1 +1 by Th1
    .=card I +(1 +1);
  then
A8: Shift(pJ,card I+2) c= pIF by Th5;
  pIF c= P3 by FUNCT_4:25;
  then Shift(pJ,card I+2) c= P3 by A8,XBOOLE_1:1;
  then
A9: Shift(pJ,card I+2) c= P4;
  assume
A10: J is_closed_on s,P;
  then
A11: Start-At(0,SCMPDS) c= s1 & J is_closed_on s1,P1 by FUNCT_4:25;
A12:  stop J c= P1 by FUNCT_4:25;
  assume
A13: J is_halting_on s,P;
  then
A14: P1 halts_on s1;
A15: Comput(P3,s3,LifeSpan(P1,s1)+1)
 = Comput(P3,Comput(P3,s3,1),LifeSpan(P1
,s1))
by EXTPRO_1:4;
A16: CurInstr(P3,Comput(P3,s3,LifeSpan(P1,s1)+1))
     =CurInstr(P3,Comput(P3,s4,LifeSpan(P1,s1))) by A15
    .=CurInstr(P1,Comput(P1,s1,LifeSpan(P1,s1))) by A11,A9,A6,A7,Th22,A12
    .= halt SCMPDS by A14,EXTPRO_1:def 15;
  then
A17: P3 halts_on s3 by EXTPRO_1:29;
A18: CurInstr(P3,s3) = i by A1,Th3;
  now
    let l be Nat;
    assume
A19: l < LifeSpan(P1,s1) + 1;
A20: Comput(P3,s3,0) = s3 by EXTPRO_1:2;
    per cases;
    suppose
      l = 0;
      then CurInstr(P3,Comput(P3,s3,l))
       = CurInstr(P3,s3)
       by A20;
      hence CurInstr(P3,Comput(P3,s3,l))
       <> halt SCMPDS by A18;
    end;
    suppose
      l <> 0;
      then consider n be Nat such that
A21:  l = n + 1 by NAT_1:6;
      reconsider n as Nat;
A22:  n < LifeSpan(P1,s1) by A19,A21,XREAL_1:6;
      assume
A23:  CurInstr(P3,Comput(P3,s3,l)) = halt SCMPDS;
A24: Comput(P3,s3,n+1)
 = Comput(P3,Comput(P3,s3,1),n) by EXTPRO_1:4;
      CurInstr(P1,Comput(P1,s1,n))
       = CurInstr(P3,
      Comput(P3,s4,n)) by A11,A9,A6,A7,Th22,A12
        .= halt SCMPDS by A21,A23,A24;
      hence contradiction by A14,A22,EXTPRO_1:def 15;
    end;
  end;
  then for l be Nat st CurInstr(P3,
  Comput(P3,s3,l)) = halt SCMPDS
  holds LifeSpan(P1,s1) + 1 <= l;
  then
A25: LifeSpan(P3,s3) = LifeSpan(P1,s1) + 1 by A16,A17,EXTPRO_1:def 15;
A26: DataPart Result(P1,s1) = DataPart Comput(P1, s1
,LifeSpan(P1,s1)) by A14,EXTPRO_1:23
    .= DataPart Comput(P3, s4,LifeSpan(P1,s1))
    by A11,A9,A6,A7,Th22,A12
    .= DataPart Comput(P3, s3,LifeSpan(P1,s1) + 1)
by EXTPRO_1:4
    .= DataPart Result(P3,s3) by A17,A25,EXTPRO_1:23;
A27: now
    let x be object;
A28: dom SAl = {IC SCMPDS} by FUNCOP_1:13;
    assume
A29: x in dom IExec(IF,P,Initialize s);
    per cases by A29,SCMPDS_4:6;
    suppose
A30:  x is Int_position;
      then x <> IC SCMPDS by SCMPDS_2:43;
      then
A31:  not x in dom SAl by A28,TARSKI:def 1;
      thus IExec(IF,P,Initialize s).x = (Result(P3,s3)).x
        .= (Result(P1,s1)).x by A26,A30,SCMPDS_4:8
        .= IExec(J,P,Initialize s).x
        .= (IExec(J,P,Initialize s) +* SAl).x by A31,FUNCT_4:11;
    end;
    suppose
A32:  x = IC SCMPDS;
A33:  IC Result(P1,s1) = IC IExec(J,P,Initialize s)
        .=  (card J) by A10,A13,Th25;
A34:  x in dom SAl by A28,A32,TARSKI:def 1;
      thus IExec(IF,P,Initialize s).x = (Result(P3,s3)).x
        .= Comput(P3, s3,LifeSpan(P1,s1) + 1).x by A17,A25,EXTPRO_1:23
        .= IC Comput(P3, s4,LifeSpan(P1,s1)) by A32,EXTPRO_1:4
        .= IC Comput(P1, s1,LifeSpan(P1,s1)) + (card
I + 2) by A11,A9,A6,A7,Th22,A12
        .= IC Result(P1,s1) + (card I + 2) by A14,EXTPRO_1:23
        .= IC Start-At (card J + (card I + 2),SCMPDS) by A33,FUNCOP_1:72
        .= (IExec(J,P,Initialize s) +* SAl).x by A32,A34,FUNCT_4:13;
    end;
  end;
  dom IExec(IF,P,Initialize s) = the carrier of SCMPDS by PARTFUN1:def 2
    .= dom (IExec(J,P,Initialize s) +* SAl) by PARTFUN1:def 2;
  hence thesis by A27,FUNCT_1:2;
end;
