I am trying to understand how to check whether two algebraic varieties intersect transversally from a purely algebraic standpoint. Is the following argument correct?
Say locally a smooth projective variety $X$ is modeled by Spec $R$ with subvarieties $A$ = Spec $R/I$ and $B$ = Spec $R/J$. Then there is a map $\Phi: R \mapsto R/I \oplus R/J$ ($f \mapsto \phi_1(f) \oplus \phi_2(f)$ where $\phi_i$ are the quotient maps). If $\mathfrak{m}_{X,p}$ is the maximal ideal of the local ring $R_p$ and similarly for $\mathfrak{m}_{A,p}$, $\mathfrak{m}_{B,p}$, then $\Phi$ descends to a map $\Psi$ of Zariski cotangent spaces $$\mathfrak{m}_{X,p}/\mathfrak{m}_{X,p}^2 \rightarrow \mathfrak{m}_{A,p}/\mathfrak{m}_{A,p}^2 \oplus \mathfrak{m}_{B,p}/\mathfrak{m}_{B,p}^2.$$Then $A$ and $B$ of complementary codimension intersect transversally at $p$ in their intersection if the map if and only if $\Psi$ is injective (so its dual is surjective).
Is this correct? If not, can somebody point me in the direction of the correct argument? I have looked in both Vakil and Hartshorne to no avail.