TITLE: Towards a consistent notation for entropy and cross-entropy
QUESTION [5 upvotes]: I am learning about the cross entropy, defined by Wikipedia as
$$H(P,Q)=-\text{E}_P[\log Q]$$
for distributions $P,Q$.
I'm not happy with that notation, because it implies symmetry, $H(X,Y)$ is often used for the joint entropy and lastly, I want to use a notation which is consistent with the notation for entropy:
$$H(X)=-\text{E}_P[\log P(X)]$$
When dealing with multiple distributions, I like to write $H_P(X)$ so it's clear with respect to which distribution I'm taking the entropy. When dealing with multiple random variables, it thinks it's sensible to make precise the random variable with respect to which the expectation is taken by using the subscript $_{X\sim P}$. My notation for entropy thus becomes
$$H_{X\sim P}(X)=-\text{E}_{X\sim P}[\log P(X)]$$
Now comes the point I don't understand about the definition of cross entropy: Why doesn't it reference a random variable $X$? Applying analogous reasoning as above, I would assume that cross entropy has the form \begin{equation}H_{X\sim P}(Q(X))=-\text{E}_{X\sim P}[\log Q(X)]\tag{1}\end{equation}
however, Wikipedia makes no mention of any such random variable $X$ in the article on cross entropy. It speaks of

the cross-entropy between two probability distributions $p$ and $q$

which, like the notation $H(P,Q)$, implies a function whose argument is a pair of distributions, whereas entropy $H(X)$ is said to be a function of a random variable. In any case, to take an expected value I need a (function of) a random variable, which $P$ and $Q$ are not.
Comparing the definitions for the discrete case:
$$H(p,q)=-\sum_{x\in\mathcal{X}}p(x)\log q(x)$$
and
$$H(X)=-\sum_{i=1}^n P(x_i)\log P(x_i)$$
where $\mathcal{X}$ is the support of $P$ and $Q$, there would only be a qualitative difference if the events $x_i$ didn't cover the whole support (though I could just choose an $X$ which does).
My questions boil down to the following:

Where is the random variable necessary to take the expected value which is used to define the cross entropy $H(P,Q)=-\text{E}_{P}[\log Q]$

If I am correct in my assumption that one needs to choose a random variable $X$ to compute the cross entropy, is the notation I used for (1) free of ambiguities.

REPLY [2 votes]: Personally, I feel that $H(X)$ is already a (very convenient) abuse of notation. After all, entropy is a function of purely the law of $X$ (and not the values it takes). So the IMO fundamental object is (for discrete laws), $H(p) := - \sum p_x \log p_x$ and writing $H(X)$ for the entropy of the law of a random variable $X$ is a convenient shorthand - more formally I'd write this as $H(X\mu)$, where $\mu$ is the measure of the underlying probability space, and $X\mu$ is its pushforward under $X$ (which is a fancy way of saying the law of $X$). There's an exact parallel for differential entropy, but with the catch that you need to have a base measure on the outcome space for differential entropy to make sense.
With this view, $H(p,q) := -\sum p_x \log q_x$ is a natural definition and notation -you don't really need to invoke a random variable, it's about the laws. In fact, I'd maybe go one step further - cross entropy, much like KL divergence, is not really about random variables, but it's a measure(in the non-mathematical sense) of how well aligned two laws are.
If you want to highlight the asymmetry, there's a couple of options that i've seen floating around -

$H(p\|q)$, which highlights the connection between cross-entropy and KL-divergence - $H(p\|q) = D(p\|q) + H(p)$. The notation is nice because the asymmetry of cross entropy is entirely the same as that of KL divergence.

$H_p(q)$ which is sort of expressing that the 'base measure' is $p$. I find this notation quite natural when I consider operational meanings of cross entropy - e.g. if one designs a good compression scheme for an iid $q$-source, but the actual law on which this code is used were iid $p$, the average code length per symbol one would get is (asymptotically) $H_p(q).$ So in this case the base measure $p$ is what's 'truly happening', while $q$ is what you're trying to 'impose'.