Set

Input: Set(...)
$$\left\{\ldots\right\}$$

Set with given elements.

Input: Set(a, b)
$$\left\{a, b\right\}$$

Set with elements a and b (if $a = b$, this is actually a set with a single element).

Input: Set(a, b, c)
$$\left\{a, b, c\right\}$$

Set with elements a, b and c.

Input: Set(a)
$$\left\{a\right\}$$

Set with a single element.

Input: Set()
$$\left\{\right\}$$

The empty set.

Input: Set(f(n), For(n, 1, N))
$$\left\{f(1), f(2), \ldots, f(N)\right\}$$

Set with elements constructed using a generator expression.

Input: Set(f(x), ForElement(x, S))
$$\left\{ f(x) : x \in S \right\}$$

Set comprehension.

Input: Set(f(x), ForElement(x, S), P(x))
$$\left\{ f(x) : x \in S \,\mathbin{\operatorname{and}}\, P(x) \right\}$$

Set comprehension with a filter predicate.

Input: Set(n**3+1, ForElement(n, ZZ), And(Greater(n, 1), Equal(GCD(n, m), 1)))
$$\left\{ {n}^{3} + 1 : n \in \mathbb{Z} \,\mathbin{\operatorname{and}}\, n > 1 \;\mathbin{\operatorname{and}}\; \gcd\!\left(n, m\right) = 1 \right\}$$

Set comprehension with a filter predicate.

Last updated: 2020-03-06 00:22:16