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

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

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

let i be Integer; :: thesis: ( s . (DataLoc ((s . a),i)) = 0 implies ( while<>0 (a,i,I) is_closed_on s & while<>0 (a,i,I) is_halting_on s ) )
set b = DataLoc ((s . a),i);
assume A1: s . (DataLoc ((s . a),i)) = 0 ; :: thesis: ( while<>0 (a,i,I) is_closed_on s & while<>0 (a,i,I) is_halting_on s )
set WHL = while<>0 (a,i,I);
set pWH = stop (while<>0 (a,i,I));
set iWH = Initialize (stop (while<>0 (a,i,I)));
set s3 = (Initialize s) +* (stop (while<>0 (a,i,I)));
set s4 = Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1);
set s5 = Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2);
A2: (Initialize s) +* (stop (while<>0 (a,i,I))) = s +* (Initialize (stop (while<>0 (a,i,I)))) by COMPOS_1:125;
A3: not DataLoc ((s . a),i) in dom (Initialize (stop (while<>0 (a,i,I)))) by SCMPDS_4:31;
not a in dom (Initialize (stop (while<>0 (a,i,I)))) by SCMPDS_4:31;
then A4: ((Initialize s) +* (stop (while<>0 (a,i,I)))) . (DataLoc ((((Initialize s) +* (stop (while<>0 (a,i,I)))) . a),i)) = ((Initialize s) +* (stop (while<>0 (a,i,I)))) . (DataLoc ((s . a),i)) by A2, FUNCT_4:12
.= 0 by A1, A3, A2, FUNCT_4:12 ;
set i1 = (a,i) <>0_goto 2;
set i2 = goto ((card I) + 2);
set i3 = goto (- ((card I) + 2));
A5: IC ((Initialize s) +* (stop (while<>0 (a,i,I)))) = 0 by SCMPDS_6:21;
A6: while<>0 (a,i,I) = ((a,i) <>0_goto 2) ';' (((goto ((card I) + 2)) ';' I) ';' (goto (- ((card I) + 2)))) by Lm10;
Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),(0 + 1)) = Following ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),(Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),0))) by EXTPRO_1:4
.= Following ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I))))) by EXTPRO_1:3
.= Exec (((a,i) <>0_goto 2),((Initialize s) +* (stop (while<>0 (a,i,I))))) by A6, A2, SCMPDS_6:22 ;
then A7: IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1)) = succ (IC ((Initialize s) +* (stop (while<>0 (a,i,I))))) by A4, SCMPDS_2:67
.= 0 + 1 by A5 ;
A8: Initialize (stop (while<>0 (a,i,I))) c= (Initialize s) +* (stop (while<>0 (a,i,I))) by A2, FUNCT_4:26;
then A9: stop (while<>0 (a,i,I)) c= Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1) by AMI_1:81, COMPOS_1:132;
A10: 1 in dom (while<>0 (a,i,I)) by Th14;
then 1 in dom (stop (while<>0 (a,i,I))) by SCMPDS_6:18;
then A11: (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1)) . 1 = (stop (while<>0 (a,i,I))) . 1 by A9, GRFUNC_1:8
.= (while<>0 (a,i,I)) . 1 by A10, SCMPDS_6:19
.= goto ((card I) + 2) by Th15 ;
A12: card (while<>0 (a,i,I)) = (card I) + 3 by Th12;
then A13: (card I) + 3 in dom (stop (while<>0 (a,i,I))) by SCMPDS_6:25;
A14: (ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1))) /. (IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1))) = (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1)) . (IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1))) by COMPOS_1:38;
A15: ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I)))) = ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1)) by AMI_1:123;
Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),(1 + 1)) = Following ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),(Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1))) by EXTPRO_1:4
.= Exec ((goto ((card I) + 2)),(Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1))) by A7, A11, A14, A15 ;
then A16: IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2)) = ICplusConst ((Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),1)),((card I) + 2)) by SCMPDS_2:66
.= ((card I) + 2) + 1 by A7, SCMPDS_6:23
.= (card I) + (2 + 1) ;
A17: (ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2))) /. (IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2))) = (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2)) . (IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2))) by COMPOS_1:38;
stop (while<>0 (a,i,I)) c= Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2) by A8, AMI_1:81, COMPOS_1:132;
then (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2)) . ((card I) + 3) = (stop (while<>0 (a,i,I))) . ((card I) + 3) by A13, GRFUNC_1:8
.= halt SCMPDS by A12, SCMPDS_6:25 ;
then A18: CurInstr ((ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2))),(Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2))) = halt SCMPDS by A16, A17;
A19: ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I)))) = ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),2)) by AMI_1:123;
now
let k be Element of NAT ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),b1)) in dom (stop (while<>0 (a,i,I)))
( k = 0 or 0 < k ) by NAT_1:3;
then A20: ( k = 0 or 0 + 1 <= k ) by INT_1:20;
per cases ( k = 0 or k = 1 or 1 < k ) by A20, XXREAL_0:1;
suppose k = 0 ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),b1)) in dom (stop (while<>0 (a,i,I)))
then Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),k) = (Initialize s) +* (stop (while<>0 (a,i,I))) by EXTPRO_1:3;
hence IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),k)) in dom (stop (while<>0 (a,i,I))) by A5, COMPOS_1:135; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),b1)) in dom (stop (while<>0 (a,i,I)))
hence IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),k)) in dom (stop (while<>0 (a,i,I))) by A10, A7, SCMPDS_6:18; :: thesis: verum
end;
suppose 1 < k ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),b1)) in dom (stop (while<>0 (a,i,I)))
then 1 + 1 <= k by INT_1:20;
hence IC (Comput ((ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I))))),((Initialize s) +* (stop (while<>0 (a,i,I)))),k)) in dom (stop (while<>0 (a,i,I))) by A13, A16, A18, A19, EXTPRO_1:6; :: thesis: verum
end;
end;
end;
hence while<>0 (a,i,I) is_closed_on s by SCMPDS_6:def 2; :: thesis: while<>0 (a,i,I) is_halting_on s
ProgramPart ((Initialize s) +* (stop (while<>0 (a,i,I)))) halts_on (Initialize s) +* (stop (while<>0 (a,i,I))) by A18, A19, EXTPRO_1:30;
hence while<>0 (a,i,I) is_halting_on s by SCMPDS_6:def 3; :: thesis: verum