let P be Instruction-Sequence of SCMPDS; :: thesis: for s being State of SCMPDS
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,P & while<>0 (a,i,I) is_halting_on s,P )

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,P & while<>0 (a,i,I) is_halting_on s,P )

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,P & while<>0 (a,i,I) is_halting_on s,P )

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,P & while<>0 (a,i,I) is_halting_on s,P )

let i be Integer; :: thesis: ( s . (DataLoc ((s . a),i)) = 0 implies ( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P ) )
set b = DataLoc ((s . a),i);
assume A1: s . (DataLoc ((s . a),i)) = 0 ; :: thesis: ( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P )
set WHL = while<>0 (a,i,I);
set pWH = stop (while<>0 (a,i,I));
set iWH = stop (while<>0 (a,i,I));
set s3 = Initialize s;
set P3 = P +* (stop (while<>0 (a,i,I)));
set s4 = Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1);
set s5 = Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),2);
set P4 = P +* (stop (while<>0 (a,i,I)));
set P5 = P +* (stop (while<>0 (a,i,I)));
A3: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18;
not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18;
then A4: (Initialize s) . (DataLoc (((Initialize s) . a),i)) = (Initialize s) . (DataLoc ((s . a),i)) by FUNCT_4:11
.= 0 by A1, A3, FUNCT_4:11 ;
set i1 = (a,i) <>0_goto 2;
set i2 = goto ((card I) + 2);
set i3 = goto (- ((card I) + 2));
A5: IC (Initialize s) = 0 by MEMSTR_0:47;
A6: while<>0 (a,i,I) = ((a,i) <>0_goto 2) ';' (((goto ((card I) + 2)) ';' I) ';' (goto (- ((card I) + 2)))) by Lm10;
Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),(0 + 1)) = Following ((P +* (stop (while<>0 (a,i,I)))),(Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),0))) by EXTPRO_1:3
.= Following ((P +* (stop (while<>0 (a,i,I)))),(Initialize s)) by EXTPRO_1:2
.= Exec (((a,i) <>0_goto 2),(Initialize s)) by A6, SCMPDS_6:11 ;
then A7: IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1)) = succ (IC (Initialize s)) by A4, SCMPDS_2:55
.= 0 + 1 by A5 ;
A8: stop (while<>0 (a,i,I)) c= P +* (stop (while<>0 (a,i,I))) by FUNCT_4:25;
then A9: stop (while<>0 (a,i,I)) c= P +* (stop (while<>0 (a,i,I))) ;
A10: 1 in dom (while<>0 (a,i,I)) by Th14;
then 1 in dom (stop (while<>0 (a,i,I))) by COMPOS_1:62;
then A11: (P +* (stop (while<>0 (a,i,I)))) . 1 = (stop (while<>0 (a,i,I))) . 1 by A9, GRFUNC_1:2
.= (while<>0 (a,i,I)) . 1 by A10, COMPOS_1:63
.= 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 COMPOS_1:64;
A14: (P +* (stop (while<>0 (a,i,I)))) /. (IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1))) = (P +* (stop (while<>0 (a,i,I)))) . (IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1))) by PBOOLE:143;
Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),(1 + 1)) = Following ((P +* (stop (while<>0 (a,i,I)))),(Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1))) by EXTPRO_1:3
.= Exec ((goto ((card I) + 2)),(Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1))) by A7, A11, A14 ;
then A16: IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),2)) = ICplusConst ((Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1)),((card I) + 2)) by SCMPDS_2:54
.= ((card I) + 2) + 1 by A7, SCMPDS_6:12
.= (card I) + (2 + 1) ;
A17: (P +* (stop (while<>0 (a,i,I)))) /. (IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),2))) = (P +* (stop (while<>0 (a,i,I)))) . (IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),2))) by PBOOLE:143;
stop (while<>0 (a,i,I)) c= P +* (stop (while<>0 (a,i,I))) by A8;
then (P +* (stop (while<>0 (a,i,I)))) . ((card I) + 3) = (stop (while<>0 (a,i,I))) . ((card I) + 3) by A13, GRFUNC_1:2
.= halt SCMPDS by A12, COMPOS_1:64 ;
then A18: CurInstr ((P +* (stop (while<>0 (a,i,I)))),(Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),2))) = halt SCMPDS by A16, A17;
now
let k be Element of NAT ; :: thesis: IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),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:7;
per cases ( k = 0 or k = 1 or 1 < k ) by A20, XXREAL_0:1;
suppose k = 0 ; :: thesis: IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),b1)) in dom (stop (while<>0 (a,i,I)))
then Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),k) = Initialize s by EXTPRO_1:2;
hence IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),k)) in dom (stop (while<>0 (a,i,I))) by A5, COMPOS_1:36; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),b1)) in dom (stop (while<>0 (a,i,I)))
hence IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),k)) in dom (stop (while<>0 (a,i,I))) by A10, A7, COMPOS_1:62; :: thesis: verum
end;
suppose 1 < k ; :: thesis: IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),b1)) in dom (stop (while<>0 (a,i,I)))
then 1 + 1 <= k by INT_1:7;
hence IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),k)) in dom (stop (while<>0 (a,i,I))) by A13, A16, A18, EXTPRO_1:5; :: thesis: verum
end;
end;
end;
hence while<>0 (a,i,I) is_closed_on s,P by SCMPDS_6:def 2; :: thesis: while<>0 (a,i,I) is_halting_on s,P
P +* (stop (while<>0 (a,i,I))) halts_on Initialize s by A18, EXTPRO_1:29;
hence while<>0 (a,i,I) is_halting_on s,P by SCMPDS_6:def 3; :: thesis: verum