Difference of two sets or of two lists: minus

### 5.41.5 Difference of two sets or of two lists: minus

The minus operator is an infixed operator that can find the set difference of the elements of two sets or lists; the result will always be a set.

#### Examples

- Input:
  set[1,2,3,4] minus set[5,6,3,4]
  or:
  %{1,2,3,4%} minus %{5,6,3,4%}
  Output:

  ⟦ 1,2 ⟧

- Input:
  [1,2,3,4] minus [5,6,3,4]
  Output:

  ⟦ 1,2 ⟧

#### Cartesian products

#### Defining an n-tuple: tuple

To define an n-tuple (rather than a list of n objects), you can put the elements, separated by commas, inside the delimiters tuple[ and ].

#### Example

Input:

set[tuple[1,3,4],tuple[1,3,5],tuple[2,3,4]]

Output:

⟦ tuple | ⎡ ⎣ | 1,3,4 | ⎤ ⎦ | ,tuple | ⎡ ⎣ | 1,3,5 | ⎤ ⎦ | ,tuple | ⎡ ⎣ | 2,3,4 | ⎤ ⎦ | ⟧

#### The Cartesian product of two sets: *

You can compute the Cartesian product of two sets with the infixed * operator.

#### Examples

- Input:
  set[1,2] * set[3,4]
  Output:

  ⟦ tuple[1,3], tuple[1,4], tuple[2,3], tuple[2,4] ⟧

- Input:
  set[1,2] * set[3,4] * set[5,6]
  Output:

  ⟦ tuple[1,3,5],tuple[1,3,6],tuple[1,4,5],tuple[1,4,6], tuple[2,3,5],tuple[2,3,6],tuple[2,4,5],tuple[2,4,6]⟧