Mathematics of rigidity