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

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

let I be Program of ; :: 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,P & if<>0 (a,k1,I) is_halting_on s,P )

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

let k1 be Integer; :: thesis: ( s . (DataLoc ((s . a),k1)) = 0 implies ( if<>0 (a,k1,I) is_closed_on s,P & if<>0 (a,k1,I) is_halting_on s,P ) )
set b = DataLoc ((s . a),k1);
assume A1: s . (DataLoc ((s . a),k1)) = 0 ; :: thesis: ( if<>0 (a,k1,I) is_closed_on s,P & if<>0 (a,k1,I) is_halting_on s,P )
set IF = if<>0 (a,k1,I);
set pIF = stop (if<>0 (a,k1,I));
set s3 = Initialize s;
set P3 = P +* (stop (if<>0 (a,k1,I)));
set s4 = Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),1);
set s5 = Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),2);
set P4 = P +* (stop (if<>0 (a,k1,I)));
set P5 = P +* (stop (if<>0 (a,k1,I)));
A2: not DataLoc ((s . a),k1) 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),k1)) = (Initialize s) . (DataLoc ((s . a),k1)) by FUNCT_4:11
.= 0 by A1, A2, FUNCT_4:11 ;
A4: stop (if<>0 (a,k1,I)) c= P +* (stop (if<>0 (a,k1,I))) by FUNCT_4:25;
set i = (a,k1) <>0_goto 2;
set j = goto ((card I) + 1);
A5: if<>0 (a,k1,I) = ((a,k1) <>0_goto 2) ';' ((goto ((card I) + 1)) ';' I) by SCMPDS_4:16;
A6: IC (Initialize s) = 0 by MEMSTR_0:47;
Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),(0 + 1)) = Following ((P +* (stop (if<>0 (a,k1,I)))),(Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),0))) by EXTPRO_1:3
.= Following ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s)) by EXTPRO_1:2
.= Exec (((a,k1) <>0_goto 2),(Initialize s)) by A5, Th3 ;
then A7: IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),1)) = (IC (Initialize s)) + 1 by A3, SCMPDS_2:55
.= 0 + 1 by A6 ;
A8: 1 in dom (if<>0 (a,k1,I)) by Lm9;
then 1 in dom (stop (if<>0 (a,k1,I))) by COMPOS_1:62;
then A9: (P +* (stop (if<>0 (a,k1,I)))) . 1 = (stop (if<>0 (a,k1,I))) . 1 by A4, GRFUNC_1:2
.= (if<>0 (a,k1,I)) . 1 by A8, COMPOS_1:63
.= goto ((card I) + 1) by Lm10 ;
A10: card (if<>0 (a,k1,I)) = (card I) + 2 by Lm8;
then A11: (card I) + 2 in dom (stop (if<>0 (a,k1,I))) by COMPOS_1:64;
A12: (P +* (stop (if<>0 (a,k1,I)))) /. (IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),1))) = (P +* (stop (if<>0 (a,k1,I)))) . (IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),1))) by PBOOLE:143;
Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),(1 + 1)) = Following ((P +* (stop (if<>0 (a,k1,I)))),(Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),1))) by EXTPRO_1:3
.= Exec ((goto ((card I) + 1)),(Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),1))) by A7, A9, A12 ;
then A13: IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),2)) = ICplusConst ((Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),1)),((card I) + 1)) by SCMPDS_2:54
.= ((card I) + 1) + 1 by A7, Th4
.= (card I) + (1 + 1) ;
A14: (P +* (stop (if<>0 (a,k1,I)))) /. (IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),2))) = (P +* (stop (if<>0 (a,k1,I)))) . (IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),2))) by PBOOLE:143;
stop (if<>0 (a,k1,I)) c= P +* (stop (if<>0 (a,k1,I))) by FUNCT_4:25;
then (P +* (stop (if<>0 (a,k1,I)))) . ((card I) + 2) = (stop (if<>0 (a,k1,I))) . ((card I) + 2) by A11, GRFUNC_1:2
.= halt SCMPDS by A10, COMPOS_1:64 ;
then A15: CurInstr ((P +* (stop (if<>0 (a,k1,I)))),(Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),2))) = halt SCMPDS by A13, A14;
now :: thesis: for k being Nat holds IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),k)) in dom (stop (if<>0 (a,k1,I)))
let k be Nat; :: thesis: IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),b1)) in dom (stop (if<>0 (a,k1,I)))
A16: ( k = 0 or 0 + 1 <= k ) by INT_1:7;
per cases ( k = 0 or k = 1 or 1 < k ) by A16, XXREAL_0:1;
suppose k = 0 ; :: thesis: IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),b1)) in dom (stop (if<>0 (a,k1,I)))
then Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),k) = Initialize s by EXTPRO_1:2;
hence IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),k)) in dom (stop (if<>0 (a,k1,I))) by A6, COMPOS_1:36; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),b1)) in dom (stop (if<>0 (a,k1,I)))
hence IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),k)) in dom (stop (if<>0 (a,k1,I))) by A8, A7, COMPOS_1:62; :: thesis: verum
end;
suppose 1 < k ; :: thesis: IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),b1)) in dom (stop (if<>0 (a,k1,I)))
then 1 + 1 <= k by INT_1:7;
hence IC (Comput ((P +* (stop (if<>0 (a,k1,I)))),(Initialize s),k)) in dom (stop (if<>0 (a,k1,I))) by A11, A13, A15, EXTPRO_1:5; :: thesis: verum
end;
end;
end;
hence if<>0 (a,k1,I) is_closed_on s,P ; :: thesis: if<>0 (a,k1,I) is_halting_on s,P
P +* (stop (if<>0 (a,k1,I))) halts_on Initialize s by A15, EXTPRO_1:29;
hence if<>0 (a,k1,I) is_halting_on s,P ; :: thesis: verum