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

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,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 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 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)));
A3: if<=0 (a,k1,I) = ((a,k1) <=0_goto 2) ';' ((goto ((card I) + 1)) ';' I) by SCMPDS_4:16;
A4: 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 A5: (Initialize s) . (DataLoc (((Initialize s) . a),k1)) = (Initialize s) . (DataLoc ((s . a),k1)) by FUNCT_4:11
.= s . (DataLoc ((s . a),k1)) by A4, FUNCT_4:11 ;
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 A3, Th22 ;
then A7: IC (Comput ((P +* (stop (if<=0 (a,k1,I)))),(Initialize s),1)) = succ (IC (Initialize s)) by A1, A5, SCMPDS_2:56
.= 0 + 1 by A6 ;
A8: stop (if<=0 (a,k1,I)) c= P +* (stop (if<=0 (a,k1,I))) by FUNCT_4:25;
then A9: stop (if<=0 (a,k1,I)) c= P +* (stop (if<=0 (a,k1,I))) ;
A10: 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 A11: (P +* (stop (if<=0 (a,k1,I)))) . 1 = (stop (if<=0 (a,k1,I))) . 1 by A9, GRFUNC_1:2
.= (if<=0 (a,k1,I)) . 1 by A10, COMPOS_1:63
.= goto ((card I) + 1) by Lm10 ;
A12: card (if<=0 (a,k1,I)) = (card I) + 2 by Lm8;
then A13: (card I) + 2 in dom (stop (if<=0 (a,k1,I))) by COMPOS_1:64;
A14: (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, A11, A14 ;
then A16: 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, Th23
.= (card I) + (1 + 1) ;
A17: (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 A8;
then (P +* (stop (if<=0 (a,k1,I)))) . ((card I) + 2) = (stop (if<=0 (a,k1,I))) . ((card I) + 2) by A13, GRFUNC_1:2
.= halt SCMPDS by A12, COMPOS_1:64 ;
then A19: CurInstr ((P +* (stop (if<=0 (a,k1,I)))),(Comput ((P +* (stop (if<=0 (a,k1,I)))),(Initialize s),2))) = halt SCMPDS by A16, A17;
now
let k be Element of NAT ; :: thesis: IC (Comput ((P +* (stop (if<=0 (a,k1,I)))),(Initialize s),b1)) in dom (stop (if<=0 (a,k1,I)))
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 (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 A10, 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 A13, A16, A19, EXTPRO_1:5; :: thesis: verum
end;
end;
end;
hence if<=0 (a,k1,I) is_closed_on s,P by Def2; :: thesis: if<=0 (a,k1,I) is_halting_on s,P
P +* (stop (if<=0 (a,k1,I))) halts_on Initialize s by A19, EXTPRO_1:29;
hence if<=0 (a,k1,I) is_halting_on s,P by Def3; :: thesis: verum