3 added 41 characters in body; deleted 6 characters in body

In addition to the measure $\mu$ being $\sigma$-finite, I think you also need separability of some conditions on the measurable space $X$.(X,{\cal A})$. Proposition 3.4.5 of Cohn's book Measure Theory says that$L^p(X,{\cal A},\mu)$($1\leq p < \infty$) is separable if$\mu$is$\sigma$-finite and$\cal A$is countably generated. For example, it holds if$X$is a complete separable metric space, and$\cal A$is the Borel$\sigma$-algebra. However, even for a compact group, you can make counterexamples like$[-1/2,1/2]^{[0,1]}$, an uncountable product of a circles. For the product measure,$\mu=\lambda^{[0,1]}$, the coordinate functions are orthogonal in$L^2$but there are uncountably many. I haven't checked the details, so take my answer with a grain of salt! 2 added 4 characters in body In addition to the measure$\mu$being$\sigma$-finite, I think you also need separability of$X$. Proposition 3.4.5 of Cohn's book Measure Theory says that$L^p(X,{\cal A},\mu)$($1\leq p < \infty$) is separable if$\mu$is$\sigma$-finite and$\cal A$is countably generated. For example, it holds if$X$is a complete separable metric space, and$\cal A$is the Borel$\sigma$-algebra. However, even for a compact group, you can make counterexamples like$[-1,1]^{[0,1]}$, [-1/2,1/2]^{[0,1]}$, an uncountable product of a circles. For the product measure, $\mu=\lambda^{[0,1]}$, the coordinate functions are orthogonal in $L^2$ but there are uncountably many.

I haven't checked the details, so take my answer with a grain of salt!

1

In addition to the measure $\mu$ being $\sigma$-finite, I think you also need separability of $X$.

Proposition 3.4.5 of Cohn's book Measure Theory says that $L^p(X,{\cal A},\mu)$ ($1\leq p < \infty$) is separable if $\mu$ is $\sigma$-finite and $\cal A$ is countably generated. For example, it holds if $X$ is a complete separable metric space, and $\cal A$ is the Borel $\sigma$-algebra.

However, even for a compact group, you can make counterexamples like $[-1,1]^{[0,1]}$, an uncountable product of a circles. For the product measure, $\mu=\lambda^{[0,1]}$, the coordinate functions are orthogonal in $L^2$ but there are uncountably many.

I haven't checked the details, so take my answer with a grain of salt!