Regularity of solutions in the optimal transport problem require very rigid hypotheses (e.g., convexity of certain sets). In more general cases one can consider the question of partial regularity, i.e. in-depth analysis of the structure of singular sets. In this talk I will discuss the finer geometric structure of the set of ``free singularities`` which arise in an optimal transport problem from a connected set to a disconnected set, along with the stability of such sets under suitable perturbations of the data involved. Such results are proven via a non-smooth implicit function theorem for convex functions, which is of independent interest. This talk is based on joint work with Robert McCann.