The Globalization Theorem for the Curvature-Dimension Condition