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
  for p being set holds p in dom Sorting-Function iff
  ex t being FinSequence of INT st p = fsloc 0 .--> t
proof
  set f=Sorting-Function;
  let p be set;
  hereby
    set q=f.p;
    assume
A1: p in dom f;
    then
A2: [p,f.p] in f by FUNCT_1:1;
    dom f c=FinPartSt SCM+FSA by RELAT_1:def 18;
    then
A3: p is FinPartState of SCM+FSA by A1,MEMSTR_0:76;
    q in FinPartSt SCM+FSA by A1,PARTFUN1:4;
    then q is FinPartState of SCM+FSA by MEMSTR_0:76;
    then consider t be FinSequence of INT,u being FinSequence of REAL such that
    t,u are_fiberwise_equipotent
    and u is FinSequence of INT
    and u is non-increasing and
A4: p = fsloc 0 .--> t
    and q = fsloc 0 .--> u
    by A2,A3,Def7;
    take t;
    thus p = fsloc 0 .--> t by A4;
  end;
  given t be FinSequence of INT such that
A5: p = fsloc 0 .--> t;
  consider u be FinSequence of REAL such that
A6: t,u are_fiberwise_equipotent and
A7: u is FinSequence of INT and
A8: u is non-increasing by RFINSEQ:33;
  reconsider u1=u as FinSequence of INT by A7;
  set q=fsloc 0 .--> u1;
  [p,q] in f by A5,A6,A8,Def7;
  hence thesis by FUNCT_1:1;
end;
