Sets

### 3.2.2 Sets

To define a set of elements, put the elements separated by commas, with delimiters %{ and %} or set[ and ].

set[1,2,3,4]

or:

%{1,2,3,4%}

⟦ 1,2,3,4⟧ |  |  |  |  |  |  |  |  |  |

In the Xcas output, the set delimiters are displayed as ⟦ and ⟧ in order not to confuse sets with lists (see Section 3.2.3). For example, ⟦ 1,2,3⟧ is the set %{1,2,3%}, unlike [1,2,3] (normal brackets) which is the list [1,2,3].

A:=%{1,2,3,4%}

or:

A:=set[1,2,3,4]

⟦ 1,2,3,4⟧ |  |  |  |  |  |  |  |  |  |

B:=%{5,5,6,3,4%}

or:

B:=set[5,5,6,3,4]

⟦ 5,6,3,4 ⟧ |  |  |  |  |  |  |  |  |  |

##### Remark.

The order in a set is not significant and the elements in a set are all distinct. If you input B:=%{5,5,6,3,4%} and C:=%{3,4,5,3,6%}, then B==C will return true.

See Section 6.4 for operations on sets.