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 Th27:
  for P being lower
  NAT-defined (the InstructionsF of T)-valued finite Function
   holds z < card P iff il.(T,z) in dom P
proof
  let P be lower NAT-defined (the InstructionsF of T)-valued finite Function;
  deffunc F(Element of NAT) = il.(T,$1);
  defpred P[Element of NAT] means F($1) in dom P;
  set A = { k : P[k]};
A1: A is Subset of NAT from DOMAIN_1:sch 7;
A2: now
    let a, b be Nat;
    assume a in A;
    then
A3: ex l being Element of NAT st l = a & il.(T,l) in dom P;
A4: b in NAT by ORDINAL1:def 12;
    assume b < a;
    then il.(T,b) <= il.(T,a), T by Th8;
    then il.(T,b) in dom P by A3,Def10;
    hence b in A by A4;
  end;
A5: now
    let x be set;
    assume x in dom P;
    then reconsider l=x as Element of NAT;
    consider n being Nat such that
A6: l = il.(T,n) by Th6;
    reconsider n as Element of NAT by ORDINAL1:def 12;
    take n;
    thus x = F(n) by A6;
  end;
  reconsider A as Cardinal by A1,A2,FUNCT_7:20;
  set A1 = {k : F(k) in dom P};
A7: z is Element of NAT by ORDINAL1:def 12;
A8: for k1, k2 being Element of NAT st F(k1) = F(k2) holds k1 = k2 by Th5;
A9: dom P, A1 are_equipotent from FUNCT_7:sch 3(A5,A8);
  hereby
    assume z < card P;
    then card Segm z in card Segm card P by NAT_1:41;
    then z in card dom P by CARD_1:62;
    then z in card A by A9,CARD_1:5;
    then ex d being Element of NAT st d = z & il.(T,d) in dom P;
    hence il.(T,z) in dom P;
  end;
  assume il.(T,z) in dom P;
  then z in card A by A7;
  then z in card dom P by A9,CARD_1:5;
  then card Segm z in card Segm card P by CARD_1:62;
  hence thesis by NAT_1:41;
end;
