0
$\begingroup$

Let $A$ be a set and $B$ a condition (can be either true or false). Is there any shorter description of the expression $$ x = \begin{cases} A & B \\ \emptyset & \text{otherwise} \end{cases} \text{?} $$ An inline solution would be nice.

One possibility is to define $$ \text{cond}(A, B) = \begin{cases} A & B \\ \emptyset & \text{otherwise} \end{cases} $$ and set $x = \text{cond}(A, B)$. But is there a more "intuitive" way to do this without defining a new function?

$\endgroup$

1 Answer 1

1
$\begingroup$

How about $\{ x\ \lvert\ x \in A \wedge B \}$ or $\{ x \in A\ \lvert\ B \}$? I would personally stick to your original approach, though.

$\endgroup$
1
  • $\begingroup$ Okay, nice idea. I just wait before I mark it as answer. Maybe there is a more "intuitive" way. $\endgroup$
    – Ronny
    Oct 21, 2014 at 19:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .