Embedded arithmetic set expressions
Your problem is that your trick of representing set membership using arithmetic only applies to sets consisting of numbers only. Say you have a set of colours { red, green } then 1 - sgn (x - red)^2 doesn’t make any sense. Even worse is a set containing other sets as elements.