Consider the following static game:
All random vectors below are defined on the same probability space $(\Omega, \mathcal{F}, P)$
Players' beliefs coincide with $P$
$n$ players
Players indexed by $i\in \{1,...,n\}$
$J_i$ is player $i$'s information set; $J_i$ is a random vector with support $\mathcal{J}_i$
$\mathcal{D}_i$ is player $i$'s action space
$s_i: \mathcal{J}_i \rightarrow \mathcal{D}_i$ is player $i$'s strategy
$D_i=s_i(J_i)$ is player $i$'s action, with support $\mathcal{D}_i$ (pure strategies)
When playing player $i$ cares about other predetermined features $Z_i$; $Z_i$ is a random vector with support $\mathcal{Z}_i$
$\pi: \mathcal{D}_i \times \mathcal{D}_{-i}\times \mathcal{Z}_i \rightarrow \mathbb{R}$ is player $i$'s profit function
At this point, the book I am reading claims that the condition $(\star)$ below is a necessary condition for Bayesian-Nash equilibrium:
If $s_i$ is the strategy played by player $i$, then $$ (\star) \hspace{0.5cm} \begin{aligned} \mathbb{E}\Big(\pi(D_i, D_{-i}, Z_i)\Big| J_i, D_i=s_i(J_i)\Big) \geq & \sup_{d\in \mathcal{D}_i} \mathbb{E}\Big(\pi(D_i, D_{-i}, Z_i)\Big| J_i, D_i=d\Big)\\ &\text{ a.s. } J_i \end{aligned} $$ $\forall i \in \{1,...,n\}$, where $\mathbb{E}$ denotes the expectation.
Question: Why $(\star)$ is just necessary for Bayesian-Nash equilibrium? Isn't it the definition of Bayesian-Nash equilibrium?
The supremum is only being taken over the pure strategies (assuming that where you wrote $d\in D_i$ it's supposed to say $d\in\mathcal D_i$, since $d\in D_i$ makes no sense). In the definition, the supremum is taken over all strategies, including mixed strategies. (Also, in the definition, you have $=$ instead of $\ge$, since in that case the left-hand side is one of the things that the right-hand side takes the supremum over and thus can't be greater.)