I'm trying to find out how to switch between set notation and logic, but am having difficulty. For instance, I know that the following two expressions are equivalent

x ∈ (A ⋂ B) ⋃ (A ⋂ C)

(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C)

I had to manually type this out. Ideally, I'd like to know how to simplify or expand one into the other using Mathematica operations. Mathematica doesn't even seem to recognize that this is a valid way of writing logic notation, and gives me an error.

Part of the problem is I am unable to use the ∈ operator on sets or objects. I tried defining a list with a set of real numbers {1, 2, 3}, but that didn't help me use elements with sets. I will have more complicated set formulas to simplify, and I'd like to know how to do them. I'm a little new to Mathematica.

  • $\begingroup$ As you have seen, Mathematica is not going to handle set operations using "abstract" sets. So the second way of formulating the set inclusions is the way to proceed. From there one can bring some logic methods to bear if so desired, for example: In[45]:= BooleanConvert[(Element[x, a] && Element[x, b]) || (Element[x, a] && Element[x, c]), "CNF"] Out[45]= x \[Element] a && (x \[Element] b || x \[Element] c) $\endgroup$ – Daniel Lichtblau Dec 13 '15 at 22:06
  • $\begingroup$ @daniel I can't comment (not enough reputation points). That was helpful for a first step, but how to switch between sets and logical connectives? The booleanconvert got me past the errors, but how does one convert to between the two types? $\endgroup$ – tom Dec 14 '15 at 2:46
  • $\begingroup$ I'm not really sure that one can go between these. Pretty sure the set operations are simply not going to handle abstract sets as opposed to concrete sets (represented e.g. as List[...]). Maybe there is a way but if so I am not familiar with it. $\endgroup$ – Daniel Lichtblau Dec 14 '15 at 4:42

Your Answer


Browse other questions tagged or ask your own question.