ForElement

Input: ForElement(x, S)
$$\operatorname{ForElement}\!\left(x, S\right)$$

Generator expression. This is a syntactical construct which does not represent a mathematical object on its own. The ForElement expression defines the symbol passed as the first argument (here x) as a locally bound variable in the scope of the parent expression. The second argument (here S) should be a set; the meaning is that x is taken over all values in S in the parent expression.

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

A typical use is to perform a set comprehension or fold-type operation.

Input: Minimum(x**2, ForElement(x, RR))
$$\mathop{\min}\limits_{x \in \mathbb{R}} {x}^{2}$$

The set does not need to be countable.

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

Most operators that allow ForElement interpret an expression following ForElement as a filter predicate.

Input: Sum(f(x), ForElement(x, S))
$$\sum_{x \in S} f(x)$$

A summation done over all elements of a set.

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