reserve l, m, n for Nat;
reserve a,b for Int-Location,
  f for FinSeq-Location,
  s,s1,s2 for State of SCM+FSA;
reserve L for finite Subset of Int-Locations;
reserve L for finite Subset of FinSeq-Locations;
reserve L for finite Subset of Int-Locations;

theorem Th22:
  not 0 in (RWNotIn-seq L).n & for m st m in (RWNotIn-seq L).n
  holds not intloc m in L
proof
  set RL = RWNotIn-seq L;
  defpred X[Nat] means
not 0 in RL.$1 & for m st m in RL.$1 holds
  not intloc m in L;
A1: X[0]
  proof
A2: RL.0 = {k where k is Element of NAT : not intloc k in L & k <> 0}
       by Def5;
    hereby
      assume 0 in RL.0;
      then
      ex k being Element of NAT st k = 0 & (not intloc k in L)& k <> 0
      by A2;
      hence contradiction;
    end;
    let m;
    assume m in RL.0;
    then ex k being Element of NAT st k = m &(not intloc k in L)& k <> 0
    by A2;
    hence thesis;
  end;
A3: for n st X[n] holds X[n+1]
  proof
    let n such that
A4: not 0 in RL.n and
A5: for m st m in RL.n holds not intloc m in L;
    reconsider nn=n as Element of NAT by ORDINAL1:def 12;
    reconsider sn = RL.nn as non empty Subset of NAT;
A6: RL.(n+1) = sn \ {min sn} by Def5;
    hence not 0 in RL.(n+1) by A4,XBOOLE_0:def 5;
    let m;
    assume m in RL.(n+1);
    then m in RL.n by A6,XBOOLE_0:def 5;
    hence thesis by A5;
  end;
  for n holds X[n] from NAT_1:sch 2(A1, A3);
  hence thesis;
end;
