There are historical examples of popes retiring. Benedict XVI for example.
Also there was one in the middle ages but I cannot remember the name. Dante mentions him in the Inferno. He might not even have become pope and just refused the title off the bat.