"Si quis dixerit, receptos et approbatos ecclesiae catholicae ritus in solemni sacramentorum administratione adhiberi consuetos aut contemni, aut sine peccato a ministris pro libito omitti, aut in novus alio per quemcumque ecclesiarum pastorem mutari posse: anathema sit." - -Session VII, Canon 13
"If anyone says that the received and approved rites of the Catholic Church, accustomed to be used in the administration of the Sacraments, may be despised or omitted by the ministers without sin and at their pleasure, or may be changed by any pastor [which includes the Supreme Pastor, the Pope] of the churches to other new ones, let him be anathema."
"In the case in which the pope would become a heretic, he would find himself, by that fact alone and without any other sentence, separated from the Church. A head separated from a body cannot, as long as it remains separated, be head of the same body from which it was cut off.
"A pope who would be separated from the Church by heresy, therefore, would by that very fact itself cease to be head of the Church. He could not be a heretic and remain pope, because, since he is outside of the Church, he cannot possess the keys of the Church."
(Summa Theologica)