Sergio Mattarella, a constitutional court judge, was sworn in on Tuesday as Italy's new president.