Cases

Input: Cases(Tuple(f(x), P(x)), Tuple(g(x), Otherwise))
$$\begin{cases} f(x), & P(x)\\g(x), & \text{otherwise}\\ \end{cases}$$

Gives the value f(x) if the predicate P(x) is True, otherwise gives the value g(x).

Input: Cases(Tuple(f(x), P(x)), Tuple(g(x), Q(x)), Tuple(h(x), Otherwise))
$$\begin{cases} f(x), & P(x)\\g(x), & Q(x)\\h(x), & \text{otherwise}\\ \end{cases}$$

Gives the value f(x) if the predicate P(x) is True, the value g(x) if the predicate Q(x) is True, and otherwise gives the value h(x). If both P(x) and Q(x) are true simultaneously, no ordering is implied; it is assumed that f(x) and g(x) give the same value for any such x.

Input: Cases(Tuple(f(x), P(x)), Tuple(g(x), Q(x)))
$$\begin{cases} f(x), & P(x)\\g(x), & Q(x)\\ \end{cases}$$

Gives the value f(x) if the predicate P(x) is True, and the value g(x) if the predicate Q(x) is True. If both P(x) and Q(x) are true simultaneously, no ordering is implied; it is assumed that f(x) and g(x) give the same value for any such x. The result is undefined if neither predicate is True.

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