Operator $T \colon L^p \to L^p$ is a conditional expectation I'm trying to solve this problem:
Let $(X,\mathcal{B},\mu)$ a probability space and $T \colon L^p(\mu) \to L^p(\mu)$ a continuous linear operator ($1 \leq p < \infty$ ) with the following properties:
1) $||T||=1$.
2) $T(1) = 1$.
3) $\forall g \in L^\infty(\mu), f \in L^p(\mu) \colon \, T(gT(f))=T(f)T(g)$.
Then exists a sub $\sigma$-algebra $\mathcal{G} \subseteq \mathcal{B}$ such that $$ \forall f \in L^p(\mu) \colon \, T(f) = \mathbb{E}(f | \mathcal{G})$$ 

My attempt: 
We can define $$\mathcal{C}= \{g \in L^\infty \colon T(g) = g\}, \ \mathcal{G} = \sigma(\mathcal{C})$$ 
By the monotone class theorem is not to difficult to see that if $g \in L^\infty$ is $\mathcal{G}$-measurable then $T(g) = g$. Then I want to prove that for every $f \in L^\infty$ $T(f) = \mathbb{E}(f|\mathcal{G})$. 


*

*$T(f) \in \mathcal{C}$ by property 2) then $T(f)$ is $\sigma(\mathcal{C})=\mathcal{G}$-measurable.

*Let $g \in L^\infty$ and $\mathcal{G}$-measurable. Then $$\int_X T(f)g d\mu = \int_X T(fg) d\mu =\cdots $$


I don't know how to procede from here.
Any help will be appreciated.
 A: The $p=1$ case:
Let $\cal G$ be as you have defined it.
By the theorem for $L^p$ duality, one has an isometric isomorphism $\psi: L^{\infty}(\mathcal B, \mu) \to L^1(\mathcal B, \mu)^*$ given by $\psi(g)(f):=\int_X fg d\mu$. Let $T^*: L^1(\mathcal B, \mu)^* \to L^1(\cal B, \mu)^*$ denote the canonical adjoint of $T$. Define $S:= \psi^{-1} \circ T^* \circ \psi: L^{\infty}(\mathcal B, \mu) \to L^{\infty}(\mathcal B, \mu)$. Note that $\|S\| \leq 1$ since $S$ is a composition of maps with operator norm $1$. Direct computation yields that for any $f \in L^1(\mathcal B, \mu)$ and $g\in L^{\infty}(\mathcal B, \mu)$, $$\int_X (Tf)g d\mu = \int_X f (Sg) d\mu$$
Next, notice that for any $f \in L^1(\mathcal B, \mu)$ and any $g \in L^{\infty}(\mathcal G, \mu)$ $$T(f)g=T(f)T(g)=T(fT(g))=T(fg)$$ and therefore $$\int_X T(f)g d\mu = \int_X T(fg)d\mu = \int_X fg \;S(1) d\mu$$
Define $h:=S(1)$. Letting $\;f=g=1$ gives that $\int_X h\;d\mu=1$. On the other hand, since $\|S\| \leq 1$ we see that that $\| h\|_{\infty} = \|S1 \|_{\infty} \leq \|1\|_{\infty}= 1$. Since $\|h\|_{\infty} \leq 1$ and $\int_X h\; d\mu=1$, it must hold true that $h=1$ almost surely. This means that for any $f \in L^1(\mathcal B, \mu)$ and any $g \in L^{\infty}(\mathcal G, \mu)$ $$\int_X (Tf)g d\mu = \int_X fg d\mu$$ which precisely means that $Tf=E[f|\mathcal G]$, once we show that $Tf$ is $\cal G$-measurable for all $f \in L^1(\cal B, \mu)$. To show this last part, just note that if $f\in L^{\infty}(\cal B, \mu)$, then it must be true that $Tf\in \cal C$, and thus by density of $L^{\infty}(\cal B, \mu)$ in $L^1(\cal B, \mu)$ it follows that any $Tf$ is an $L^1$-limit of functions in $\cal C$, hence is $\cal G$-measurable. This completes the proof.
The $p>1$ case:
If $p>1$, then all of the above duality computations still hold true with $L^1(\cal B, \mu)$ replaced by $L^p(\cal B, \mu)$, and $L^{\infty}(\cal B, \mu)$ replaced by $L^q(\cal B, \mu)$ where $q = \frac{p}{p-1}$. However, this time, we get the bound that $\|h \|_q\leq 1$ rather than the bound $\|h\|_{\infty}\leq 1$. This makes the story a little bit more complicated than the $p=1$ case, but we will now show that it is still true that $h=1$ a.s.
Since $\int_X h \; d\mu =1$, it follows that $\| h \|_1 \geq 1$. Thus monotonicity of $L^p$ norms gives us that $1 \leq \|h \|_1 \leq \|h\|_{(q+1)/2} \leq \|h\|_q \leq 1$, and hence $\|h\|_1 = \|h\|_{(q+1)/2}=\|h\|_q = 1$. Thus we get that $$\int_X |h|\big( |h|^{(q-1)/2}-1\big)^2 d\mu = \|h\|_q^q -2 \|h\|_{(q+1)/2}^{(q+1)/2}+ \|h\|_1 = 1-2+1=0$$
This in turn implies that $|h|\big( |h|^{(q-1)/2}-1\big)^2=0$ a.s, and hence $|h|$ takes values in $\{0,1\}$ almost surely. It follows that $h=1_E-1_F$ for some disjoint $E,F \in \cal B$. Then we get that $\mu(E)-\mu(F)=\int_X h\; d\mu=1$, and hence $\mu(E)=1$ and $\mu(F)=0$. Therefore $h=1$ a.s., which shows that $Tf=E[f|\mathcal G]$ and thus completes the proof.
[Acknowledgements to @S. Caterall for considering the function $|h| \big( |h|^{(q-1)/2}-1\big)^2 .\;\;$ ]
A: One possible approach can be based on Proposition I-2-13 in Neveu's book on discrete parameter martingales (available here or here). The Remark following the proof of this proposition explains that, if $T$ is a continuous linear operator on $L^p$ satisfying condition (3) above, then $T$ is of the form $T(f) = \mathbb{E}(uf | \mathcal{G})$ where the function $u$ satisfies $u\in L^\infty(\mathcal{B},\mu)$ if $p=1$, or $\mathbb{E}(|u|^q | \mathcal{G}) \in L^\infty(\mathcal{G},\mu)$ in the case $p>1$ (where $q = \frac{p}{p-1}$). In the case $p=1$, conditions (1) and (2) above imply that $\|u\|_\infty=1$ and $\int_X u d\mu=1$ (respectively), so that $u=1$ almost surely. In the case $p>1$, conditions (1) and (2) above imply that $\|\mathbb{E}(|u|^q | \mathcal{G})\|_\infty=1$ and $\int_X u d\mu=1$, from which we can conclude that $u\in L^q (\mathcal{B},\mu)$ with $\|u\|_q \leq 1$. When $p=q=2$, considering $\int_X (u-1)^2 d\mu$ shows that $u=1$ almost surely. For $p<2$, use monotonicity of $L^p$ norms to again conclude that $u=1$ almost surely. For $p>2$, $q\in(1,2)$ and we have $\|u\|_1\geq 1$ but $\|u\|_q \leq 1$, so $\|u\|_1=\|u\|_q =1$ by norm monotonicity. Since $\int_X u d\mu=1$, this implies that $u$ is positive. Now consider $\int_X u(u^\frac{q-1}{2} -1)^2 d\mu$, concluding that $u$ is of the form $1_E$. Then the fact that $\int_X u d\mu=1$ implies that $\mu(E)=1$, so $u=1$ almost surely.
Alternatively: Proposition I-2-14 in the book states that, if $p\geq 1$ but $p \neq 2$, then every idempotent linear contraction $T$ on $L^p$ such that $T(1)=1$ is necessarily a conditional expectation. Conditions (1)-(3) above ensure that the assumptions of this Proposition are satisfied, so $T$ can therefore be written as a conditional expectation. However, only a partial proof of the Proposition is given, for the case $p=1$. A full proof can be obtained by using Theorem 1 in Ando's paper on "Contractive Projections in $L_p$ Spaces" (ref 5 in the book), which states that if $T$ is a contractive idempotent in $L^p$ ($p>1, p\neq 2$) with $T(1)=1$ then $T$ is contractive in the $L^1$ norm. This results allows you to reduce the $p>1$ case to the $p=1$ case. 
A: This is meant to be a lengthy comment and not an actual answer (my actual answer is the other answer). Namely, I found some statements in the OP to be rather non-obvious and so I wanted to give a detailed proof for them.
The first quote:

We can define $$\mathcal{C}= \{g \in L^\infty \colon T(g) = g\}, \ \mathcal{G} = \sigma(\mathcal{C})$$
By the monotone class theorem is not to difficult to see that if $g \in L^{\infty}$ is $\mathcal{G}$-measurable then $T(g) = g$.

