Message Boards Message Boards

0
|
10723 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Simplifying between set theory and logical connectives

Posted 9 years ago

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

x \[Element] (A\[Intersection]B) \[Union](A \[Intersection]C)

(x \[Element] A \[And] x \[Element] B) \[Or] (x\[Element]A\[And] x\[Element]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 [Element] 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. thanks

POSTED BY: Greg Ferenstein
5 Replies

Mathematica 10.3 gets it wrong with this calculation (A [Intersection] B) [Union] (A [Intersection] C) It seems to work if we inactivate Union and Intersection:

Inactivate[
 replRule := {HoldPattern[
     x \[Element] 
      u_ \[Union] v_] :> (x \[Element] u) \[Or] (x \[Element] v), 
   HoldPattern[
     x \[Element] 
      u_ \[Intersection] v_] :> (x \[Element] u) \[And] (x \[Element] 
       v)};
 predicate1 = 
  x \[Element] (A \[Intersection] B) \[Union] (A \[Intersection] C);
 predicate2 = x \[Element] A && (x \[Element] B || x \[Element] C);
 Simplify[Equivalent[predicate1, predicate2] //. replRule], 
 Union | Intersection | C]
POSTED BY: Gianluca Gorni

Simplifying between set theory and logical connectives

POSTED BY: Greg Ferenstein

How about replacement rules:

HoldForm[x \[Element] (A \[Intersection] 
      B) \[Union] (A \[Intersection] C)] //. {HoldPattern[
    x \[Element] 
     u_ \[Union] v_] :> (x \[Element] u) \[Or] (x \[Element] v), 
  HoldPattern[
    x \[Element] 
     u_ \[Intersection] v_] :> (x \[Element] u) \[And] (x \[Element] 
      v)}
POSTED BY: Gianluca Gorni

@Simon Cadrin is there a way to go between abstract sets and logical connectives? i'd like to convert between the two. Thanks so much for you help!

POSTED BY: Greg Ferenstein

enter image description here

POSTED BY: Simon Cadrin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract