Im trying to solve the following problem:
Problem
Let $(S, \mathcal{A}) , (S, \mathcal{A} ')$ be measurable spaces and $\varphi, \psi , \psi' : S \to S' $ $\mathcal{A}- \mathcal{A}'$ measurable functions. Additionally, product $\sigma $-algebra $\mathcal{A}'\otimes \mathcal{A}'$ contains the diagonal $D = \{ (x,y) \in S'\times S' : x=y\} $. Show that $\{ x \in S : \psi(x) = \psi'(x) \}\in \mathcal{A} $ and using that conclude $\{ (x, y) \in S \times S ' : y = \varphi(x) \} \in \mathcal{A} \otimes \mathcal{A} ' $
Attempt
First part is easy: We consider a function $\Phi: S \to S'\times S' , \Phi (x) = ( \psi(x), \psi' (x))$. Since both $\psi $ and $\psi'$ are measurable $\Phi$ is $\mathcal{A} - \mathcal{A}'\otimes\mathcal{A} ' $ measurable, thus $\{ \psi = \psi '\} = \Phi^{-1}(D) \in \mathcal{A}$ per definition. However, Im stuck with showing that $G: = \{ (x, y) \in S \times S ' : y = \varphi(x) \} \in \mathcal{A} \otimes \mathcal{A} ' $. I assume that I need to find some measurable function $\Pi : \mathcal{A} -\mathcal{A}' \to \mathcal{A} $ such that $\Pi^{-1}( \{ \psi = \psi '\} ) = G $, wihch in "normal" circumstances (with Borel algebras) would be $\Pi(x,y) = \varphi(x) - y$, however neither "-" and "0" are defined, nor $S=S'$ is satisfied.
Take $$\Pi : S \times S' \to S' \times S'$$ $$ \Pi(x,y)=(\phi(x),y) $$ This is a $\mathcal{A} \otimes \mathcal{A}' - \mathcal{A}' \otimes \mathcal{A}'$ measurable function as for any set of the form $A \times B$ with $ A, B \in \mathcal{A}' $; we have $\Pi^{-1}(A \times B)=\phi^{-1}(A) \times B \in \mathcal{A}\otimes \mathcal{A}'$ and these are generators for the product $\sigma-$ algebra.
Then $G=\Pi^{-1}(D) \in \mathcal{A} \otimes \mathcal{A}'$ by the first part.