Union-intersection compression (source code)

= Union-intersection compression

An elementary union-intersection compression of a finite <multiset> of subsets replaces occurrences of $A,B$ by $A\cup B,A\cap B$. A compression is a finite sequence of these moves. The move preserves every coordinate multiplicity. On incomparable sets it increases $\sum_S|S|^2$ by $2|A\setminus B||B\setminus A|$, so repeated compression reaches a chain under inclusion. For any <submodular set function>, the sum of its values cannot increase.