We prove that if M is a closed n-dimensional Riemannian manifold, n≥3, with Ric≥n−1 and for which the optimal constant in the critical Sobolev inequality equals the one of the n-dimensional sphere Sn, then M is isometric to Sn. An almost-rigidity result is also established, saying that if equality is almost achieved, then M is close in the measure Gromov-Hausdorff sense to a spherical suspension. These statements are obtained in the RCD-setting of (possibly non-smooth) metric measure spaces satisfying synthetic lower Ricci curvature bounds.%G eng

An independent result of our analysis is the characterization of the best constant in the Sobolev inequality on any compact CD space, extending to the non-smooth setting a classical result by Aubin. Our arguments are based on a new concentration compactness result for mGH-converging sequences of RCD spaces and on a Polya-Szego inequality of Euclidean-type in CD spaces.

As an application of the technical tools developed we prove both an existence result for the Yamabe equation and the continuity of the generalized Yamabe constant under measure Gromov-Hausdorff convergence, in the RCD-setting.