The Catholic Church teaches that a heretic cannot become Pope any more than an unbaptized person or a woman. This is stated in the Papal Bull, Cum Ex Apostolatus Officio of Pope Paul IV in paragraph 6.
Diocesan Bishops as the Ecclesia Docens (Teaching Church) are held to a higher level in regard to doctrine. It is their duty to see to it that everything taught in their diocese is true Catholic doctrine. Canon Law gives them the right and duty to judge matters of heresy in their own diocese and to absolve from the excommunication for heresy. Therefore they are required to know Catholic teaching. If they commit the crime of heresy, they are presumed to have done so willingly. Therefore they are presumed to incur all of the penalties attached to heresy.
Heretics resign all offices they may hold in the Church and Canon Law accepts their resignation without need of any declaration on the part of a superior.
The Second Vatican Council taught heresy in several documents, including but not limited to the Decree on the Liturgy, the Decree on Ecumenism and the Decree on the Relation of the Church to Non-Christian Religions.
All but four bishops present voted for the Decree on the Liturgy. Also, unless they state otherwise, all of the bishops present are presumed to have signed all of the decrees of Vatican II. Such is an act of notorious public heresy. Therefore by the end of Vatican II, every bishop present had resigned his office by the commission of public heresy, including the Bishop of Rome, John the Baptist Montini, who had taken the name of Paul VI.
And thus, by the end of Vatican II there was only one Cardinal left, Cardinal Mindszenty, and no Pope. With the Papacy vacant, the Church needed a Pope. Mindszenty died in 1975, therefore the Church had no Cardinals to elect a Pope.
When the Church is without Cardinals, theologians and canonists teach that she must supply herself with a Pope in an extraordinary manner. This they teach is a matter of the Natural Law, since a perfect society always has the ability to supply itself with a ruler. The Church is a perfect society, so it is always possible to elect a Pope, here and now.
The first principle is that the first elected has the Papacy. This is known as first in time, first in right. Also nothing invalidates the election of a Pope, except the election of someone not qualified by Divine Law. Divine Law holds that the unbaptized, women and heretics cannot be elected as Pope. Ecclesiastical Law cannot regulate who may be elected Pope. Every attempt to issue such a law has been set aside by the election of someone not qualified. One such attempt was to limit election to the Cardinals. The electors set this aside by electing someone who was not a Cardinal. Fraud and even simony do not render an election of a Pope invalid.
A reasonable attempt must be made to summon the electors after an office becomes vacant. Those who appear on the day appointed are the electors. Even the absence of a majority of qualified electors does not render an election invalid as history proves.
Beginning in the early 1970’s both the fact of the vacancy of the papacy and the necessity of electing a Pope was discussed by Catholics. On July 16, 1990 a group of Catholics assembled and elected David Bawden as Pope, who took the name of Pope Michael. This group made every effort possible to notify all those who might be qualified, including contacting each and every chapel listed as sedevacantist, meaning that they believed the papacy was vacant.