Let $X$ be a variety and $Y \subset X$ a closed subvariety. 


**Edit:** Assume they are both smooth.


Denote $N\_{Y / X}$ the normal bundle of $Y$ in $X$. The formal neighbourhood of $Y$ in $X$ is the formal scheme $X\_Y = \text{Spec}\left( \lim\_{n} \mathcal{O}\_X \left/ \mathcal{I}\_Y^n \right. \right)$.


The question is the following: how distant is the formal neighbourhood of $Y$ in $X$ from the formal neighbourhood of $Y$ in the total space of $N\_{Y / X}$?


The question should be related to the splitting of the tangent sequence
$$
0 \rightarrow T\_Y \rightarrow T\_X \vert\_Y \rightarrow N\_{Y / X} \rightarrow 0,
$$
and thus to the vanishing of $\text{Ext}^1\_Y(N\_{Y/X}, T\_Y)$, but I can't figure out this relation.


Thanks.



Formal neighbourhood of a closed subscheme
If you look at a family of elliptic curves like $y^2 = x^3 - x-t^n$ as a surface $X$ mapping to a curve $C$ with parameter $t$, and $Y$ the fiber over $0$, then the neighborhood modulo $\mathcal I\_Y^n = (t)^n= (t^n)$ is trivial, hence equal to the $n$'th formal neighborhood of $Y$ in the total space of $N\_{Y/X}$, but the neighborhood modulo $\mathcal I\_Y^{n+1}$ is not. This shows that no finite list of obstruction classes will describe the formal neighborhood. 


If the $n$th' order formal neighborhood is isomorphic to the $n$th order formal neighborhood in the normal bundle, then the ring of functions on it is isomorphic to $$\mathcal O\_Y \oplus N\_{Y/X}^\vee \oplus \operatorname{Sym}^{2} N\_{Y/X}^\vee \oplus \dots \oplus \operatorname{Sym}^{n-1} N\_{Y/X}^\vee $$ and the $n+1$st order neighborhood is locally the sum of that with $\operatorname{Sym}^n N\_{Y/X}^\vee$ and then automorphisms respecting the algebra structure and the filtration but not the direct sum structure are given by $\operatorname{Sym}^n N\_{Y/X}^\vee$-values derivations on that sum. A derivation is determined by the Leibnitz rule and its value on the first two factors, so the local automorphisms are given by $$\mathcal T\_Y \otimes \operatorname{Sym}^n N\_{Y/X}^\vee + N\_{Y/X} \otimes \operatorname{Sym}^n N\_{Y/X}^\vee$$ and so you obstruction classes in $H^1(Y, \mathcal T\_Y \otimes \operatorname{Sym}^n N\_{Y/X}^\vee )$ and $H^1(Y, N\_{Y/X} \otimes \operatorname{Sym}^n N\_{Y/X}^\vee)$, I think.


The first obstruction controls when the formal neighborhood can be viewed as a fibration over $Y$ and the second obstruction controls when you can identify the fibers with the normal bundle.


