Intersections of analytic sets with linear subspaces