We will report on the construction of energy minimizing bases for coarse spaces built by patching solutions to appropriate saddle point problems. We first set an abstract framework for such constructions, and then we give examples of constructing coarse space and stable interpolation operator for the two level Schwarz method. We apply the theoretical results in the design of coarse spaces for discretizations of PDE with large varying (rough) coefficients. We prove stability and approximation properties of these spaces in a weighted norm. The constants in these bounds are independent of the variations in the PDE coefficients. Such coarse spaces can be used in for numerical upscaling and for two level overlapping Schwarz algorithms for elliptic PDEs with large coefficient jumps generally not resolved by a standard coarse grid. We present numerical tests illustrating the theoretical results. This is a joint work with Robert Scheichl (University of Bath, UK) and Panayot S. Vassilevski (Lawrence Livermore National Lab, USA).