Yevamos, Chapter 4, Mishnah 1. The Mishnah deals with a yavam who performed chalitzah with his yevamah, and after the act of chalitzah it became clear that she was pregnant from her deceased husband. If that child is viable, it turns out that the woman was never subject to yibum at all, and consequently the chalitzah performed with her had no basis and is not valid. Everything, then, depends on one question: will the child that is born be viable or not.
Introduction: Chalitzah as a form of divorce:
A man who divorces his wife is forever forbidden to marry her relatives, since through his marriage to her, her relatives became forbidden to him, and this prohibition remains in force even after the divorce. Chalitzah resembles divorce in its form, and therefore it was said with regard to it as well that the yavam becomes forbidden to the relatives of the chalutzah, and she to his relatives. So too, a chalutzah is disqualified by rabbinic law from marrying a kohen, because she resembles a divorcee, who is forbidden to a kohen by Torah law.
When the child is viable:
When the child's full term was completed and it remained alive, or thirty days passed and it is still alive, it becomes clear retroactively that it is a viable child. In this case it turns out that the woman was never obligated in chalitzah, and the act of chalitzah that was performed with her, even though it actually took place, was meaningless from the outset. Therefore:
"Hu mutar bikroveseha" - the yavam who performed the chalitzah does not become forbidden to the woman's relatives.
"Vehi muteres bikrovav" - she too does not become forbidden to his relatives.
"Velo pesalah min hakehunah" - she is not considered a chalutzah, and therefore the rabbinic prohibition against a kohen marrying a chalutzah does not apply to her at all.
When the child is not viable:
If the child is not viable, it turns out that the woman genuinely was subject to yibum or chalitzah, and the chalitzah performed with her was a full and valid chalitzah. Therefore:
"Hu asur bikroveseha" - the yavam who performed the chalitzah becomes forbidden to her relatives.
"Vehi asurah bikrovav" - she too becomes forbidden to his relatives.
"Ufsalah min hakehunah" - she is a full chalutzah, and is therefore disqualified from marrying a kohen.
In summary: In this Mishnah we learned that the validity of the chalitzah performed with a yevamah who was found to be pregnant is determined retroactively according to the fate of the child. A viable child reveals that there was no bond of yibum here at all, and the chalitzah is void, so there is no prohibition regarding relatives and no disqualification from the kehunah. If the child is not viable, the chalitzah was a full chalitzah with all its laws: a prohibition regarding relatives on both sides and disqualification from the kehunah.