Shabbat 136 - How can we ever circumcise on Shabbat?

We learned before that one is allowed to perform circumcision on Shabbat, although he makes a wound - because circumcision has to be done in its proper time, on the eighth day, even it if falls on Shabbat. However, how could we really say so, if before thirty days it is still not certain that the child is a viable child!? Just look at the following ruling of Rabban Shimon ben Gamliel: any child that lives for thirty days is not suspected of being not viable, but before - it is, since redemption of a first born child applies only after thirty days, because then it is clear that the child is viable.

Rav Adda bar Ahavah said that the answer is clear, whichever way you look at it: if it is a viable child, the Torah told to circumcise it, and if it is not, then he is simply cutting (dead) meat, which is also permitted on Shabbat. However, the last fact is not universally accepted: a non-viable child is compared to non-viable animal fetus, about which there is a disagreement whether it is considered alive for slaughter.

The son of Rav Dimi had a child born to him. Unfortunately, this child died before he was thirty days old, and the rule is that in such a case mourning is not required, because perhaps the child was not viable. However, the son of Rav Dimi sat in mourning. The custom was to serve very tasty food to mourners, to lift up their spirits, and Rav Dimi asked his son, "Do you simply want to eat the tasty morsels that they serve to mourners?" However, Rav Dimi's son answered him, "I know through other means that this was a viable child."

Art: Umberto Boccioni - Mourning