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;

theorem Th16:
  for S being IC-Ins-separated halting
non empty with_non-empty_values AMI-Struct over N,
  p be NAT-defined (the InstructionsF of S)-valued Function,
    s being State of S holds p halts_on s
   iff ex i st p halts_at IC Comput(p,s,i)
proof
  let S be IC-Ins-separated halting
  non empty with_non-empty_values AMI-Struct over N;
  let p be NAT-defined (the InstructionsF of S)-valued Function;
  let s be State of S;
  hereby
    assume p halts_on s;
    then consider i being Nat such that
A1: IC Comput(p,s,i) in dom p and
A2: CurInstr(p,Comput(p,s,i)) = halt S;
     reconsider i as Nat;
    take i;
    p.IC Comput(p,s,i) = halt S by A1,A2,PARTFUN1:def 6;
    hence p halts_at IC Comput(p,s,i) by A1;
  end;
  given i being Nat such that
A3: p halts_at IC Comput(p,s,i);
A4: IC Comput(p,s,i) in dom p by A3;
A5: p.IC Comput(p,s,i) = halt S by A3;
  take i;
  thus IC Comput(p,s,i) in dom p by A3;
  thus CurInstr(p,Comput(p,s,i)) = halt S by A4,A5,PARTFUN1:def 6;
end;
