Is every flat morphism of schemes $X\rightarrow S$ such that the fiber over any point is smooth necessarily formally smooth? [There are](https://mathoverflow.net/a/200/141498) formally smooth morphisms that are not flat so the converse fails. If we assume that the morphism is locally of finite presentation, then it is necessarily smooth so a fortiori formally smooth.



Flat with smooth fibers implies formally smooth?
Welcome new contributor. This is too long for a comment. Let $R$ be a DVR with a uniformizing element $t$, e.g., $k[[t]]$ where $k$ is a field. Let $C$ be the $R$-algebra $$C=R[x\_n:n\in \mathbb{Z}\_{\geq 0}].$$ Let $J$ be the ideal in $C$, $$J=\langle x\_n-tx\_{n+1} :n\in \mathbb{Z}\_{\geq 0} \rangle.$$ Let $A$ be the $R$-algebra $C/J$. 


Since $A$ has no $t$-torsion, the $R$-module $A$ is $R$-flat. The fiber ring $A\otimes\_R (R/t R)$ equals $R/tR$, which is smooth over $R/tR$. The fiber ring $A\otimes\_R R[1/t]$ equals $R[1/t][x\_0]$, which is smooth over $R[1/t]$. 


Now consider the $R$-algebra $B=C/J^2$. Let $I$ be the image ideal in $B$, $$I=J/J^2.$$ This is a square-zero ideal whose quotient algebra equals $A$. Thus, if $A$ is formally smooth, there exists a retraction of $R$-algebras, $$s:A\to B.$$ In particular, $s(x\_0)$ is a $t$-divsible element of $B$ that maps to $x\_0$ in the quotient algebra $A$.


Consider the quotient of $B$ by the ideal $$K = \langle x\_mx\_n :m,n\in \mathbb{Z}\_{\geq 0} \rangle.$$ The quotient $B$-algebra equals $R\oplus M$ where $M$ is a square-zero ideal that is the free, countably-generated $R$-module with basis $$\{ x\_n : n\in \mathbb{Z}\_{\geq 0} \}.$$ In particular, the element $x\_0$ in this quotient algebra is not $t$-divisible in $M$. Thus, there is no $t$-divisible element of $B$ that maps to $x\_0$ in the quotient algebra $A$. Therefore, $A$ is not formally smooth over $R$.


