The second fascinating document I promised a look at. It expands on Dictatus Papae
While studying use of the pallium during the reform papacy of the 11th century, I came across a fascinating document that has great relevance to the question of whether a pope can be condemned or lose his office for denying the Catholic faith. I have never seen this document referenced in any discussion on the subject, so I want to introduce it here. Others more educated than I on theological matters can debate its merits.
In 1075 the papacy of Pope St. Gregory VII promulgated a syllabus on papal power known as Dictatus Papae. Dictatus Papae was meant to be a synopsis of the pope's prerogatives drawn from previous papal letters and canonical legislation, not unlike the Syllabus of Errors of Pope Pius IX. The nineteenth thesis of Dictatus Papae says of the Roman pontiff:
19. That he himself may be judged by no one
This refers to the canonical principle prime sedes a nemine iudicatur ("the first see is judged by no one"), a maxim that dates to the pontificate of Pope Symmachus (498-514), who was put on trial for various crimes alleged by King Theodoric the Ostrogoth. The episcopal synod summoned to try Symmachus refused to even pass judgment, on the premise that "the first see is judged by no one." Pope Gregory VII wished to call this episode to mind in Dictatus Papae, as he himself was in a similar predicament with Holy Roman Emperor Henry IV over the matter of lay investiture. He wanted to stress that no one could pass judgment on the pope, whether ruler or episcopal synod. 
Dictatus Papae is a well known document, but what is not so familiar is that shortly after the promulgation of Dictatus Papae another syllabus was published. Called Propriae auctoritates apostolicae sedis ("The Powers Proper to the Holy See") [pdf], this document was meant to elaborate on the theses of Dictatus Papae . Issued sometime between 1075 and 1085, these theses should be read in conjunction with Dicatus Papae, which it is meant to support and expand upon.
Thus, we see that thesis 19 of Dictatus Papae is expanded in Propriae auctoritates apostolicae sedis, the seventh thesis of which says:
7. The pope may be judged by no one, even if he should deny the faith, as is seen from [Pope] Marcellinus
Apparently, the curia of Gregory VII did not think the 19th thesis of Dictatus Papae was explicit enough, so they desired to restate the maxim with the addition "even if he should deny the faith, as is seen by Marcellinus." The details of how this thesis came to be are unknown, but the implication is that the imperial propagandists of Henry IV had responded to Dictatus Papae by arguing that a pope could not be judged unless he had denied the faith. Gregory VII responded by appealing to the case of Pope Marcellinus, who had in fact publicly apostasized (or was at least believed to have) and yet did not lose his office. While Dictatus Papae 19 references a criminal trial (of Pope Symmachus), Propriae auctoritates apostolicae sedis 7 references a case of public loss of faith. The implication is that the Magisterium of Pope Gregory VII meant to teach that a pope could not be judged or deposed even if he had specifically denied the faith.
I am not competent to comment on the authority or theological import of the document, but future discussions about theoretically deposing a pope should most certainly factor in this document, as it was promulgated under the Pope Gregory VII specifically in part to address this very question.
 Thus Gregory categorically rejected the authority of the Synod of Brixen (1080) which condemned Gregory of various crimes and that the pope "should be canonically deposed and expelled and condemned in perpetuity, if, having heard this [decree], he does not step down."
 The text of Propriae auctoritates apostolicae sedis was found in a German language work by Hubert Mordek, 'Proprie auctoritates apostolice sedis. Ein zweiter Dictatus papae Gregors VII.?', Deutsches Archiv für Erforschung des Mittelalters 28 (1972), pp. 105-32 Translated by T. Reuter.