4. Let $f(x)=\log _{2} \frac{1+2^{x}+4^{x} a}{3}$, where $a \in \mathbf{R}$. If $f(x)$ is defined for $x \in(-\infty, 1]$, then the range of values for $a$ is
$$
\text { 4. } a>-\frac{3}{4} \text {. }
$$

According to the problem, $1+2^{x}+4^{x} a>0, x \in(-\infty, 1]$. Therefore,
$$
a>-\left[\left(\frac{1}{4}\right)^{x}+\left(\frac{1}{2}\right)^{x}\right](x \leqslant 1) \text {. }
$$

Since $y=\left(\frac{1}{4}\right)^{x}$ and $y=\left(\frac{1}{2}\right)^{x}$ are decreasing functions on $(-\infty, 1]$, $y=-\left[\left(\frac{1}{4}\right)^{x}+\left(\frac{1}{2}\right)^{x}\right]$ is an increasing function on $(-\infty, 1]$, and it reaches its maximum value $-\frac{3}{4}$ when $x=1$. Therefore, $-\frac{3}{4}$.