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.
$$\left\{ f(x) : x \in S \right\}$$
A typical use is to perform a set comprehension or fold-type operation.
$$\mathop{\min}\limits_{x \in \mathbb{R}} {x}^{2}$$
The set does not need to be countable.
$$\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.
$$\sum_{x \in S} f(x)$$
A summation done over all elements of a set.
Last updated: 2020-03-06 00:22:16