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

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

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

let k1 be Integer; :: thesis: ( s . (DataLoc (s . a),k1) < 0 implies ( if>=0 a,k1,I is_closed_on s & if>=0 a,k1,I is_halting_on s ) )
set b = DataLoc (s . a),k1;
assume A1: s . (DataLoc (s . a),k1) < 0 ; :: thesis: ( if>=0 a,k1,I is_closed_on s & if>=0 a,k1,I is_halting_on s )
set i = a,k1 >=0_goto 2;
set j = goto ((card I) + 1);
set IF = if>=0 a,k1,I;
set pIF = stop (if>=0 a,k1,I);
set IsIF = Initialized (stop (if>=0 a,k1,I));
set s3 = s +* (Initialized (stop (if>=0 a,k1,I)));
set s4 = Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1;
set s5 = Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2;
A2: if>=0 a,k1,I = (a,k1 >=0_goto 2) ';' ((goto ((card I) + 1)) ';' I) by SCMPDS_4:52;
A3: not DataLoc (s . a),k1 in dom (Initialized (stop (if>=0 a,k1,I))) by SCMPDS_4:31;
not a in dom (Initialized (stop (if>=0 a,k1,I))) by SCMPDS_4:31;
then A4: (s +* (Initialized (stop (if>=0 a,k1,I)))) . (DataLoc ((s +* (Initialized (stop (if>=0 a,k1,I)))) . a),k1) = (s +* (Initialized (stop (if>=0 a,k1,I)))) . (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)))) = 0 by FUNCT_4:26, SCMPDS_5:18;
Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),(0 + 1) = Following (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),0 ) by AMI_1:14
.= Following (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))) by AMI_1:13
.= Exec (a,k1 >=0_goto 2),(s +* (Initialized (stop (if>=0 a,k1,I)))) by A2, Th22 ;
then A6: IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1) = succ (IC (s +* (Initialized (stop (if>=0 a,k1,I))))) by A1, A4, SCMPDS_2:69
.= 0 + 1 by A5 ;
A7: Initialized (stop (if>=0 a,k1,I)) c= s +* (Initialized (stop (if>=0 a,k1,I))) by FUNCT_4:26;
then A8: stop (if>=0 a,k1,I) c= Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1 by AMI_1:81, SCMPDS_4:57;
A9: 1 in dom (if>=0 a,k1,I) by Lm9;
then 1 in dom (stop (if>=0 a,k1,I)) by Th18;
then A10: (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1) . 1 = (stop (if>=0 a,k1,I)) . 1 by A8, GRFUNC_1:8
.= (if>=0 a,k1,I) . 1 by A9, Th19
.= goto ((card I) + 1) by Lm10 ;
A11: card (if>=0 a,k1,I) = (card I) + 2 by Lm8;
then A12: (card I) + 2 in dom (stop (if>=0 a,k1,I)) by Th25;
Y: (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1)) /. (IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1)) = (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1) . (IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1)) by AMI_1:150;
T: ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I)))) = ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1) by AMI_1:144;
Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),(1 + 1) = Following (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1) by AMI_1:14
.= Exec (goto ((card I) + 1)),(Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1) by A6, A10, Y, T ;
then A13: IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2) = ICplusConst (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),1),((card I) + 1) by SCMPDS_2:66
.= ((card I) + 1) + 1 by A6, Th23
.= (card I) + (1 + 1) ;
Y: (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2)) /. (IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2)) = (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2) . (IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2)) by AMI_1:150;
stop (if>=0 a,k1,I) c= Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2 by A7, AMI_1:81, SCMPDS_4:57;
then (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2) . ((card I) + 2) = (stop (if>=0 a,k1,I)) . ((card I) + 2) by A12, GRFUNC_1:8
.= halt SCMPDS by A11, Th25 ;
then A14: CurInstr (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2)),(Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2) = halt SCMPDS by A13, Y;
now
let k be Element of NAT ; :: thesis: IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),b1) in dom (stop (if>=0 a,k1,I))
A15: ( k = 0 or 0 + 1 <= k ) by INT_1:20;
TX: ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I)))) = ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),2) by AMI_1:144;
per cases ( k = 0 or k = 1 or 1 < k ) by A15, XXREAL_0:1;
suppose k = 0 ; :: thesis: IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),b1) in dom (stop (if>=0 a,k1,I))
then Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),k = s +* (Initialized (stop (if>=0 a,k1,I))) by AMI_1:13;
hence IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),k) in dom (stop (if>=0 a,k1,I)) by A5, SCMPDS_4:75; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),b1) in dom (stop (if>=0 a,k1,I))
hence IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),k) in dom (stop (if>=0 a,k1,I)) by A9, A6, Th18; :: thesis: verum
end;
suppose 1 < k ; :: thesis: IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),b1) in dom (stop (if>=0 a,k1,I))
then 1 + 1 <= k by INT_1:20;
hence IC (Comput (ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I))))),(s +* (Initialized (stop (if>=0 a,k1,I)))),k) in dom (stop (if>=0 a,k1,I)) by A12, A13, A14, AMI_1:52, TX; :: thesis: verum
end;
end;
end;
hence if>=0 a,k1,I is_closed_on s by Def2; :: thesis: if>=0 a,k1,I is_halting_on s
ProgramPart (s +* (Initialized (stop (if>=0 a,k1,I)))) halts_on s +* (Initialized (stop (if>=0 a,k1,I))) by A14, AMI_1:146;
hence if>=0 a,k1,I is_halting_on s by Def3; :: thesis: verum