Rigidity in geometry and dynamics