reserve i, x, I for set,
  A, M for ManySortedSet of I,
  f for Function,
  F for ManySortedFunction of I;
reserve P, R for MSSetOp of M,
  E, T for Element of bool M;

theorem
  P is idempotent & R is idempotent & P**R = R**P implies P ** R is idempotent
proof
  assume that
A1: P is idempotent and
A2: R is idempotent and
A3: P**R = R**P;
  let X be Element of bool M;
A4: doms P = bool M by MSSUBFAM:17;
A5: doms R = bool M by MSSUBFAM:17;
  hence (P**R)..X = P..(R..X) by Th4,MSSUBFAM:12
    .= P..(R..(R..X)) by A2
    .= P..(P..(R..(R..X))) by A1
    .= P..((R**P)..(R..X)) by A3,A5,Th4,MSSUBFAM:12
    .= P..(R..(P..(R..X))) by A4,Th4,MSSUBFAM:12
    .= P..(R..((P**R)..X)) by A5,Th4,MSSUBFAM:12
    .= (P**R)..((P**R)..X) by A5,Th4,MSSUBFAM:12;
end;
