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