Simplify linearity from multisets to sets