  We study decreasing rearrangements of functions defined on (possibly
non-smooth) metric measure spaces with Ricci curvature bounded below by $K>0$
and dimension bounded above by $N\in (1,\infty)$ in a synthetic sense, the so
called $CD(K,N)$ spaces. We first establish a Polya-Szego type inequality
stating that the $W^{1,p}$-Sobolev norm decreases under such a rearrangement
and apply the result to show sharp spectral gap for the $p$-Laplace operator
with Dirichlet boundary conditions (on open subsets), for every $p\in
(1,\infty)$. This extends to the non-smooth setting a classical result of
B\'erard-Meyer and Matei; remarkable examples of spaces fitting out framework
and for which the results seem new include: measured-Gromov Hausdorff limits of
Riemannian manifolds with Ricci$\geq K>0$, finite dimensional Alexandrov spaces
with curvature$\geq K>0$, Finsler manifolds with Ricci$\geq K>0$. In the second
part of the paper we prove new rigidity and almost rigidity results attached to
the aforementioned inequalities, in the framework of $RCD(K,N)$ spaces, which
seem original even for smooth Riemannian manifolds with Ricci$\geq K>0$.
