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

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

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

let k1 be Integer; :: thesis: ( s . (DataLoc ((s . a),k1)) > 0 implies ( if<=0 (a,k1,I) is_closed_on s & if<=0 (a,k1,I) is_halting_on s ) )
set b = DataLoc ((s . a),k1);
assume A1: s . (DataLoc ((s . a),k1)) > 0 ; :: thesis: ( if<=0 (a,k1,I) is_closed_on s & if<=0 (a,k1,I) is_halting_on s )
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) +* (stop (if<=0 (a,k1,I)));
set s4 = Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1);
set s5 = Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2);
I2: s +* (Initialize (stop (if<=0 (a,k1,I)))) = (Initialize s) +* (stop (if<=0 (a,k1,I))) by COMPOS_1:125;
A2: if<=0 (a,k1,I) = ((a,k1) <=0_goto 2) ';' ((goto ((card I) + 1)) ';' I) by SCMPDS_4:52;
A3: not DataLoc ((s . a),k1) in dom (Initialize (stop (if<=0 (a,k1,I)))) by SCMPDS_4:31;
not a in dom (Initialize (stop (if<=0 (a,k1,I)))) by SCMPDS_4:31;
then A4: ((Initialize s) +* (stop (if<=0 (a,k1,I)))) . (DataLoc ((((Initialize s) +* (stop (if<=0 (a,k1,I)))) . a),k1)) = ((Initialize s) +* (stop (if<=0 (a,k1,I)))) . (DataLoc ((s . a),k1)) by I2, FUNCT_4:12
.= s . (DataLoc ((s . a),k1)) by A3, I2, FUNCT_4:12 ;
A5: IC ((Initialize s) +* (stop (if<=0 (a,k1,I)))) = 0 by I2, FUNCT_4:26, SCMPDS_5:18;
Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),(0 + 1)) = Following ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),(Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),0))) by EXTPRO_1:4
.= Following ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I))))) by EXTPRO_1:3
.= Exec (((a,k1) <=0_goto 2),((Initialize s) +* (stop (if<=0 (a,k1,I))))) by A2, Th22, I2 ;
then A6: IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1)) = succ (IC ((Initialize s) +* (stop (if<=0 (a,k1,I))))) by A1, A4, SCMPDS_2:68
.= 0 + 1 by A5 ;
A7: Initialize (stop (if<=0 (a,k1,I))) c= (Initialize s) +* (stop (if<=0 (a,k1,I))) by I2, FUNCT_4:26;
then A8: stop (if<=0 (a,k1,I)) c= Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1) by AMI_1:81, COMPOS_1:132;
A9: 1 in dom (if<=0 (a,k1,I)) by Lm9;
then 1 in dom (stop (if<=0 (a,k1,I))) by Th18;
then A10: (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1)) . 1 = (stop (if<=0 (a,k1,I))) . 1 by A8, GRFUNC_1:8
.= (if<=0 (a,k1,I)) . 1 by A9, Th19
.= goto ((card I) + 1) by Lm10 ;
A11: card (if<=0 (a,k1,I)) = (card I) + 2 by Lm8;
then A12: (card I) + 2 in dom (stop (if<=0 (a,k1,I))) by Th25;
Y: (ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1))) /. (IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1))) = (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1)) . (IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1))) by COMPOS_1:38;
T: ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I)))) = ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1)) by AMI_1:123;
Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),(1 + 1)) = Following ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),(Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1))) by EXTPRO_1:4
.= Exec ((goto ((card I) + 1)),(Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1))) by A6, A10, Y, T ;
then A13: IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2)) = ICplusConst ((Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),1)),((card I) + 1)) by SCMPDS_2:66
.= ((card I) + 1) + 1 by A6, Th23
.= (card I) + (1 + 1) ;
Y: (ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2))) /. (IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2))) = (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2)) . (IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2))) by COMPOS_1:38;
TX: ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I)))) = ProgramPart (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2)) by AMI_1:123;
stop (if<=0 (a,k1,I)) c= Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2) by A7, AMI_1:81, COMPOS_1:132;
then (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2)) . ((card I) + 2) = (stop (if<=0 (a,k1,I))) . ((card I) + 2) by A12, GRFUNC_1:8
.= halt SCMPDS by A11, Th25 ;
then A14: CurInstr ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),(Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),2))) = halt SCMPDS by A13, Y, TX;
now
let k be Element of NAT ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),b1)) in dom (stop (if<=0 (a,k1,I)))
A15: ( k = 0 or 0 + 1 <= k ) by INT_1:20;
per cases ( k = 0 or k = 1 or 1 < k ) by A15, XXREAL_0:1;
suppose k = 0 ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),b1)) in dom (stop (if<=0 (a,k1,I)))
then Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),k) = (Initialize s) +* (stop (if<=0 (a,k1,I))) by EXTPRO_1:3;
hence IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),k)) in dom (stop (if<=0 (a,k1,I))) by A5, COMPOS_1:135; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),b1)) in dom (stop (if<=0 (a,k1,I)))
hence IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),k)) in dom (stop (if<=0 (a,k1,I))) by A9, A6, Th18; :: thesis: verum
end;
suppose 1 < k ; :: thesis: IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),b1)) in dom (stop (if<=0 (a,k1,I)))
then 1 + 1 <= k by INT_1:20;
hence IC (Comput ((ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I))))),((Initialize s) +* (stop (if<=0 (a,k1,I)))),k)) in dom (stop (if<=0 (a,k1,I))) by A12, A13, A14, EXTPRO_1:6; :: thesis: verum
end;
end;
end;
hence if<=0 (a,k1,I) is_closed_on s by Def2; :: thesis: if<=0 (a,k1,I) is_halting_on s
ProgramPart ((Initialize s) +* (stop (if<=0 (a,k1,I)))) halts_on (Initialize s) +* (stop (if<=0 (a,k1,I))) by A14, EXTPRO_1:30;
hence if<=0 (a,k1,I) is_halting_on s by Def3; :: thesis: verum