[step:Verify measurability of the induced map and reduce to the recurrent part of $A$]For $j \in \mathbb{N} \cup \{0\}$, let $T^j : X \to X$ denote the $j$-fold iterate of $T$, with $T^0$ the identity map on $X$. For $C \in \mathcal{B}$, write $T^{-j}(C) := (T^j)^{-1}(C)$; this is preimage notation and does not require $T$ to be invertible.
For each $k \in \mathbb{N}$, the level set
\begin{align*}
\{n_A = k\} = A \cap \bigcap_{j=1}^{k-1} T^{-j}(X \setminus A) \cap T^{-k}(A)
\end{align*}
lies in $\mathcal{B}_A$, where the intersection over $1 \le j \le k-1$ is interpreted as $X$ when $k = 1$. Therefore $n_A$ is $\mathcal{B}_A$-measurable as a map into $\mathbb{N} \cup \{\infty\}$ (with the discrete $\sigma$-algebra), and
\begin{align*}
A_\infty = A \setminus \bigcup_{k=1}^{\infty} \{n_A = k\} \in \mathcal{B}_A, \qquad A_* = A \setminus A_\infty \in \mathcal{B}_A.
\end{align*}
Since $(X, \mathcal{B}, \mu, T)$ is measure-preserving, $\mu(X) < \infty$, and $A \in \mathcal{B}$, the hypotheses of the [Poincaré Recurrence Theorem](/theorems/???) are met, and it yields
\begin{align*}
\mu(A_\infty) = 0.
\end{align*}
For every $E \in \mathcal{B}_A$, the definition of $T_A$ gives
\begin{align*}
T_A^{-1}(E) = \left(\bigcup_{k=1}^{\infty} \{n_A = k\} \cap T^{-k}(E)\right) \dot\cup (E \cap A_\infty),
\end{align*}
where the union is disjoint because the sets $\{n_A = k\}$ are pairwise disjoint and contained in $A_*$, while $E \cap A_\infty \subseteq A_\infty$. Each piece $\{n_A = k\} \cap T^{-k}(E)$ lies in $\mathcal{B}_A$, and $E \cap A_\infty \in \mathcal{B}_A$, so $T_A^{-1}(E) \in \mathcal{B}_A$. Hence $T_A$ is $\mathcal{B}_A$-measurable. Because $E \cap A_\infty \subseteq A_\infty$ and $\mu(A_\infty) = 0$, $\mu(E \cap A_\infty) = 0$, so
\begin{align*}
\mu(T_A^{-1}(E)) = \mu\left(\bigcup_{k=1}^{\infty} \{n_A = k\} \cap T^{-k}(E)\right).
\end{align*}
Replacing the identity on $A_\infty$ by any other $\mathcal{B}_A$-measurable map $A_\infty \to A$ changes $T_A^{-1}(E)$ only by a measurable subset of $A_\infty$, hence only by a $\mu$-null set; the displayed identity, and therefore the entire argument that follows, is unaffected by the choice of extension.[/step]