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