# Measurability of $\{(x,y): x\in M,0\leq y\leq f(x)\}$

Let $(X,\mathfrak{S}_x,\mu_x)$ be a measure space endowed with the $\sigma$-additive and complete measure $\mu_x$ defined on the $\sigma$-algebra $\mathfrak{S}_x$, let $\mu_y$ be the linear Lebesgue measure that $\mathbb{R}$ is endowed with, and let $\mu:=\mu_x\otimes\mu_y$ be the Lebesgue extension of product measure $\mu_x\times\mu_y:(A,B)\mapsto\mu_x(A)\mu_y(B)$. I read that (ex. 1 here) if $M$ is a $\mu_x$-measurable set, $f$ a Lebesgue-integrable non-negative function$^1$, and $A\subset X\times\mathbb{R}$ is the set$$A:=\{(x,y): x\in M,0\leq y\leq f(x)\}$$then $\mu(A)=\int_M f(x)d\mu_x$ (cfr. th. 3 here). The reason why this last equality is true would be clear to me if it would be proven that $A$ is measurable, about which the textbook is silent, although I suppose that it is implicit. Could anybody explain why $A$ is measurable? I heartily thank you!

$^1$I think that it can be either $f:X\times \mathbb{R}\to\mathbb[0,+\infty)$ or $f:M\times \mathbb{R}\to\mathbb[0,+\infty)$. The lack of formality of the text is disconcerting.

Observe that $$A= \{(x,y): y\geq 0\}\cap \{(x,y): f(x)\geq y\}= X \times \{y\geq 0\}\cap \{(x,y):f(x)-y\geq 0\}$$ The first set in the intersection is a rectangle so it is measurable. For the second set, note that the function $(z,y)\mapsto z-y$ from $\mathbb R^2$ to $\mathbb R$ is continuous so it is measurable. Also, the map $X\times \mathbb R \ni(x,y)\mapsto (f(x),y)\in \mathbb R^2$ is measurable, since the inverse image of a rectangle $(a,b)\times(c,d)$ is $g^{-1}(a,b)\times (c,d)$ which is a measurable set. Therefore, the composition of the above functions $\phi(x)= f(x)-y$ is measurable, and this guarantees that the set $\{ (x,y):f(x)-y\geq 0\}$ is measurable.