reserve N for with_zero set;
reserve N for with_zero set;
reserve x,y,z,A,B for set,
  f,g,h for Function,
  i,j,k for Nat;
reserve S for IC-Ins-separated non empty
     with_non-empty_values AMI-Struct over N,
  s for State of S;
reserve N for non empty with_zero set,
 S for IC-Ins-separated non empty with_non-empty_values AMI-Struct over N,
  s for State of S;
reserve n for Nat;
reserve N for with_zero non empty set;
reserve N for with_zero non empty set,
  S for IC-Ins-separated non empty AMI-Struct over N;
reserve m,n for Nat;

theorem
 for S being  IC-Ins-separated halting
  non empty with_non-empty_values AMI-Struct over N
   for P being Instruction-Sequence of S
   for s being State of S holds P halts_on s
   iff ex k st CurInstr(P,Comput(P,s,k)) = halt S
proof
 let S be IC-Ins-separated halting non empty with_non-empty_values
        AMI-Struct over N;
 let P be Instruction-Sequence of S;
 let s be State of S;
 thus P halts_on s
   implies ex k st CurInstr(P,Comput(P,s,k))
    = halt S;
 given k such that
A1: CurInstr(P,Comput(P,s,k)) = halt S;
 take k;
  IC Comput(P,s,k) in NAT;
 hence IC Comput(P,s,k) in dom P  by PARTFUN1:def 2;
 thus CurInstr(P, Comput(P,s,k)) = halt S by A1;
end;
