Equivalent random variables and sigma algebras Consider two random variables $X$ and $Y$ defined on the same probability space $(\Omega,\sigma,P)$. We know that they are equivalent in the sense that $P(\{X \ne Y\})=0$. Let $A_X$ and $A_Y$ be the sigma algebras generated by these random variables. What can we say about $A_X$ and $A_Y$? Are they the same? 
PS: I had this doubt when looking at martingales, since if the two sigma algebras come out to be different it seems to me that we can modify the characteristic of a process of being adapted with respect to a given filtration simply by changing the process over a set of measure zero. Which I find counterintuitive.
 A: Let $A$ be a non-trivial subset of $\Omega$ and let $\Omega$ be
equipped with $\sigma$-algebra $\left\{ \varnothing,A,A^{c},\Omega\right\} $
and probability measure $P$ determined by $P\left(A\right)=1$.
Let $X:\Omega\to\mathbb{R}$ be prescribed by $\omega\mapsto1$
Let $Y:\Omega\to\mathbb{R}$ be prescribed by $\omega\mapsto1$ if
$\omega\in A$ and $\omega\to0$ otherwise.
Then $X,Y$ are random variables with $P\left(X\neq Y\right)=P\left(A^{c}\right)=0$.
However the $\sigma$-algebra generated by $X$ is $\left\{ \varnothing,\Omega\right\} $
but the $\sigma$-algebra generated by $Y$ is $\left\{ \varnothing,A,A^{c},\Omega\right\} $.
A: Something that is closely related can be a statement like that:
Claim: Let $X$ and $Y$ equivalent in the sense already described. If $U \in A_X$, than there exists $U' \in A_Y$ such that the symmetric difference has zero measure: $P(U \Delta U')=0$.
Trial proof: We first prove the statement for all sets of the type $U=\{X^{-1}(B)\}$ where $B$ is a Borel set. We temporarily call $F=\{U=\{X^{-1}(B)\},B \in Borel \}$ this subset of $A_X$. In this case let take $U'=\{Y^{-1}(B)\}$. We have the inclusion $U \Delta U' \subset \{X \ne Y\}$. Since $P(\{X \ne Y\})=0$ we also have $P(U \Delta U')=0$. To complete the proof and show that $F=A_X$, since $\sigma(F)=A_X$ ($F$ generates $A_X$), we need to show that the ensemble of sets respecting the claim indeed forms a sigma algebra, i.e. it is closed under countable union and complements. These are a consequence of the algebraic properties of the symmetric difference reported here https://en.wikipedia.org/wiki/Symmetric_difference .
I hope the statement is correct (can somebody check it?).
For the martingale relation of my question I found this interesting blog:
https://almostsure.wordpress.com/2009/11/08/filtrations-and-adapted-processes/
