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)));
A2: 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 A3: (Initialize s) . (DataLoc (((Initialize s) . a),i)) = (Initialize s) . (DataLoc ((s . a),i)) by FUNCT_4:11
.= 0 by A1, A2, FUNCT_4:11 ;
set i1 = (a,i) <>0_goto 2;
set i2 = goto ((card I) + 2);
set i3 = goto (- ((card I) + 2));
A4: IC (Initialize s) = 0 by MEMSTR_0:47;
A5: while<>0 (a,i,I) = ((a,i) <>0_goto 2) ';' (((goto ((card I) + 2)) ';' I) ';' (goto (- ((card I) + 2)))) by Lm8;
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))
.= Exec (((a,i) <>0_goto 2),(Initialize s)) by A5, SCMPDS_6:11 ;
then A6: IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),1)) = (IC (Initialize s)) + 1 by A3, SCMPDS_2:55
.= 0 + 1 by A4 ;
A7: stop (while<>0 (a,i,I)) c= P +* (stop (while<>0 (a,i,I))) by FUNCT_4:25;
then A8: stop (while<>0 (a,i,I)) c= P +* (stop (while<>0 (a,i,I))) ;
A9: 1 in dom (while<>0 (a,i,I)) by Th10;
then 1 in dom (stop (while<>0 (a,i,I))) by COMPOS_1:62;
then A10: (P +* (stop (while<>0 (a,i,I)))) . 1 = (stop (while<>0 (a,i,I))) . 1 by A8, GRFUNC_1:2
.= (while<>0 (a,i,I)) . 1 by A9, COMPOS_1:63
.= goto ((card I) + 2) by Th11 ;
A11: card (while<>0 (a,i,I)) = (card I) + 3 by Th8;
then A12: (card I) + 3 in dom (stop (while<>0 (a,i,I))) by COMPOS_1:64;
A13: (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 A6, A10, A13 ;
then A14: 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 A6, SCMPDS_6:12
.= (card I) + (2 + 1) ;
A15: (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 A7;
then (P +* (stop (while<>0 (a,i,I)))) . ((card I) + 3) = (stop (while<>0 (a,i,I))) . ((card I) + 3) by A12, GRFUNC_1:2
.= halt SCMPDS by A11, COMPOS_1:64 ;
then A16: CurInstr ((P +* (stop (while<>0 (a,i,I)))),(Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),2))) = halt SCMPDS by A14, A15;
now :: thesis: for k being Nat holds IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),k)) in dom (stop (while<>0 (a,i,I)))
let k be 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 ) ;
then A17: ( k = 0 or 0 + 1 <= k ) by INT_1:7;
per cases ( k = 0 or k = 1 or 1 < k ) by A17, 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 ;
hence IC (Comput ((P +* (stop (while<>0 (a,i,I)))),(Initialize s),k)) in dom (stop (while<>0 (a,i,I))) by A4, 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 A9, A6, 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 A12, A14, A16, 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 A16, EXTPRO_1:29;
hence while<>0 (a,i,I) is_halting_on s,P by SCMPDS_6:def 3; :: thesis: verum