This is a continuation of the post Purity (part 2). Thanks to an email from János Kollár we now know that the answer to the question is no for relative dimension ≥ 2 as I will explain in this post. All mistakes in this post are mine (of course).
Take a large integer n. The minimal versal deformation space (Y, y) of the rank 2 locally free module O + O(n) on P^1 has dimension n – 1 and is smooth. Let X’ be the projectivization of the universal deformation over Y x P^1. Then X’ → Y is a smooth projective family of Hirzebruch families. The fibre Σ = X’_y is the Hirzebruch surface Σ → P^1 which has a section σ with self-intersection -n. Recall that the Picard group of Σ is generated by σ and a fibre F. Consider the invertible module L on X’ whose restriction to Σ is D = -K + (n – 2)F. A computation shows that
- D σ = 0
- H^1(O_Σ(D)) = H^2(O_Σ(D)) = 0
- H^0(O_Σ(D)) has dimension 3n + 3 and gives an embedding of the contraction of σ in Σ into P^{3n + 2}
However, every other fibre of X’ → Y is a Hirzebruch surface whose directrix has self-intersection > -n. Hence -K + (n – 2)F will not contract the directrix on any other fibre. We conclude that L defines a factorization X’ → X → Y where we are constracting σ on Σ to a point x in X and nothing else. Thus f : X → Y is a morphism of varieties, Y is smooth, X is a normal variety, and f is smooth at all points except at x. Thus we see
codim Sing(f) = n – 1 + 2 = n + 1
Since the question was whether codim Sing(f) ≤ 1 + 2 we see the answer is very much no in the case of relative dimension 2.
For relative dimension d ≥ 2 we take the morphism X x A^{d – 2} → Y which has a singular locus still of codimension n + 1 and hence this shows the answer is no as soon as n > d.
As far as I know the question remains unanswered for relative dimension 1 (besides the one subcase of relative discussed in the previous post on this topic). Please let me know if you have an idea or an example.
PS: As János points out the morphism f constructed above is even flat and the fibres of f have rational singularities. Thus it seems unlikely there is a class of singularities strictly bigger than the lci ones (see previous post) for which purity holds.
PPS: Another question is whether examples like this can help us find examples of other purity statements gone wrong.