We will show (more generally) that $Tg=g$ for all $g \in L^p(\cal G, \mu)$, where $\cal G$ is as defined above. It suffices to prove this in the special case that $g=1_E$ for some $E \in \cal G$, because then we can just approximate by simple functions and use that $T$ is continuous.
Let $\mathcal E:= \{E \in \mathcal G : T(1_E) = 1_E\}$. It is easy to see that $\cal E$ is a Dynkin system. But $\cal E$ is also closed under pairwise intersections, by condition (3). Thus $\cal E$ is a $\sigma$-algebra. Thus in order to show that $\cal E = G$, we just need to show that $\cal E$ contains a generating set for $\cal G$, i.e, all sets of the form $f^{-1}(B)$ with $f \in \cal C$ and $B \subset \Bbb R$ Borel.
Thus we just need to show that $T(1_{f^{-1}(B)}) = 1_{f^{-1}(B)}$ for all $f \in \cal C $ and all Borel $B \subset \Bbb R$. We will prove something stronger, namely, that if $f \in \cal C$ ,then for any bounded Borel measurable function $h: \Bbb R \to \Bbb R$, it holds true that $T(h \circ f) = h \circ f$.
So let $f \in \cal C$, let $h$ be as stated, and let $\epsilon>0$. Since $f \in L^{\infty}(\cal B, \mu)$, there exists some compact interval $J$ such that $\mu(f \notin J)=0$. Since continuous functions are dense in $L^p(J, \;f_*\mu)$, it follows that there exists a continuous function $h_1$ on $J$ such that $\| h-h_1 \|_{L^p(f_*\mu)}<\epsilon/4$. Similarly, there exists a polynomial $P$ on $J$ such that $\| h_1-P \|_{L^p(f_*\mu)}<\epsilon/4$. It follows that $\| h \circ f - P \circ f \|_{L^p(\mu)} = \|h-P \|_{L^p(f_*\mu)} < \epsilon/2$. Since $T$ has operator norm $1$, it follows that $\| T(h \circ f) - T(P \circ f) \|_{L^p(\mu)} < \epsilon/2$. But since $P$ was assumed to be a polynomial, it follows that $T(P \circ f) = P \circ f$, simply by repeatedly applying (3) and using the fact that $f \in \cal C$. Hence we see that $$\| T(h \circ f) - h \circ f \|_{L^p(\mu)} \leq \| T(h \circ f) - T(P \circ f) \|_{L^p(\mu)} + \| P \circ f - h \circ f \|_{L^p(\mu)} < \epsilon/2+\epsilon/2=\epsilon$$ Letting $\epsilon \downarrow 0$, we get that $T(h \circ f) = h \circ f$.

Another nontrivial quote is the following:

I want to prove that for every $f \in L^\infty$, $T(f) = \mathbb{E}(f|\mathcal{G})$.

*

*$T(f) \in \mathcal{C}$ by property (2).


A priori, it is not necessarily true that if $f \in L^{\infty}(\cal B, \mu)$ then $Tf \in L^{\infty}(\cal B, \mu)$. We will prove this.
Let $f \in L^{\infty}(\cal B, \mu)$. Define a sequence as $f_1:=f$ and $f_{n+1}=f\cdot Tf_n$. It is clear that $f_n \in L^p(\cal B, \mu)$ for all $n$. Moreover, we get the relation that $\|f_{n+1}\|_p = \|f \cdot Tf_n \|_p \leq  \|f\|_{\infty} \cdot \|Tf_n\|_p \leq \|f\|_{\infty} \cdot \|f_n\|_p$. Thus by induction we see that $\| f_n \|_p \leq \|f\|_{\infty}^{n-1} \cdot \|f_1\|_p \leq \|f\|_{\infty}^n$.
But it is also true that $Tf_{n+1}=T(f\cdot Tf_n) = Tf \cdot Tf_n$, and thus by induction we see that $Tf_n = (Tf)^n$ for all $n$. Hence we see that for all $n \in \Bbb N$: $$\|Tf\|_{np}^n = \|(Tf)^n\|_p = \|Tf_n\|_p \leq \|f_n\|_p \leq \|f\|_{\infty}^n$$
Taking $n^{th}$ roots, we see that $\|Tf\|_{np}\leq \|f\|_{\infty}$ for all $n$. Letting $n \to \infty$, we get that $\|Tf\|_{\infty} \leq \|f\|_{\infty} < \infty$, so that $Tf \in L^{\infty}(\cal B, \mu)$.
