reserve x for set,
  D for non empty set,
  k, n for Element of NAT,
  z for Nat;
reserve N for with_zero set,
  S for
    IC-Ins-separated non empty with_non-empty_values AMI-Struct over N,
  i for Element of the InstructionsF of S,
  l, l1, l2, l3 for Element of NAT,
  s for State of S;
reserve ss for Element of product the_Values_of S;
reserve T for weakly_standard
 IC-Ins-separated non empty
  with_non-empty_values AMI-Struct over N;

theorem Th32:
  for F being lower non empty
   NAT-defined (the InstructionsF of T)-valued finite Function
  holds LastLoc F = il.(T, card F -' 1)
proof
  let F be lower non empty
   NAT-defined (the InstructionsF of T)-valued finite Function;
  consider k being Nat such that
A1: LastLoc F = il.(T,k) by Th6;
  reconsider k as Element of NAT by ORDINAL1:def 12;
  LastLoc F in dom F by Th28;
  then k < card F by A1,Th27;
  then
A2: k <= card F -' 1 by NAT_D:49;
  per cases by A2,XXREAL_0:1;
  suppose
    k < card F -' 1;
    then k+1 < card F -' 1 + 1 by XREAL_1:6;
    then k+1 < card F by NAT_1:14,XREAL_1:235;
    then il.(T,k+1) in dom F by Th27;
    then il.(T,k+1) <= LastLoc F, T by Th30;
    then
A3: k+1 <= k by A1,Th8;
    k <= k+1 by NAT_1:11;
    then k+0 = k+1 by A3,XXREAL_0:1;
    hence thesis;
  end;
  suppose
    k = card F -' 1;
    hence thesis by A1;
  end;
end;
