Sets

A set is a collection of distinct elements.

A domain, such as Integer Boolean, is a set used to represent the possible values of an expression.

Constants

Symbol Notation Definition
EmptySet \( \varnothing \) or \( \emptyset \)

The domains also define a number of sets.

Functions

New sets can be defined using a set expression. A set expression is an expression with one of the following head functions.

Function Operation
CartesianProduct \[ \mathrm{A} \times \mathrm{B} \] A.k.a the product set, the set direct product or cross product. Q173740
Complement \[ \mathrm{A}^\complement \] The set of elements that are not in \( \mathrm{A} \). If \(\mathrm{A}\) is a numeric domain, the universe is assumed to be the set of all numbers. Q242767
Intersection \[ \mathrm{A} \cap \mathrm{B} \] The set of elements that are in \(\mathrm{A}\) and in \(\mathrm{B}\) Q185837
Union \[ \mathrm{A} \cup \mathrm{B} \] The set of elements that are in \(\mathrm{A}\) or in \(\mathrm{B}\) Q173740
Set \(\lbrace 1, 2, 3 \rbrace \) Set builder notation
SetMinus \[ \mathrm{A} \setminus \mathrm{B} \] Q18192442
SymmetricDifference \[ \mathrm{A} \triangle \mathrm{B} \] Disjunctive union = \( (\mathrm{A} \setminus \mathrm{B}) \cup (\mathrm{B} \setminus \mathrm{A})\) Q1147242

Relations

Function
Element \[ x \in \mathrm{A} \]
NotElement \[ x \not\in \mathrm{A} \]
NotSubset \[ A \nsubset \mathrm{B} \]
NotSuperset \[ A \nsupset \mathrm{B} \]
Subset \[ \mathrm{A} \subset \mathrm{B} \]
\[ \mathrm{A} \subsetneq \mathrm{B} \]
\[ \mathrm{A} \varsubsetneqq \mathrm{B} \]
SubsetEqual \[ \mathrm{A} \subseteq \mathrm{B} \]
Superset \[ \mathrm{A} \supset \mathrm{B} \]
\[ \mathrm{A} \supsetneq \mathrm{B} \]
\[ \mathrm{A} \varsupsetneq \mathrm{B} \]
SupersetEqual \[ \mathrm{A} \supseteq \mathrm{B} \]