I'm currently studying measure theory and was thinking if we can generalize the Pythagorean theorem in the context of the Lebesgue measure theory in the following way:
Let us denote $r$ to be the diagonal $y=x$ on $\mathbb{R}^2$ (or any non horizontal or vertical line). So of course $r$ is in essence $\mathbb{R}$, therefore we can talk about Lebesgue measure on $r$ as we do on $\mathbb{R}$ (note that we are not measuring things in $r$ with the "induced" Lebesgue measure of $\mathbb{R}^2$, otherwise every subset of $r$ will be a null set).
My conjecture is the following:
Let $\pi_1:\mathbb{R}^2\to\mathbb{R}$, and $\pi_2:\mathbb{R}^2\to\mathbb{R}$ the projections of the first and second coordinates respectively (for instance $\pi_2(x,y)=y$)
Then if $E\subset r$ is a measurable set, then
$$m(E)^2=m(\pi_1(E))^2+m(\pi_2(E))^2$$
Is it true? If so, is there a good reference for that? What you think about that?
This is true. I don't have a complete answer to your question, because you asked for a reference, and I don't have that. Possibly the result would be considered too trivial for a reference (which doesn't mean that you shouldn't have asked, of course); but I also imagine that it might appear as an exercise as an application of some general theorem (such as the Carathéodory Extension Theorem, which is the first thing that I thought of, although it's overkill in this case).
We can prove this directly by an explicit calculation. Let $ r $ be an oblique line with slope $ k $, explicitly the line $ \{ x , y \mid y = k x + c \} $ for some real numbers $ k $ and $ c $ with $ k \ne 0 $. To identify $ r $ with the real line, we need a map $ \iota \colon \mathbb R \to \mathbb R ^ 2 $ that maps the origin to a specific point (I'll use $ ( 0 , c ) $ rather than $ ( - c / k , 0 ) $ or some other choice) and moves at unit speed in the direction of a vector with slope $ k $ (I'll use $ \langle 1 , k \rangle $ rather than $ \langle - 1 , - k \rangle $ or some other choice), so that $$ \iota ( t ) = ( 0 , c ) + t \widehat { \langle 1 , k \rangle } = \bigg ( \frac 1 { \sqrt { k ^ 2 + 1 } } t , \frac k { \sqrt { k ^ 2 + 1 } } t + c \bigg ) \text . $$ (You can double-check that $ \iota ( t ) $ satisfies the defining equation of $ r $ and that the distance from $ \iota ( t _ 1 ) $ to $ \iota ( t _ 2 ) $, as given by the ordinary Pythagorean Theorem, is $ \lvert t _ 2 - t _ 1 \rvert $.) Then $$ \pi _ 1 ( \iota ( t ) ) = \frac 1 { \sqrt { k ^ 2 + 1 } } t \text {, and } \pi _ 2 ( \iota ( t ) ) = \frac k { \sqrt { k ^ 2 + 1 } } t + c , $$ so that $ \pi _ 1 \circ \iota $ and $ \pi _ 2 \circ \iota $ are affine-linear. This means that if $ E $ is measurable, then $$ m ( \pi _ 1 ( \iota ( E ) ) ) = \frac 1 { \sqrt { k ^ 2 + 1 } } m ( E ) \text {, and } m ( \pi _ 2 ( \iota ( E ) ) ) = \frac k { \sqrt { k ^ 2 + 1 } } m ( E ) \text ; $$ squaring these and adding, $$ m ( \pi _ 1 ( \iota ( E ) ) ) ^ 2 + m ( \pi _ 2 ( \iota ( E ) ) ) ^ 2 = \frac 1 { k ^ 2 + 1 } m ( E ) ^ 2 + \frac { k ^ 2 } { k ^ 2 + 1 } m ( E ) ^ 2 = m ( E ) ^ 2 \text , $$ which is basically your desired result.
In the above, I've taken $ E $ to be a subset of $ \mathbb R $ rather than $ r $, but the measure on $ r $ is defined to be the measure on $ \mathbb R $ transferred by $ \iota $, so that $ m ( \iota ( E ) ) = m ( E ) $. Or taking $ E $ to be a subset of $ r $ instead, $ m ( E ) = m ( \iota ^ { - 1 } ( E ) ) $, so $$ m ( \pi _ 1 ( E ) ) ^ 2 + m ( \pi _ 2 ( E ) ) ^ 2 = m ( \iota ^ { - 1 } ( E ) ) ^ 2 = m ( E ) ^ 2 \text ; $$ this is exactly your desired result. (But the formulas giving the measures of the projections are a stronger result, as in the comment that @C-RAM made.)