Is The Papacy A Sacrament; A Part of Holy Orders?
The Papacy can be compared to a Sacrament with matter, form and intention:
Matter: is the man elected Pope and the electors
Form: is the election itself
Intention: is to elect a Pope.
Since the Papacy can be resigned, and has on two occasions, Gregory XII and Saint Celestine V, we know that the Papacy is not a Sacrament. (Canon 220) However, using this analogy we can analyze the matter:
The Form is the election, and no matter how faulty, it is considered valid. Saint Alphonsus states: It doesn’t matter that in past centuries some pontiff has been elected by fraud: it suffices that he has been accepted after as pope by all the Church, for this fact he has become true pontiff
The Intention is presumed, because why elect a Pope, if this is not what you intend to do?
Saint Alphonsus talks about the form of the election, and not the matter, because the higher law (Cum Ex Apostolatus Officio) infallibly states that a heretic cannot become Pope.