# Does there exist a curve which avoids a given countable union of small subsets?

Let $$X$$ be a projective variety over $$\mathbb{C}$$. Let $$X_1, X_2, \ldots$$ be proper closed subsets of $$X$$. Then $$\cup_i X_i \neq X(\mathbb{C})$$. However, I am interested in a stronger statement.

Assume that, for all $$i$$, we have that $$\mathrm{codim}(X_i)\geq 2$$.

Then, does there exist a smooth projective curve $$C\subset X$$ such that $$C$$ and $$\cup_i X_i$$ are disjoint?

The condition on the codimension is clearly necessary (Take $$X_1$$ to be an ample divisor to see this).

Yes. In fact we can take $$C$$ to be the intersection of $$\dim X-1$$ hyperplanes.
Consider the set parameterizing intersections of $$\dim X-1$$ hyperplanes, which is some projective variety. By Bertini, the smooth curves form an open subset of this projective variety. For each $$X_i$$, the curves passing through it form a closed subset of this variety, of codimension at least 1. Then we apply the original result you stated to these new closed subsets.
The codimension lower bound comes from exchanging the order of summation, i.e. consider the variety of pairs of a point in $$X_i$$ and a curve through that point, which maps surjectively to the set of curves intersecting $$X_i$$, and which is a bundle on $$X_i$$ whose fibers have codimension $$\dim X-1$$ in the space of all curves, hence has codimension at least $$\dim X-1 - \dim X_i \geq 1$$.