reserve X,Z for set;
reserve x,y,z for object;
reserve A,B,C for Subset of X;

theorem
  for A being Preorder, f being finite-support Function of A, REAL,
    s1 being one-to-one FinSequence of A,
    s2 being one-to-one FinSequence of QuotientOrder(A)
  st
    rng s1 = support f & rng s2 = support (eqSumOf f)
  holds
    Sum((eqSumOf f)*s2) = Sum(f*s1)
proof
  let A be Preorder, f be finite-support Function of A, REAL;
  let s1 be one-to-one FinSequence of A;
  let s2 being one-to-one FinSequence of QuotientOrder(A);
  assume that
    A1: rng s1 = support f and
    A2: rng s2 = support (eqSumOf f);
  consider D being a_partition of the carrier of A such that
    A3: D = the carrier of QuotientOrder(A) and
    A4: D eqSumOf f = eqSumOf f by Def15;
  per cases;
  suppose A is empty;
    then eqSumOf f is empty & f is empty;
    hence Sum((eqSumOf f)*s2) = Sum(f*s1);
  end;
  suppose A is non empty;
    then reconsider B = A as non empty Preorder;
    reconsider E = D as non empty a_partition of the carrier of B;
    reconsider s3 = s2 as one-to-one FinSequence of E by A3;
    reconsider F = f as finite-support Function of B, REAL;
    rng s3 = support (E eqSumOf F) by A2, A4;
    hence Sum((eqSumOf f)*s2) = Sum(f*s1) by A1, A4, Th70;
  end;
end;
