I have a list of equations and some of which have multiple steps which I have managed to align in their individual environments. But I would like each set of equations to also align by "=", while the comments to the right of the equations also stay aligned with eachother.
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage[makeroom]{cancel}
\begin{document}
\begin{align*} \tag{a}
Y = f(x_0) + \epsilon_0
&& \text{By assumptions}
\end{align*}
\begin{align*} \tag{c}
E\big[Y\big] & = E\big[f(x_0)+\epsilon_0\big]
&& \text{By (a)}
\\& = E\big[f(x_0)\big] + \cancel{E\big[\epsilon_0\big]}
&& \text{By Linearity}
\\&= E\big[f(x_0)\big]
&& \text{By Expectation of $\epsilon$}
\end{align*}
\begin{align*} \tag{e.i}
&E\big[f(x_0)] = f(x_0)
&& \text{As $x_0$ is fixed and deterministic}
\\&\text{$f(x_0)$ is constant.} \tag{e.ii}
\\&\text{$f(x_0)$ and $\hat{f}(x_0)$ are independent.} \tag{e.iii}
\end{align*}
\end{document}
I am still learning LateX so I'm sorry if this is obvious. I would really appreciate any help and don't be afraid to explain minor steps as this really helps my understanding! Thank you in advance for your time and help.
&\text{$f(x_0)$ is constant.}
a comment or an equation?