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 i being Integer
for n being Nat st s . (DataLoc ((s . a),i)) >= 0 holds
( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P )

let s be State of SCMPDS; :: thesis: for I being Program of
for a being Int_position
for i being Integer
for n being Nat st s . (DataLoc ((s . a),i)) >= 0 holds
( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P )

let I be Program of ; :: thesis: for a being Int_position
for i being Integer
for n being Nat st s . (DataLoc ((s . a),i)) >= 0 holds
( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P )

let a be Int_position; :: thesis: for i being Integer
for n being Nat st s . (DataLoc ((s . a),i)) >= 0 holds
( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P )

let i be Integer; :: thesis: for n being Nat st s . (DataLoc ((s . a),i)) >= 0 holds
( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P )

let n be Nat; :: thesis: ( s . (DataLoc ((s . a),i)) >= 0 implies ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) )
set d1 = DataLoc ((s . a),i);
assume A1: s . (DataLoc ((s . a),i)) >= 0 ; :: thesis: ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P )
set i1 = (a,i) >=0_goto ((card I) + 3);
set i2 = AddTo (a,i,n);
set i3 = goto (- ((card I) + 2));
set FOR = for-up (a,i,n,I);
set pFOR = stop (for-up (a,i,n,I));
set s3 = Initialize s;
set P3 = P +* (stop (for-up (a,i,n,I)));
set s4 = Comput ((P +* (stop (for-up (a,i,n,I)))),(),1);
set P4 = P +* (stop (for-up (a,i,n,I)));
A2: IC () = 0 by MEMSTR_0:def 11;
A3: not DataLoc ((s . a),i) in dom () by SCMPDS_4:18;
not a in dom () by SCMPDS_4:18;
then A4: () . (DataLoc ((() . a),i)) = () . (DataLoc ((s . a),i)) by FUNCT_4:11
.= s . (DataLoc ((s . a),i)) by ;
A5: for-up (a,i,n,I) = ((a,i) >=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2)))) by Th2;
Comput ((P +* (stop (for-up (a,i,n,I)))),(),(0 + 1)) = Following ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(),0))) by EXTPRO_1:3
.= Exec (((a,i) >=0_goto ((card I) + 3)),()) by ;
then A6: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(),1)) = ICplusConst ((),((card I) + 3)) by
.= 0 + ((card I) + 3) by ;
A7: card (for-up (a,i,n,I)) = (card I) + 3 by Th30;
then A8: (card I) + 3 in dom (stop (for-up (a,i,n,I))) by COMPOS_1:64;
stop (for-up (a,i,n,I)) c= P +* (stop (for-up (a,i,n,I))) by FUNCT_4:25;
then (P +* (stop (for-up (a,i,n,I)))) . ((card I) + 3) = (stop (for-up (a,i,n,I))) . ((card I) + 3) by
.= halt SCMPDS by ;
then A9: CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(),1))) = halt SCMPDS by ;
now :: thesis: for k being Nat holds IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(),k)) in dom (stop (for-up (a,i,n,I)))
let k be Nat; :: thesis: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(),b1)) in dom (stop (for-up (a,i,n,I)))
per cases ( 0 < k or k = 0 ) ;
suppose 0 < k ; :: thesis: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(),b1)) in dom (stop (for-up (a,i,n,I)))
then 1 + 0 <= k by INT_1:7;
hence IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(),k)) in dom (stop (for-up (a,i,n,I))) by ; :: thesis: verum
end;
suppose k = 0 ; :: thesis: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(),b1)) in dom (stop (for-up (a,i,n,I)))
then Comput ((P +* (stop (for-up (a,i,n,I)))),(),k) = Initialize s ;
hence IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(),k)) in dom (stop (for-up (a,i,n,I))) by ; :: thesis: verum
end;
end;
end;
hence for-up (a,i,n,I) is_closed_on s,P by SCMPDS_6:def 2; :: thesis: for-up (a,i,n,I) is_halting_on s,P
P +* (stop (for-up (a,i,n,I))) halts_on Initialize s by ;
hence for-up (a,i,n,I) is_halting_on s,P by SCMPDS_6:def 3; :: thesis: verum