TITLE: Notation: Vector contains an element equal to 0
QUESTION [14 upvotes]: I have a vector $v \in \mathbb{R}^n$ and I am searching for a mathematical notation for a function that returns $1$ if at least one of the vector's elements is $0$ and $0$ otherwise. The analogue function for a set $S$ would be: 
$$
f = \begin{cases} 1 & \text{if } 0 \in S \\ 0 & \text{if } 0 \notin S
 \end{cases}
$$
However I am struggling to find a similar notation for a vector. In particular, how do I write: "If any element in $v$ is $0$"?

REPLY [7 votes]: You might be interested in the $0$-norm, defined here as $\|\cdot\|_0 : \mathbb{R}^n \to \mathbb{R}$ given by
$$\|(x_1, \ldots, x_n)\|_0 = \text{ number of nonzero entries $x_i$} = \sum_{x_i \ne 0} 1$$
In this context, your function is given by
$$f = \chi_{\|\cdot\|_0^{-1}(\{0, 1, \ldots, n-1\})}$$
where $\chi_{\|\cdot\|_0^{-1}(\{0, 1, \ldots, n-1\})}$ is the indicator function of the set $$\|\cdot\|_0^{-1}(\{0, 1, \ldots, n-1\}) = \{x \in \mathbb{R}^n : \|x\|_0 \le n-1\} = \{(x_1, \ldots, x_n) \in \mathbb{R}^n : x_i = 0 \text{ for some } i\}$$
You can write it even shorter:
$$f(x) = \operatorname{sign}(n-\|x\|_0)$$