ZIKAH DEPENDENT ON A SAFEK NEFEL [Nefel:Safek:Zikah]
Gemara
(Beraisa - R. Shimon ben Gamliel): Any baby that lived 30 days is viable.
Inference: If it lived less than 30 days, it is a Safek.
(Ravina citing Rava): If Reuven died, and then his only child died within 30 days of its birth, and David (a stranger) was Mekadesh the widow:
If David is a Yisrael, she must do Chalitzah. If he is a Kohen, she does not need Chalitzah.
(Rav Mesharshiya citing Rava): In either case she must do Chalitzah.
Ravina: At night Rava said so, but in the morning, he retracted (and said like me)!
Rav Mesharshiya: You permit (Nisu'in even when David is a Kohen)! If only you would permit Chelev!
Shabbos 136a (Abaye): If a baby yawned and died, Chachamim agree that he was a Nefel;
They argue about a baby who fell from the roof or was eaten by a lion (within 30 days). R. Shimon assumes that he was a Nefel; Chachamim assume that he was alive.
(Shmuel): The Halachah follows R. Shimon.
Rishonim
Rif and Rosh (4:5): The Halachah follows Ravina. Since Chachamim disagree with R. Shimon ben Gamliel and consider a baby viable even if died within 30 days, we rely on them regarding a Kohen's wife, since there is no solution according to R. Shimon.
Rosh: Even though there is a Safek if she is forbidden to him mid'Oraisa (if she is really Zekukah l'Yibum), it is better than doing Chalitzah. If Chachamim require Chalitzah, people might say that Chachamim determined that the baby was viable, and people will permit a Chalutzah to a Kohen. Rather, Chachamim do not require Chalitzah, and people say that they determined that the baby was a Nefel. They will not permit a Yevamah without Chalitzah.
Gra (EH 156:12): According to the Rambam (brought below) mid'Oraisa the baby was viable.
Rif: If her husband is a Yisrael we require Chalitzah, for there is no loss. This refers to Kidushin. All the more so we do not separate them after Nisu'in!
Nimukei Yosef (DH Tanya): Even R. Shimon is concerned for a Nefel only if the baby was premature. If it was a nine-month baby, no one requires Chalitzah. If it was a Vadai Ben Shemoneh whose Simanim were unfinished, even Chachamim agree that it is a Nefel. Even if she married a Kohen she must do Chalitzah and leave him. The argument is when we are unsure if it was born in the eighth or ninth month and the Simanim were unfinished, or if we know that it was born in the eighth and the Simanim were finished. We are stringent when her husband is a Yisrael; we rely on Chachamim when he is a Kohen, for they are the majority.
Ran (Shabbos 55a DH Garsinan): R. Yonah says that Abaye discussed a baby who died after yawning; the same applies if he died amidst illness. The Rif did not distinguish how the baby died. Since Rava did not distinguish, this shows that he disagrees with Abaye; the Halachah follows Rava. R. Yonah says that Rava agrees; he discusses when the baby fell and died. The Ba'al ha'Ma'or says that even viable babies can fall sick and die; Abaye discusses only one who died after yawning. Rava agrees; he does not discuss this.
Rambam (Hilchos Yibum 1:5): If a man died and then his widow gave birth to a live baby, even if the baby died right away she is exempt from Yibum. However, mid'Rabanan we must know for sure that he was born after nine full months. If we do not know the length of the pregnancy, if he lived 30 days he was viable and he exempts from Yibum and Chalitzah. If he dies within 30 days, whether from sickness or an accident, he was a Safek Nefel, so Chalitzah is required mid'Rabanan.
Magid Mishneh: Mid'Oraisa, the Rambam rules like Rebbi, that Simanim prove viability. He rules like R. Shimon ben Gamliel, that living 30 days proves viability. Also knowing that the pregnancy was nine full months proves viability. However, Chachamim were stringent in some matters. He learns from 36b; he holds that they argue about a baby born prematurely.
Rambam (2:21): If there is a Safek mid'Rabanan whether or not there is Zikah, mid'Rabanan she needs Chalitzah. An example is if the Mes died leaving a child born prematurely and it died within 30 days. If she became Mekudeshes before Chalitzah, she does Chalitzah and remains with her husband. If she became Mekudeshes to a Kohen who is forbidden to a Chalutzah, she does not do Chalitzah. We do not forbid her to him due to a Safek mid'Rabanan.
Lechem Mishneh: We cannot learn from this case to a general Safek mid'Rabanan. Here, Chachamim Vadai permit, so we are not stringent due to R. Shimon's Safek (perhaps the baby is a Nefel). Rather, he learns from the Gemara's question (regarding a Kohen who married a pregnant widow) 'on whom can we rely'? This implies that if anyone permits we rely on him, for it is a Safek mid'Rabanan.
Rambam (ibid.): If he divorced her or died she does Chalitzah, and then she may marry others l'Chatchilah.
Magid Mishneh: We were lenient only to permit the Kohen to keep her. After he dies there is no reason to be lenient.
Rebuttal (Ri'az in Shiltei ha'Giborim 11a:2, also cited in Mishneh l'Melech): Once we permitted her without Chalitzah, even if the Kohen died and she wants to marry a Yisrael she does not need Chalitzah.
Rosh (4:5): Chachamim argue with R. Shimon when the baby fell from the roof or was eaten by a lion, but if it yawned and died they agree that it is a Nefel. The Halachah follows R. Shimon. We do not follow the majority of babies who are viable, because Nefalim are a common minority. We are concerned for a common minority. E.g. if a man fell into water from which land cannot be seen in some direction, his wife may not remarry, for perhaps he survived. If a man was Goses (dying) one may not testify that he died, even though most Gosesim die.
Poskim
Shulchan Aruch (EH 164:7): If there is a Safek mid'Rabanan whether or not there is Zikah, mid'Rabanan she needs Chalitzah. An example is if she had a child and we are unsure whether or not it was born prematurely and it died on or before day 30. If she became Mekudeshes before Chalitzah, she does Chalitzah and remains with her husband. If she became Mekudeshes to a Kohen who is forbidden to a Chalutzah, she does not do Chalitzah. We do not forbid her to him due to a Safek mid'Rabanan.
R. Akiva Eiger: The Terumas ha'Deshen (216) says that if she became Mekudeshes to a Kohen b'Mezid (knowing that she needs Chalitzah) we are not lenient. It is not clear why the Poskim do not distinguish whether the baby died through an accident or amidst sickness or yawning. Only the Rif does not distinguish.
Beis Shmuel (11): The Nimukei Yosef says that even if it is Vadai an eight-month baby, if the Simanim were finished it is a proper child mid'Oraisa. The Tana'im argue about this (mid'Rabanan). However, Tosfos says that they also argue about an eight-month baby who lived 30 days; Chachamim say that it is still a Safek. The Gemara never says that Simanim are better than living 30 days, so we cannot rely on Chachamim to be lenient in this case. We have no source that R. Shimon says that Simanim help (only Rebbi says so). Perhaps Chachamim say that even Simanim and living 30 days do not help until 20 years. The Rivash says so explicitly. It is not clear whether we may rely on the Nimukei Yosef against Tosfos.
Beis Yosef (DH v'Im): The Ramah says that if she did Yibum, we do not forbid her to the Yavam due to Safek. He must hold that the Halachah follows R. Shimon ben Gamliel, so we are not concerned for Chachamim. Similarly, if a Yevamah did Yibum within three months and was found to be pregnant and the baby died within 30 days, the Ramah does not forbid her to the Yavam because it is a Safek. This is unreasonable. We must be stringent about a Safek mid'Oraisa!
Bedek ha'Bayis: We must say that he holds that it is a Safek mid'Rabanan
Rema: Similarly, if the Yavam is not here she is permitted to her Yisrael husband without Chalitzah because he already did Nisu'in.
Shulchan Aruch (ibid.): If he divorced her or died she does Chalitzah l'Chatchilah, and then she is permitted to others.
Aruch ha'Shulchan (21): Perhaps if she had children from the Kohen even the Rambam would not require Chalitzah, lest people say that the children are Pesulim.