Consider the problem of lossily compressing a memoryless binary source $X \sim \operatorname{Bernoulli}\left(\frac{1}{2}\right)$ at target Hamming distortion $D < \frac{1}{2}$. According to the analysis in 9.3.1 Example: Binary Source from this note, the marginal distribution of the optimal reconstruction $\hat{X}$ is also $\operatorname{Bernoulli}\left(\frac{1}{2}\right)$, which means $H(\hat{X}) = H(X) = 1$. Moreover, the rate of the compression, i.e., the mutual information between $X$ and $\hat{X}$, is $I(X; \hat{X}) = 1 - H(D) < 1$.
My question is, what exactly is stored on the disk, or more formally, transmitted through the channel? Based on the rate-distortion theory, we can compress $k$ samples from $X$ (denoted $x \in \{0, 1\}^k$) down to $k(1 - H(D))$ bits (denoted $z \in \{0, 1\}^{k(1 - H(D))}$), and the reconstruction (denoted $\hat{x} \in \{0, 1\}^k$) can achieve an expected distortion of $D$.
- What is the function that maps $x$ to $z$? I believe $z$ is essentially the "mutual information" between $X$ and $\hat{X}$, but I have no clue how to compute it.
- What is the function that maps $z$ to $\hat{x}$? I think this must be a stochastic function, because $\hat{x}$ has higher entropy than $z$ ($k > k(1 - H(D))$).
I am confused because most material on lossy compression only talks about the rate-distortion theory, without explaining how we can do lossy compression with it. After all, the entire point of lossy compression is to shorten the bitstream, and I need to know a concrete way of doing that.