(Gen. 38:1:) "Now it came to pass at that time that Judah went down from his brothers, etc." Let our master teach us: If a collapse of rubble fell on the Sabbath, and it is not known whether an Israelite is there or not, what is the law concerning clearing it away from them on the Sabbath? Thus our Rabbis taught: One upon whom a collapse of rubble fell [on the Sabbath] — it is doubtful whether he is there or not there, doubtful whether he is alive or dead, doubtful whether he is a gentile or an Israelite — they clear away [the heap] from upon him. If they find him alive, they clear it away from upon him; and if he is dead, they leave him. It is written concerning the Sabbath, "Those who profane it shall surely be put to death" (Exod. 31:14), yet our Rabbis taught: they clear away from upon the living one on the Sabbath. Rabbi Eleazar ben Azariah said: If circumcision, which is only one of the two hundred and forty-eight limbs, overrides the Sabbath, then for two hundred and forty-eight limbs under the stone, is it not right that they should override the Sabbath for his sake? Rabbi Shimon ben Menasya says: Profane one Sabbath for him so that he may keep many Sabbaths. And if you clear away the heap from upon him to preserve a single soul, I too will do for you what is written, "Behold, I will open your graves" (Ezek. 37:12). A certain heretic asked our master: Is it possible that the dead live again? Your ancestors do not acknowledge it, yet you acknowledge it! What is written concerning Jacob? "And all his sons and all his daughters rose up to comfort him [but he refused to be comforted]." Had he known that the dead live again, would he have refused to be comforted, and would he have said, "For I will go down to my son mourning to Sheol"? Our master said to him: Fool of the world! Because Jacob our father knew through the Holy Spirit that Joseph was alive, therefore he did not accept comfort over him, for one does not accept comfort over the living.
Why Jacob Refused Comfort and the Law of Saving Life on Shabbat
Midrash Tanchuma Buber, Vayeshev 8:1
ויהי בעת ההיא וירד יהודה מאת אחיו וגו' (בראשית לח א). ילמדנו רבינו אם נפלה מפולת בשבת ואין ידוע אם יש שם ישראל אם לאו, מהו לפקח עליהן בשבת. כך שנו רבותינו מי שנפלה עליו מפולת [בשבת], ספק הוא שם ספק אינו שם, ספק חי ספק מת, ספק נכרי ספק ישראל, מפקחין עליו [את הגל], מצאוהו חי מפקחין עליו, ואם מת יניחוהו. כתיב בשבת מחלליה מות יומת (שמות לא יד), ושנו רבותינו פקחין על החי בשבת, אמר ר' אלעזר בן עזריה ומה המילה שאינה אלא אחת מרמ"ח אברים דוחה את השבת, רמ"ח אברים תחת האבן אינו דין שדוחין עליו את השבת, ר' שמעון בן מנסיא אומר חלל עליו שבת אחת כדי שישמור שבתות הרבה, ואם פקחתם עליו להחיות נפש אחת, אף אני אעשה לכם מה שכתוב הנה אנכי פותח את קברותיכם (יחזקאל לז יב). שאל מין אחד לרבינו אפשר שהמתים חיים, אבותיכם אינן מודים, ואתם מודם, מה כתיב ביעקב, ויקומו כל בניו וכל בנותיו לנחמו [וימאן להתנחם], אילו היה יודע שהמתים חיים היה ממאן להתנחם, והיה אומר כי ארד אל בני אבל שאולה, אמר לו רבינו שוטה שבעולם, מפני שהיה יעקב אבינו יודע ברוח הקדש שהיה יוסף חי, לפיכך לא קיבל עליו תנחומין, שאין מקבלין תנחומין על החי.