Our main theorem states that the complement of a compact holomorphically convex set in a Stein manifold with the density property is an Oka manifold. This gives a positive answer to the well-known long-standing problem in Oka theory whether the complement of a compact polynomially convex set in $\mathbb{ C}^{ n}$ $(n>1)$ is Oka. Furthermore, we obtain new examples of nonelliptic Oka manifolds which negatively answer Gromov's question. The relative version of the main theorem is also proved. As an application, we show that the complement $\mathbb{ C}^{ n}\setminus\mathbb{ R}^{ k}$ of a totally real affine subspace is Oka if $n>1$ and $(n,k)\neq(2,1),(2,2),(3,3)$.
Categories: math.CV math.DS