reserve n,m,k for Nat,
  x,y for set,
  r for Real;
reserve C,D for non empty finite set,
  a for FinSequence of bool D;

theorem Th21:
  for c be Element of C, F be PartFunc of D,REAL, A be
  RearrangmentGen of C st F is total & card C = card D holds (c in (Co_Gen A).1
implies (Rlor(F,A)).c = FinS(F,D).1) & for n st 1<=n & n<len (Co_Gen A) & c in
  (Co_Gen A).(n+1) \ (Co_Gen A).n holds Rlor(F,A).c = FinS(F,D).(n+1)
proof
  let c be Element of C, F be PartFunc of D,REAL, B be RearrangmentGen of C;
  set fd = FinS(F,D), mf = MIM(fd), b = Co_Gen B, h = CHI(b,C);
A1: Rlor(F,B).c = Sum((mf(#)h)#c) by RFUNCT_3:32,33;
A2: len h = len b & len mf = len fd by RFINSEQ:def 2,RFUNCT_3:def 6;
  assume
A3: F is total & card C = card D;
  then
A4: len mf = len h by Th11;
  thus c in b.1 implies Rlor(F,B).c = FinS(F,D).1
  proof
    assume c in b.1;
    hence Rlor(F,B).c = Sum mf by A3,A1,Th13
      .= FinS(F,D).1 by A4,A2,Th4,RFINSEQ:16;
  end;
  let n;
  set mfn = MIM(FinS(F,D)/^n);
  assume that
A5: 1<=n and
A6: n<len b and
A7: c in b.(n+1) \ b.n;
  (mf(#)h)#c = (n |-> (0 qua Real)) ^ mfn by A3,A5,A6,A7,Th13;
  hence Rlor(F,B).c = Sum(n |-> In(0,REAL)) + (Sum mfn)
     by A1,RVSUM_1:75
    .= 0 + Sum mfn by RVSUM_1:81
    .= FinS(F,D).(n+1) by A4,A2,A6,RFINSEQ:17;
end;
