"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)
"Those therefore who after the manner of wicked heretics dare to set aside ecclesiastical traditions, and to invent any kind of novelty, or to reject any of those things entrusted to the Church, or who wrongfully and outrageously devise the destruction of any of those traditions enshrined in the Catholic Church, are to be punished thus: if they are bishops, we order them to be deposed...."