let s be State of SCMPDS ; :: thesis: for I being Program of SCMPDS
for J being shiftable Program of SCMPDS
for a being Int_position
for k1 being Integer st s . (DataLoc (s . a),k1) <= 0 & J is_closed_on s & J is_halting_on s holds
( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s )

let I be Program of SCMPDS ; :: thesis: for J being shiftable Program of SCMPDS
for a being Int_position
for k1 being Integer st s . (DataLoc (s . a),k1) <= 0 & J is_closed_on s & J is_halting_on s holds
( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s )

let J be shiftable Program of SCMPDS ; :: thesis: for a being Int_position
for k1 being Integer st s . (DataLoc (s . a),k1) <= 0 & J is_closed_on s & J is_halting_on s holds
( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s )

let a be Int_position ; :: thesis: for k1 being Integer st s . (DataLoc (s . a),k1) <= 0 & J is_closed_on s & J is_halting_on s holds
( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s )

let k1 be Integer; :: thesis: ( s . (DataLoc (s . a),k1) <= 0 & J is_closed_on s & J is_halting_on s implies ( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s ) )
set b = DataLoc (s . a),k1;
set pJ = stop J;
set IsJ = Initialized (stop J);
set s1 = s +* (Initialized (stop J));
set IF = if>0 a,k1,I,J;
set pIF = stop (if>0 a,k1,I,J);
set IsIF = Initialized (stop (if>0 a,k1,I,J));
set s3 = s +* (Initialized (stop (if>0 a,k1,I,J)));
set s4 = Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1;
set i = a,k1 <=0_goto ((card I) + 2);
set G = Goto ((card J) + 1);
set iG = ((a,k1 <=0_goto ((card I) + 2)) ';' I) ';' (Goto ((card J) + 1));
A1: if>0 a,k1,I,J = ((a,k1 <=0_goto ((card I) + 2)) ';' (I ';' (Goto ((card J) + 1)))) ';' J by SCMPDS_4:50
.= (a,k1 <=0_goto ((card I) + 2)) ';' ((I ';' (Goto ((card J) + 1))) ';' J) by SCMPDS_4:50 ;
A2: Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),(0 + 1) = Following (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),0 ) by AMI_1:14
.= Following (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))) by AMI_1:13
.= Exec (a,k1 <=0_goto ((card I) + 2)),(s +* (Initialized (stop (if>0 a,k1,I,J)))) by A1, Th22 ;
A3: not DataLoc (s . a),k1 in dom (Initialized (stop (if>0 a,k1,I,J))) by SCMPDS_4:31;
not a in dom (Initialized (stop (if>0 a,k1,I,J))) by SCMPDS_4:31;
then A4: (s +* (Initialized (stop (if>0 a,k1,I,J)))) . (DataLoc ((s +* (Initialized (stop (if>0 a,k1,I,J)))) . a),k1) = (s +* (Initialized (stop (if>0 a,k1,I,J)))) . (DataLoc (s . a),k1) by FUNCT_4:12
.= s . (DataLoc (s . a),k1) by A3, FUNCT_4:12 ;
A5: IC (s +* (Initialized (stop (if>0 a,k1,I,J)))) = 0 by FUNCT_4:26, SCMPDS_5:18;
assume s . (DataLoc (s . a),k1) <= 0 ; :: thesis: ( not J is_closed_on s or not J is_halting_on s or ( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s ) )
then A6: IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1) = ICplusConst (s +* (Initialized (stop (if>0 a,k1,I,J)))),((card I) + 2) by A2, A4, SCMPDS_2:68
.= 0 + ((card I) + 2) by A5, Th23 ;
assume A7: J is_closed_on s ; :: thesis: ( not J is_halting_on s or ( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s ) )
then A8: ( Initialized (stop J) c= s +* (Initialized (stop J)) & J is_closed_on s +* (Initialized (stop J)) ) by Th38, FUNCT_4:26;
A9: stop (if>0 a,k1,I,J) c= s +* (Initialized (stop (if>0 a,k1,I,J))) by FUNCT_4:26, SCMPDS_4:57;
A10: card (((a,k1 <=0_goto ((card I) + 2)) ';' I) ';' (Goto ((card J) + 1))) = (card ((a,k1 <=0_goto ((card I) + 2)) ';' I)) + (card (Goto ((card J) + 1))) by SCMPDS_4:45
.= (card ((a,k1 <=0_goto ((card I) + 2)) ';' I)) + 1 by SCMPDS_5:6
.= ((card I) + 1) + 1 by Th15
.= (card I) + (1 + 1) ;
then Shift (stop J),((card I) + 2) c= stop (if>0 a,k1,I,J) by Th24;
then Shift (stop J),((card I) + 2) c= s +* (Initialized (stop (if>0 a,k1,I,J))) by A9, XBOOLE_1:1;
then A11: Shift (stop J),((card I) + 2) c= Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1 by AMI_1:81;
assume J is_halting_on s ; :: thesis: ( if>0 a,k1,I,J is_closed_on s & if>0 a,k1,I,J is_halting_on s )
then A12: ProgramPart (s +* (Initialized (stop J))) halts_on s +* (Initialized (stop J)) by Def3;
A13: DataPart (s +* (Initialized (stop J))) = DataPart (s +* (Initialized (stop (if>0 a,k1,I,J)))) by SCMPDS_4:24, SCMPDS_4:36;
now
let a be Int_position ; :: thesis: (s +* (Initialized (stop J))) . a = (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1) . a
thus (s +* (Initialized (stop J))) . a = (s +* (Initialized (stop (if>0 a,k1,I,J)))) . a by A13, SCMPDS_4:23
.= (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1) . a by A2, SCMPDS_2:68 ; :: thesis: verum
end;
then A14: DataPart (s +* (Initialized (stop J))) = DataPart (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1) by SCMPDS_4:23;
now
let k be Element of NAT ; :: thesis: IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),b1) in dom (stop (if>0 a,k1,I,J))
per cases ( 0 < k or k = 0 ) ;
suppose 0 < k ; :: thesis: IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),b1) in dom (stop (if>0 a,k1,I,J))
then consider k1 being Nat such that
A15: k1 + 1 = k by NAT_1:6;
reconsider k1 = k1 as Element of NAT by ORDINAL1:def 13;
reconsider m = IC (Comput (ProgramPart (s +* (Initialized (stop J)))),(s +* (Initialized (stop J))),k1) as Element of NAT ;
m in dom (stop J) by A7, Def2;
then m < card (stop J) by SCMPDS_4:1;
then A16: m + ((card I) + 2) < (card (stop J)) + ((card I) + 2) by XREAL_1:8;
A17: card (stop J) = (card J) + 1 by SCMPDS_5:7;
A18: card (stop (if>0 a,k1,I,J)) = (card (if>0 a,k1,I,J)) + 1 by SCMPDS_5:7
.= (((card I) + 2) + (card J)) + 1 by A10, SCMPDS_4:45
.= ((card I) + 2) + (card (stop J)) by A17 ;
T: ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J)))) = ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1) by AMI_1:144;
IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),k) = IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1),k1) by A15, AMI_1:51
.= m + ((card I) + 2) by A8, A14, A11, A6, Th45, T ;
hence IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),k) in dom (stop (if>0 a,k1,I,J)) by A18, A16, SCMPDS_4:1; :: thesis: verum
end;
suppose k = 0 ; :: thesis: IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),b1) in dom (stop (if>0 a,k1,I,J))
then Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),k = s +* (Initialized (stop (if>0 a,k1,I,J))) by AMI_1:13;
hence IC (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),k) in dom (stop (if>0 a,k1,I,J)) by A5, SCMPDS_4:75; :: thesis: verum
end;
end;
end;
hence if>0 a,k1,I,J is_closed_on s by Def2; :: thesis: if>0 a,k1,I,J is_halting_on s
T: ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J)))) = ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1) by AMI_1:144;
x: Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),((LifeSpan (s +* (Initialized (stop J)))) + 1) = Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1),(LifeSpan (s +* (Initialized (stop J)))) by AMI_1:51;
CurInstr (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),((LifeSpan (s +* (Initialized (stop J)))) + 1))),(Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),((LifeSpan (s +* (Initialized (stop J)))) + 1)) = CurInstr (ProgramPart (Comput (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1)),(Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1),(LifeSpan (s +* (Initialized (stop J)))))),(Comput (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1)),(Comput (ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J))))),(s +* (Initialized (stop (if>0 a,k1,I,J)))),1),(LifeSpan (s +* (Initialized (stop J))))) by x, T
.= CurInstr (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop J)))),(s +* (Initialized (stop J))),(LifeSpan (s +* (Initialized (stop J)))))),(Comput (ProgramPart (s +* (Initialized (stop J)))),(s +* (Initialized (stop J))),(LifeSpan (s +* (Initialized (stop J))))) by A8, A14, A11, A6, Th45
.= halt SCMPDS by A12, AMI_1:def 46 ;
then ProgramPart (s +* (Initialized (stop (if>0 a,k1,I,J)))) halts_on s +* (Initialized (stop (if>0 a,k1,I,J))) by AMI_1:146;
hence if>0 a,k1,I,J is_halting_on s by Def3; :: thesis: verum