Let $(X,\mathcal{A_1},\nu)$ be a probability space. Let $A: L_1 \to L_1$ be a contraction such that $A: L_{\infty} \to L_{\infty}$ is also a contraction. Suppose $A$ preserves positivity.
In a proof of why $A:L_p \to L_p$ is a contraction for every $1\leq p<\infty$, my lecture notes state that for all $f\geq 0$, we have $$ \|Af\|_p=\sup_{g\geq 0, \|g\|_q=1}\int_X(Af\cdot g), $$ where $\frac{1}{p}+\frac{1}{q}=1$.
My question is why does the above equality hold? The strangest part to me is the fact that the LHS has a power of $\frac{1}{p}$ outside of the integral $\int_X |Af|^p$, but in the RHS the integral is not being raised to any power. I've tried to raise both sides to $p$ but I could not do much with this. If it helps, this came up in the study of conditional expectations.
We have by Holder's that $|\int_X(Af\cdot g)|\leq \|Af\|_p \|g\|_q=\|Af\|_p$ for all $g\in L^q$ with $\|g\|_q=1$. The question then becomes whether or not $g$ can be chosen to obtain equality.
Note that $1/p + 1/q=1$ implies that $1+p/q=p$ and $1+q/p=q$. Hence, choose $g=\frac{(Af)^{p/q}}{\|Af\|_p^{p/q}}$, which is nonnegative because $f$ is and $A$ preserves nonnegativity. Moreover, $\|g\|_q=1$.
But then $Af\cdot g=\frac{(Af)^{1+p/q}}{\|Af\|_p^{p/q}}=\frac{(Af)^{p}}{\|Af\|_p^{p/q}}$. Integrating, shows that $$ \int_X Af\cdot g=\frac{\|Af\|_p^p}{\|Af\|_p^{p/q}}=\|Af\|_p. $$