Sefer Daniel - Perek 12 Resurrection - T'chiat HaMeitim Based on Rav Yaakov Medan
https://www.etzion.org.il/en/tanakh/ketuvim/sefer-daniel/daniel-14-resurrection-dead-1
https://www.etzion.org.il/en/tanakh/ketuvim/sefer-daniel/daniel-14-resurrection-dead-2
https://www.etzion.org.il/en/tanakh/ketuvim/sefer-daniel/daniel-14-resurrection-dead-3
The Resurrection is an endless subject. When will it happen? What is the connection between it and life in the World to Come and the eternal life of the soul?

(ב) וְרַבִּ֕ים מִיְּשֵׁנֵ֥י אַדְמַת־עָפָ֖ר יָקִ֑יצוּ אֵ֚לֶּה לְחַיֵּ֣י עוֹלָ֔ם וְאֵ֥לֶּה לַחֲרָפ֖וֹת לְדִרְא֥וֹן עוֹלָֽם׃(ג) וְהַ֨מַּשְׂכִּלִ֔ים יַזְהִ֖רוּ כְּזֹ֣הַר הָרָקִ֑יעַ וּמַצְדִּיקֵי֙ הָֽרַבִּ֔ים כַּכּוֹכָבִ֖ים לְעוֹלָ֥ם וָעֶֽד׃ {פ}

(2) Many of those that sleep in the dust of the earth will awake, some to eternal life, others to reproaches, to everlasting abhorrence.(3) And the knowledgeable will be radiant like the bright expanse of sky, and those who lead the many to righteousness will be like the stars forever and ever.

(יג) וְאַתָּ֖ה לֵ֣ךְ לַקֵּ֑ץ וְתָנ֛וּחַ וְתַעֲמֹ֥ד לְגֹרָלְךָ֖ לְקֵ֥ץ הַיָּמִֽין׃

(13) But you, go on to the end; you shall rest, and arise to your destiny at the end of the days.

In the Torah, there are only allusions to the concept to T'chiat HaMeitim, for example:

(אמר ר' יוחנן) מניין לתחיית המתים מן התורה שנאמר (במדבר יח, כח) ונתתם ממנו [את] תרומת יהוה לאהרן הכהן וכי אהרן לעולם קיים והלא לא נכנס לארץ ישראל שנותנין לו תרומה אלא מלמד שעתיד לחיות וישראל נותנין לו תרומה מכאן לתחיית המתים מן התורה

§ Rabbi Yoḥanan says: From where is the resurrection of the dead derived from the Torah? It is derived from this verse, as it is stated with regard to teruma of the tithe: “And you shall give the teruma of the Lord to Aaron the priest” (Numbers 18:28). And does Aaron exist forever so that one can fulfill the mitzva by giving him the teruma of the tithe? But is it not so that Aaron did not enter Eretz Yisrael, the only place where the people would give him teruma? Rather, the verse teaches that Aaron is destined to live in the future and the Jewish people will give him teruma. From here it is derived that the resurrection of the dead is from the Torah.

(טז) וַיֹּ֤אמֶר יהוה אֶל־מֹשֶׁ֔ה הִנְּךָ֥ שֹׁכֵ֖ב עִם־אֲבֹתֶ֑יךָ וְקָם֩ הָעָ֨ם הַזֶּ֜ה וְזָנָ֣ה ׀ אַחֲרֵ֣י ׀ אֱלֹהֵ֣י נֵכַר־הָאָ֗רֶץ אֲשֶׁ֨ר ה֤וּא בָא־שָׁ֙מָּה֙ בְּקִרְבּ֔וֹ וַעֲזָבַ֕נִי וְהֵפֵר֙ אֶת־בְּרִיתִ֔י אֲשֶׁ֥ר כָּרַ֖תִּי אִתּֽוֹ׃

(16) יהוה said to Moses: You are soon to lie with your ancestors. This people will thereupon go astray after the alien gods in their midst, in the land that they are about to enter; they will forsake Me and break My covenant that I made with them.

Nevi'im - 3 times people were brought back to life (all familiar to us): the son of the woman from Tzarfat, who was revived by Eliyahu (Melakhim 1:17); the son of the Shunamite woman, who was revived by Elisha (Melakhim II 4); and the man whose bones touched Elisha's grave (Melakhim II 13).
Another source for the concept of Resurrection is Yechezkel's vision of the dry bones. And, see Yishayahu:

(יט) יִֽחְי֣וּ מֵתֶ֔יךָ נְבֵלָתִ֖י יְקוּמ֑וּן הָקִ֨יצוּ וְרַנְּנ֜וּ שֹׁכְנֵ֣י עָפָ֗ר כִּ֣י טַ֤ל אוֹרֹת֙ טַלֶּ֔ךָ וָאָ֖רֶץ רְפָאִ֥ים תַּפִּֽיל׃ {פ}

(19) Oh, let Your dead revive!
Let corpses arise!
Awake and shout for joy,
You who dwell in the dust!—
For Your dew is like the dew on fresh growth;
You make the land of the shades come to life.-e

On the face of it, it is difficult to bring clear proof from these sources, since even the vision in Yechezkel, which explicitly describes dry bones returning to life, was a prophetic vision in the view of the Rambam.The intention of the prophecy there unquestionably concerns the revival of the nation, with the bones representing the House of Israel returning from exile to its homeland. Seemingly, Yishayahu's prophecy expresses a similar idea.If this is so, then the only clear source that we have is Sefer Daniel.

(צד"ק ג"ם גש"ם ק"ם סימן): שאלו מינין את רבן גמליאל מניין שהקדוש ברוך הוא מחיה מתים אמר להם מן התורה ומן הנביאים ומן הכתובים ולא קיבלו ממנומן התורה דכתיב (דברים לא, טז) ויאמר יהוה אל משה הנך שוכב עם אבותיך וקם אמרו לו ודילמא וקם העם הזה וזנהמן הנביאים דכתיב (ישעיהו כו, יט) יחיו מתיך נבלתי יקומון הקיצו ורננו שוכני עפר כי טל אורות טלך וארץ רפאים תפיל ודילמא מתים שהחיה יחזקאלמן הכתובים דכתיב (שיר השירים ז, י) וחכך כיין הטוב הולך לדודי למישרים דובב שפתי ישנים ודילמא רחושי מרחשן שפוותיה בעלמא כר' יוחנן דאמר ר' יוחנן משום ר"ש בן יהוצדק כל מי שנאמרה הלכה בשמו בעולם הזה שפתותיו דובבות בקבר שנאמר דובב שפתי ישניםעד שאמר להם מקרא זה (דברים יא, כא) אשר נשבע יהוה לאבותיכם לתת להם לכם לא נאמר אלא להם מיכן לתחיית המתים מן התורהוי"א מן המקרא הזה אמר להם (דברים ד, ד) ואתם הדבקים ביהוה אלהיכם חיים כלכם היום (פשיטא דחיים כולכם היום אלא אפילו ביום שכל העולם כולם מתים אתם חיים) מה היום כולכם קיימין אף לעוה"ב כולכם קיימיןשאלו רומיים את רבי יהושע בן חנניה מניין שהקב"ה מחיה מתים ויודע מה שעתיד להיות אמר להו תרווייהו מן המקרא הזה שנאמר (דברים לא, טז) ויאמר יהוה אל משה הנך שוכב עם אבותיך וקם העם הזה וזנהודילמא וקם העם הזה וזנה אמר להו נקוטו מיהא פלגא בידייכו דיודע מה שעתיד להיות איתמר נמי א"ר יוחנן משום רבי שמעון בן יוחאי מניין שהקדוש ברוך הוא מחיה מתים ויודע מה שעתיד להיות שנאמר הנך שוכב עם אבותיך וקם וגו'תניא א"ר אליעזר בר' יוסי בדבר זה זייפתי ספרי מינים שהיו אומרים אין תחיית המתים מן התורה אמרתי להן זייפתם תורתכם ולא העליתם בידכם כלום שאתם אומרים אין תחיית המתים מן התורה הרי הוא אומר (במדבר טו, לא) הכרת תכרת הנפש ההיא עונה בה הכרת תכרת בעולם הזה עונה בה לאימת לאו לעולם הבא

The Gemara records a mnemonic for those cited in the upcoming discussion: Tzadi, dalet, kuf; gimmel, mem; gimmel, shin, mem; kuf, mem.Heretics asked Rabban Gamliel: From where is it derived that the Holy One, Blessed be He, revives the dead? Rabban Gamliel said to them that this matter can be proven from the Torah, from the Prophets, and from Writings, but they did not accept the proofs from him.The proof from the Torah is as it is written: “And the Lord said to Moses, behold, you shall lie with your fathers and arise”(Deuteronomy 31:16). The heretics said to him: But perhaps the verse should be divided in a different manner, and it should be read: “Behold, you shall lie with your fathers, and this people will arise and stray after the foreign gods of the land.”The proof from the Prophets is as it is written: “Your dead shall live, my corpse shall arise. Awake and sing, you that dwell in the dust, for your dew is as the dew of vegetation, and the land shall cast out the dead” (Isaiah 26:19). The heretics said to him: But perhaps the prophecy was fulfilled with the dead that Ezekiel revived. No proof may be cited from that verse with regard to any future resurrection.The proof from Writings is as it is written: “And your palate is like the best wine that glides down smoothly for my beloved, moving gently the lips of those that sleep” (Song of Songs 7:10), indicating that the dead will ultimately rise and speak. The heretics said to him: But perhaps merely their lips will move, in accordance with the opinion of Rabbi Yoḥanan, as Rabbi Yoḥanan says in the name of Rabbi Shimon ben Yehotzadak: Anyone in whose name a halakha is stated in this world, his lips move in the grave as if repeating the statement cited in his name, as it is stated: “Moving gently the lips of those that sleep.” No proof may be cited from that verse, as it is unrelated to resurrection.This exchange continued until Rabban Gamliel stated to them this verse: “That your days may be multiplied, and the days of your children, upon the land that the Lord took an oath to your forefathers to give them” (Deuteronomy 11:21). The phrase: To give you, is not stated; rather, it is stated: “To give them,” to the Patriarchs themselves, as in the future the Patriarchs will come to life and inherit the land. From here resurrection of the dead is derived from the Torah.And there are those who say that it is from this following verse that he said to them his ultimate proof: “But you who cleave to the Lord your God every one of you is alive this day” (Deuteronomy 4:4). Wasn’t it obvious with regard to the children of Israel whom God was addressing, that “every one of you is alive this day”? Rather, the meaning of the verse is: Even on the day when everyone is dead you will live; just as today every one of you is alive, so too, in the World-to-Come every one of you will be alive.The Romans asked Rabbi Yehoshua ben Ḥananya: From where is it derived that the Holy One, Blessed be He, revives the dead, and from where is it derived that He knows what is destined to be? Rabbi Yehoshua ben Ḥananya said to them: Both of those matters are derived from this verse, as it is stated: “And the Lord said to Moses, Behold, you shall lie with your fathers and arise; this people will go astray” (Deuteronomy 31:16). This indicates that Moses will die and then arise from the dead and that the Holy One, Blessed be He, knows what the children of Israel are destined to do.The Romans asked: But perhaps the verse should be divided in a different manner, and it should be read: “Behold, you shall lie with your fathers and this people will arise and go astray after the foreign gods of the land.” Rabbi Yehoshua ben Ḥananya said to them: Take at least a response to half of your question in your hands from that verse, that God knows what is destined to be. The Gemara comments: It was also stated on a similar note by an amora citing a tanna, as Rabbi Yoḥanan says in the name of Rabbi Shimon ben Yoḥai: From where is it derived that the Holy One, Blessed be He, revives the dead, and from where is it derived that He knows what is destined to be? It is derived from a verse, as it is stated: “Behold, you shall lie with your fathers and arise.”It is taught in a baraita that Rabbi Eliezer, son of Rabbi Yosei, says: With this following matter, I refuted the books of the Samaritans, as they would say that there is no source for the resurrection of the dead from the Torah. I said to them: You falsified your torah and you accomplished nothing, as you say there is no source for the resurrection of the dead from the Torah, and the Torah states: “That soul shall be excised; his iniquity shall be upon him” (Numbers 15:31). You interpret the phrase “that soul shall be excised” to mean that a sinner will be punished with death in this world. If so, with regard to the phrase “his iniquity shall be upon him,” for when is that destined to be? Is it not for the World-to-Come, i.e., the world as it will exist after the resurrection of the dead? Apparently, there is a World-to-Come and there is an allusion to it in the Torah.

But, the idea of Resurrection must have been well accepted - Rav Medan: "The metaphor of the dry bones and the message that it conveys in Sefer Yechezkel suggest that it is easier for the listener to understand and assimilate the resurrection of dead people than it is to understand and assimilate the resurrection of the nation and its return to its land. Hence we deduce that not only did the prophet himself have faith in the Resurrection, but also that this concept was a simpler matter for the people to grasp than a return to the land from the exile where they had been scattered. Still, we are left with the question of the origin of the idea: how was this idea of the Resurrection – of dry bones emerging from their graves and once again being covered with flesh and filled with vitality – so simple and obvious and well-known?"
If the Resurrection is only alluded to in the Torah, then the idea must be from Torah She'baal peh. Perhaps this is what Chazal mean in their teaching that "The words of the Sages are more beloved than the words of Torah" (YerushalmiBerakhot 1:4 and elsewhere).
Rav Medan's idea for why Resurrection is only alluded to in Tanach: Over and over again, the Torah rules out bloodshed (especially for human sacrifice) If the Resurrection was spelled out in the Torah, this might be interpreted as offering leniency towards the crime of killing. In revealing the future Resurrection, the Torah would be stating explicitly that death is temporary; it is not an injustice that can never be repaired, for after all, the victim is ultimately going to be resurrected.
It may be for the same reason that the Torah conceals the reality of life in the World to Come, thereby leaving us with the unequivocal position that murder is murder and that the blood of the victims will not be atoned for. There is no justification after the fact or leniency towards the crime of killing another person just because of the existence of the World to Come and the Resurrection.
It is perhaps for this reason that Daniel is the first to speak openly and explicitly of the Resurrection. The death that hovers over Daniel and his three companions, the death that he speaks about during the period of the war waged by the Greeks and the Hellenists against the covenant and commandments of the Torah, is the death of those who defend the covenant; it is a death for the sanctification of God's Name. This death must be a temporary death, for God will never abandon His followers, those who forge His covenant through sacrificing their own lives.
[This would seem to be the meaning of the "Kaddish," in which we sanctify God's Name specifically in the face of death, at the grave. The essence of the Kaddish is the declaration, "May His great Name be blessed forever and for everlasting eternity." When someone has just died, at the meeting point between this world and the next, we declare our faith that God's Name is blessed not only in our world, but also in the other worlds, to which the deceased is now moving – worlds which exist forever, and also in the world of the Resurrection.]
It may also be that the Resurrection is not stated in the Torah but rather handed down from generation to generation as an oral tradition because of the almost infinite distance separating that reality from that of our present lives. To explain this further: Rashi and the Rambam are divided as to when the Resurrection will take place. According to Rashi, it will happen at the time of the coming of the Mashiach, may it be soon in our days.
However, according to the Rambam, the coming of Mashiach will not herald any change in the natural order of the world. The Resurrection, to his view, is a separate event, and we cannot know when and how it will come about.
In the formulation of the Principles of Faith based on the Rambam, the statement of our faith in the Resurrection is worded differently from the statement of our faith in the coming of Mashiach:
I believe with perfect faith in the coming of Mashiach. And though he tarries, I nevertheless await his coming every day.
When it comes to faith in Mashiach, we are required to anticipate salvation at every moment. This may also entail active anticipation, requiring that a person actually make preparations every day.
When it comes to the Resurrection, however, the immediacy is absent:
I believe with perfect faith that there will be a Resurrection, at the time that it is willed by the Creator, blessed be His Name, and His mention shall be exalted forever and for all eternity.
This principle says nothing about daily anticipation of the Resurrection; rather, it speaks of faith that it will happen at a time that God chooses. We are not required to prepare ourselves for this event, only to believe that it will come about. It would seem that we must believe that Mashiach could arrive today, and if his arrival is postponed, it is because we have not yet merited it through our actions; we must therefore examine our ways and return to God. The time of the Resurrection, on the other hand, does not appear to be connected to our actions.

וְלִירוּשָׁלַֽיִם עִירְ֒ךָ בְּרַחֲמִים תָּשׁוּב וְתִשְׁכּוֹן בְּתוֹכָהּ כַּאֲשֶׁר דִּבַּֽרְתָּ וּבְנֵה אוֹתָהּ בְּקָרוֹב בְּיָמֵֽינוּ בִּנְיַן עוֹלָם וְכִסֵּא דָוִד מְהֵרָה לְתוֹכָהּ תָּכִין: בָּרוּךְ אַתָּה יהוה בּוֹנֵה יְרוּשָׁלָֽיִם:

And return in mercy to Jerusalem, Your city, and dwell therein as You have spoken; and rebuild it soon, in our days, as an everlasting structure, and may You speedily establish the throne of David therein. Blessed are You, Adonoy, Builder of Jerusalem.

אַתָּה גִבּוֹר לְעוֹלָם אדני מְחַיֶּה מֵתִים אַתָּה רַב לְהוֹשִֽׁיעַ:

You are mighty forever, my Master; You are the Resurrector of the dead the Powerful One to deliver us.

Boneh Yerushalaim, with its emphasis on the word "soon," is located among the middle blessings of the Amida – the supplications.
The blessing for the Resurrection, in contrast, is located in the opening section of the Amida – the offering of praise. The Resurrection is not something that we request; rather, we declare that God is destined, in His might, to bring the dead to life.
Central question: if the Resurrection is not mentioned explicitly anywhere in the Torah, and if it has no significance in terms of our everyday actions, since they have no effect on its occurrence or timing, then why is faith in the Resurrection so important – to the point that the Rambam writes that "there is no [Jewish] faith, nor any connection with the Jewish people, for someone who does not believe in it"?

(א) כָּל יִשְׂרָאֵל יֵשׁ לָהֶם חֵלֶק לָעוֹלָם הַבָּא, שֶׁנֶּאֱמַר (ישעיה ס) וְעַמֵּךְ כֻּלָּם צַדִּיקִים לְעוֹלָם יִירְשׁוּ אָרֶץ נֵצֶר מַטָּעַי מַעֲשֵׂה יָדַי לְהִתְפָּאֵר. וְאֵלּוּ שֶׁאֵין לָהֶם חֵלֶק לָעוֹלָם הַבָּא, הָאוֹמֵר אֵין תְּחִיַּת הַמֵּתִים מִן הַתּוֹרָה, וְאֵין תּוֹרָה מִן הַשָּׁמָיִם, וְאֶפִּיקוֹרֶס. רַבִּי עֲקִיבָא אוֹמֵר, אַף הַקּוֹרֵא בַסְּפָרִים הַחִיצוֹנִים, וְהַלּוֹחֵשׁ עַל הַמַּכָּה וְאוֹמֵר (שמות טו) כָּל הַמַּחֲלָה אֲשֶׁר שַׂמְתִּי בְמִצְרַיִם לֹא אָשִׂים עָלֶיךָ כִּי אֲנִי יהוה רֹפְאֶךָ. אַבָּא שָׁאוּל אוֹמֵר, אַף הַהוֹגֶה אֶת הַשֵּׁם בְּאוֹתִיּוֹתָיו:

(1)All of the Jewish people, even sinners and those who are liable to be executed with a court-imposed death penalty, have a share in the World-to-Come, as it is stated: “And your people also shall be all righteous, they shall inherit the land forever; the branch of My planting, the work of My hands, for My name to be glorified” (Isaiah 60:21). And these are the exceptions, the people who have no share in the World-to-Come, even when they fulfilled many mitzvot: One who says: There is no resurrection of the dead derived from the Torah, and one who says: The Torah did not originate from Heaven, and an epikoros, who treats Torah scholars and the Torah that they teach with contempt. Rabbi Akiva says: Also included in the exceptions are one who reads external literature, and one who whispers invocations over a wound and says as an invocation for healing: “Every illness that I placed upon Egypt I will not place upon you, for I am the Lord, your Healer” (Exodus 15:26). By doing so, he shows contempt for the sanctity of the name of God and therefore has no share in the World-to-Come. Abba Shaul says: Also included in the exceptions is one who pronounces the ineffable name of God as it is written, with its letters.

Why is it not sufficient that we believe in the eternity of the soul in the World of the souls? Why is it so critical that we believe in the Resurrection of the dead and the connection between the soul and the body?
It is clear from the beginning of Sefer Bereishit that God created the world without any need for death. The original plan and purpose of the Garden of Eden was to allow eternal life in the shade of the Divine Presence.
In the early chapters of Bereishit there is a clear connection between death and sin: First, Adam was warned that on the day he ate of the fruit of the Tree of Knowledge he would die; he ate of its fruit and was expelled from the Garden so that he would not eat from the Tree of Life and live forever. Later, the sin of the generation of the Flood led not only to the destruction of the physical world, but also to a shortening of man's life by about a half.
Rav Medan:
A person who denies the Resurrection is saying, in effect, that the serpent and Satan have defeated God; they have irreparably distorted His plan. Evil has defeated goodness; goodness no longer reigns.
One who believes in the Resurrection, on the other hand, believes that the seeming victory of evil over God's plan in creating the world is merely temporary. God will eventually reveal His might and restore the world to what it was supposed to be before the serpent tempted Chava and Adam – a world of a Tree of Life that precedes, in every way, the Tree of Knowledge.
Who is going to be Resurrected?

וְאָמַר רַבִּי אֶלְעָזָר כׇּל אָדָם שֶׁיֵּשׁ בּוֹ גַּסּוּת הָרוּחַ אֵין עֲפָרוֹ נִנְעָר שֶׁנֶּאֱמַר הָקִיצוּ וְרַנְּנוּ שֹׁכְנֵי עָפָר שֹׁכְבֵי בֶּעָפָר לֹא נֶאֱמַר אֶלָּא שֹׁכְנֵי עָפָר מִי שֶׁנַּעֲשָׂה שָׁכֵן לֶעָפָר בְּחַיָּיו

And Rabbi Elazar also says: Concerning any person who has arrogance within him, his dust, i.e., his remains in his grave, will not stirat the time of the resurrection of the dead, as it is stated: “Awake and sing for joy, you who dwell in the dust (Isaiah 26:19). It is not stated: You who lie in the dust, which would indicate that all the dead will be awakened in the future, but rather: “You who dwell in the dust,” indicating that only one who became a neighbor to the dust in his lifetime by living with extreme humility will stir at the time of the resurrection.

But it is [only] for the righteous, and so [too] is [this found in] the language of Bereishit Rabbah, "The power of rain is for the righteous and for the evildoers, but the revival of the dead is only for the righteous." And how should the evildoers be revived - as they are dead even in their lifetime? And so [too] did they say (Berakhot 18b), "Evildoers are called dead even in their lives, righteous people are called living even in their death." And you should know that man, per force, must die and decompose and return to what he is composed of.

However, from a simple reading of the text in Daniel, it seems that everyone – including the wicked – will awaken for the great Day of Judgment; some will be given eternal life, while others will be sentenced to eternal shame and abhorrence - see 12:2.

תַּנְיָא, בֵּית שַׁמַּאי אוֹמְרִים: שָׁלֹשׁ כִּתּוֹת הֵן לְיוֹם הַדִּין: אַחַת שֶׁל צַדִּיקִים גְּמוּרִין, וְאַחַת שֶׁל רְשָׁעִים גְּמוּרִין, וְאַחַת שֶׁל בֵּינוֹנִיִּים. צַדִּיקִים גְּמוּרִין — נִכְתָּבִין וְנֶחְתָּמִין לְאַלְתַּר לְחַיֵּי עוֹלָם, רְשָׁעִים גְּמוּרִין — נִכְתָּבִין וְנֶחְתָּמִין לְאַלְתַּר לְגֵיהִנָּם, שֶׁנֶּאֱמַר: ״וְרַבִּים מִיְּשֵׁנֵי אַדְמַת עָפָר יָקִיצוּ אֵלֶּה לְחַיֵּי עוֹלָם וְאֵלֶּה לַחֲרָפוֹת לְדִרְאוֹן עוֹלָם״, בֵּינוֹנִיִּים — יוֹרְדִין לְגֵיהִנָּם,וּמְצַפְצְפִין וְעוֹלִין, שֶׁנֶּאֱמַר: ״וְהֵבֵאתִי אֶת הַשְּׁלִישִׁית בָּאֵשׁ וּצְרַפְתִּים כִּצְרוֹף אֶת הַכֶּסֶף וּבְחַנְתִּים כִּבְחוֹן אֶת הַזָּהָב הוּא יִקְרָא בִשְׁמִי וַאֲנִי אֶעֱנֶה אוֹתוֹ״, וַעֲלֵיהֶם אָמְרָה חַנָּה: ״ה׳ מֵמִית וּמְחַיֶּה מוֹרִיד שְׁאוֹל וַיָּעַל״.

It is taught in a baraita: Beit Shammai say: There will be three groups of people on the great Day of Judgment at the end of days: One of wholly righteous people, one of wholly wicked people, and one of middling people. Wholly righteous people will immediately be written and sealed for eternal life. Wholly wicked people will immediately be written and sealed for Gehenna, as it is stated: “And many of those who sleep in the dust of the earth shall wake, some to eternal life and some to shame and everlasting contempt” (Daniel 12:2). Middling people will descend to Gehenna to be cleansed and to achieve atonement for their sins,and they will cry out in their pain and eventually ascend from there, as it is stated: “And I will bring the third part through the fire, and will refine them as silver is refined, and will try them as gold is tried; they shall call on My name, and I will answer them” (Zechariah 13:9). This is referring to the members of the third group, who require refinement and cleansing. And about them, Hannah said: “The Lord kills, and gives life; he brings down to the grave, and brings up” (I Samuel 2:6).

This tells us that the Resurrection is not just the reward; it is itself the great Day of Judgment. Here the question arises: every person is judged for his actions immediately upon his death; what need is there, then, for the additional Day of Judgment that Daniel is talking about here?
Let us preface our answer with a few words about the judgment that comes when a person dies. The sources for this in Chazal are numerous. The best known among them is the mishna in Avot:
… And do not let your evil inclination assure you that the grave is your refuge, for it was against your will that you were created, against your will that you were born, against your will that you live, against your will that you will die, and against your will you will stand in judgment before the King of kings, the Holy One, blessed be He." (Avot 4:29).
What do theRishonim say about the question of who is included in the Resurrection. From their comments on the sugya in Massekhet RoshHa-shana and from the Ramban in Sha’ar Ha-gemul, it would appear that there are some wicked people who will be punished in Gehennom after death and this will be all the punishment that they need; they will then arise at the time of the Resurrection. The completely wicked, on the other hand, will be judged again on the great Day of Judgment, at the time of the Resurrection. For this purpose, they will arise momentarily, only to be sentenced to annihilation and to their eternal suffering; in Daniel’s words, “some to shame and everlasting contempt.”
Why is there a need for another day of judgment? When these people were judged upon their death, their entire life record was available, and it could already then be established whether their sins could be atoned for through a temporary stay in Gehennom or whether they were so wicked that they deserved “shame and everlasting contempt.” Moreover, what is the reason for these two different sentences – one temporary, the other eternal? And why is there no intermediate sentence, lasting longer than the temporary wait until the Resurrection, but shorter than eternity? Can a person really commit such terrible sins during his short years in this world that the appropriate punishment for him is eternal suffering? Justice would seem to suggest that eternal suffering can only be for infinite evil. Is such a concept possible in our world? Finally, if there are people who will never merit resurrection, since the Resurrection is a special kindness bestowed by God, then those who are not worthy will not merit it. But if the Resurrection is a Day of Judgment for all, and the most wicked are sentenced then to eternal suffering, what is the nature of this justice?
Concerning the last question we might answer, in accordance with the Rambam’s understanding of the punishment of “karet,” that the fate of the wicked in the World to Come is their absolute severance and annihilation, like animals. In other words, the suffering to which they are sentenced is limited in time, but they do not merit the kindness bestowed by God on the righteous – the granting of eternal life in the World to Come:

(א) הַטוֹבָה הַצְּפוּנָה לַצַּדִּיקִים הִיא חַיֵּי הָעוֹלָם הַבָּא וְהִיא הַחַיִּים שֶׁאֵין מָוֶת עִמָּהֶן וְהַטּוֹבָה שֶׁאֵין עִמָּהּ רָעָה. הוּא שֶׁכָּתוּב בַּתּוֹרָה (דברים כב ז) "לְמַעַן יִיטַב לָךְ וְהַאֲרַכְתָּ יָמִים". מִפִּי הַשְּׁמוּעָה לָמְדוּ לְמַעַן יִיטַב לָךְ לְעוֹלָם שֶׁכֻּלּוֹ טוֹב וְהַאֲרַכְתָּ יָמִים לְעוֹלָם שֶׁכֻּלּוֹ אָרֹךְ. וְזֶה הוּא הָעוֹלָם הַבָּא. שְׂכַר הַצַּדִּיקִים הוּא שֶׁיִּזְכּוּ לְנֹעַם זֶה וְיִהְיוּ בְּטוֹבָה זוֹ. וּפִרְעוֹן הָרְשָׁעִים הוּא שֶׁלֹּא יִזְכּוּ לְחַיִּים אֵלּוּ אֶלָּא יִכָּרְתוּ וְיָמוּתוּ. וְכָל מִי שֶׁאֵינוֹ זוֹכֶה לְחַיִּים אֵלּוּ הוּא הַמֵּת שֶׁאֵינוֹ חַי לָעוֹלָם אֶלָּא נִכְרַת בְּרִשְׁעוֹ וְאָבֵד כִּבְהֵמָה. וְזֶהוּ כָּרֵת הַכְּתוּבָה בַּתּוֹרָה שֶׁנֶּאֱמַר (במדבר טו לא) "הִכָּרֵת תִּכָּרֵת הַנֶּפֶשׁ הַהִיא". מִפִּי הַשְּׁמוּעָה לָמְדוּ הִכָּרֵת בָּעוֹלָם הַזֶּה תִּכָּרֵת לָעוֹלָם הַבָּא. כְּלוֹמַר שֶׁאוֹתָהּ הַנֶּפֶשׁ שֶׁפֵּרְשָׁה מִן הַגּוּף בָּעוֹלָם הַזֶּה אֵינָהּ זוֹכָה לְחַיֵּי הָעוֹלָם הַבָּא אֶלָּא גַּם מִן הָעוֹלָם הַבָּא נִכְרֶתֶת:

(1) The good that is hidden for the righteous is the life of the world to come. This will be life which is not accompanied by death and good which is not accompanied by evil. The Torah alludes to this in [the promise, Deuteronomy 22:7]: "So that good will be granted you and you will live long."
The oral tradition explains: "So that good will be granted you" - in the world that is entirely good; "and you will live long" - in the world which is endlessly long, the world to come.
The reward of the righteous is that they will merit this pleasure and take part in this good. The retribution of the wicked is that they will not merit this life. Rather, they will be cut off and die.
Whoever does not merit this life is [truly] dead and will not live forever. Rather, he will be cut off in his wickedness and perish as a beast. This is the intent of the meaning of the term karet in the Torah as [Numbers 15:31] states: "That soul shall surely be cut off."
[Based on the repetition of the verb,] the oral tradition explains: hikaret means to be cut off in this world and tikaret, to be cut off in the world to come. After these souls become separated from bodies in this world, they will not merit the life of the world to come. Rather, even in the world to come, they will be cut off.

However, Ramban, at the end of his Sha'ar ha-Gemul, disagrees. He understands the punishment of the wicked to be their eternal suffering – implying that this is the result of their actions in this world. It seems that while the Rambam views the function of the suffering as cleansing a person of his sins, according to Ramban, there is also the matter of revenge against the sinner – for eternal suffering can have no other purpose. In any event, our question on Ramban remains, since justice would appear to attach eternal sufering only to an infinitely grave sin, and where could one find such wickedness in our world?
Let's look at Rambam's understanding of the purpose of the Resurrection.
The Rambam maintains throughout – in his HilkhotTeshuva, in the introduction to Perek Chelek, and elsewhere – that the ultimate reward is the World to Come, which is for souls and not for bodies, which will ultimately be consumed:
In the World to Come, there are no bodies or corporeality, but only the souls of the righteous, devoid of any body, like the ministering angels. Since there is no corporeality, there is no eating there, nor drinking, nor any of the things that human bodies need in this world. (HilkhotTeshuva 8:2)
Ra'avad (ad loc) and Ramban (end of Sha'ar Ha-Gemul) disagree. They view the purpose of the world after the Resurrection as entailing a joining of the body with the soul, a joining of the upper and lower worlds. To their view, the World to Come referred to by Chazal is the world of the Resurrection of the dead, souls that arise within bodies.
It seems that according to the Rambam, a person passes through four stations in his life: there is this world; followed by the world of reward or punishment for the soul (in the Garden of Eden or in Gehennom); the Resurrection; and the World to Come, which is the world of souls. It is not clear from the Rambam what need there is for the Resurrection and for the return of the soul to the body, whether in the world of reward, which comes after death, or in the World to Come, which is the ultimate destiny – since in both these stages the soul exists without the body.
Our two main questions are therefore as follows:
1) What is the reason for the Day of Judgment in addition to the judgment that comes after death? The record of a person's life does not change after his death, so why is he judged on the great Day of Judgment at the time of the Resurrection for the same actions that he was already judged for upon his death?
2) According to the Rambam, who maintains that the Resurrection is a reward for the righteous rather than a Day of Judgment, what need is there for it? A person has already passed on to the world of the souls after his death, and the essence of the World to Come is a spiritual existence that involves no physical body. What, then, is the purpose of the "half-way station" of the Resurrection, in which the soul returns to the body?
In order to answer these questions, we shall make an assumption for which we have no clear proof and then go on to provide support for it. Our assumption is that upon death and the separation of the soul from the body at the end of a person's life in this world, free choice is not at an end. It continues to accompany a person and his soul in the next worlds. According to the Ramban and those who follow his view, free choice may exist also in the world of souls, in the Garden of Eden and in Gehennom. However, the fundamental difference between this world and the Garden of Eden means that the free choice there must be different from the free choice that exists in our world.
We might explain this in accordance with the Rambam's view of the choice made by Adam when he sinned and was expelled from the Garden of Eden, as a transition from choosing between truth and falsity to a choice between good and evil. The significance of the difference between the two choices is discussed by the Acharonim, and the crux of their interpretations is that in a choice between truth and falsehood, the subject is completely aware of the significance of his choice and the meaning of his rebellion against God when he chooses to defy His will. He is fully conscious of the weight of the sin that he performs, as opposed to avoiding it, and as opposed to the performance of a mitzvah which he could have done instead. In a choice between good and evil, on the other hand, a person’s inclination is encumbered with numerous justifications and reasons for permitting an act, as well as the weight of his own desire and the weight of his own inertia, forgetfulness of God, and intellectual and emotional fuzziness in understanding the severity of his rebellion and his sin, along with the hope that he might easily be able to repair the damage or hide his misdeed, etc. The attempt by Adam and his wife to hide from God after their sin, to offer excuses, and to blame others for the sin when questioned about it is the model of the transition from one type of choice to the other. When the “serpent came to Chava,” the evil inclination – which, until now, had been something external to them – now entered into man and became part of him.However, even at the outset, man was forced to choose and to grapple; the very fact of his failure in this test represents proof of its difficulty.
[Stated differently, the choice inside the Garden of Eden, the choice between “truth and falsehood,” is a choice between the “enjoyment” of the very fact of rebelling against God’s command, the “challenge” of freeing oneself of His yoke and of subservience to Him, versus the enjoyment of taking refuge under His wings and cleaving to Him, the challenge of accepting His path. The results of each option are completely clear to the subject. In contrast, the free choice that exists outside of the Garden of Eden – the choice between “good and evil” – is a choice between being drawn after limitless dispensations, the power of one’s desires and of one’s inertia, versus that which is good as judged by one’s pure intellect and conscience and the ability to control all of the above powers.]
The lesser choice –between good and evil, the choice that exists outside of the Garden of Eden – usually also includes the consideration of the reward that God will give to whoever chooses good (the reward for those commandments in this world, as specified in the Torah, and awarded mainly on the national level when the nation chooses observance of the mitzvot) and the punishment for rebelling against Him. Considerations also include the good that awaits one in the Garden of Eden – especially of the sort set forth in the “Akdamut” for Shavuot, with its depiction of the wild ox, the leviathan, and the old wine for the righteous – as well as the punishment of Gehennom. The choice between truth and falsity entails the concept of proximity to God by virtue of observance of the commandments and distance from Him as a result of not observing them.
The choice between good and evil explains only the reward of the Garden of Eden for those who choose good and the punishment of Gehennom for those who choose evil. These are limited reward and punishment for limited choice. The choice between truth and falsity, on the other hand, justifies the unlimited reward of eternal life for those who follow the path of truth and the punishment of absolute karet for those who follow the path of falsity.
At the time of his sin, man is sentenced to death; it is only after death that he returns to the Garden of Eden. It is possible, then, that he returns there also to the mode of choice that existed prior to the sin – to the clear choice between truth and falsity. At the same time, this choice is what also faces those who are condemned to Gehennom. There, too, the choice is between truth and falsity. This is the real choice, the clear choice, the big choice. This choice justifies infinite reward and punishment – the sort of reward and punishment that become manifest on the great Day of Judgment that precedes the Resurrection.
This view may shed light on the simple meaning of Chazal’s teaching:
R. Chiya bar Ashi said in the name of Rav: Learned scholars have no rest, neither in this world nor in the World to Come, as it is written: “They shall go from strength to strength, each appearing before God in Tzion” (Tehillim 84:8). (Berakhot 64a)
This “lack of rest” may express the inner struggle of free choice. A person at rest is one who is led and drawn and dragged; he is not forced to exercise his own will. He walks about in the Garden of Eden like a guest at a hotel; he studies Torah and enjoys the splendor of the Divine Presence without the need to exercise the power of decision that comes of free choice between good and evil. Learned Torah scholars, who have no rest even in the World to Come and who progress there “from strength to strength,” may have free choice in the Garden of Eden as well.
This may also explain what the gemara means in teaching that an evil person accepts God's verdict for him after the day of judgment upon his death:
Moreover, he accepts the judgment and says to them: You have judged me well, fulfilling that which is written, “Such that You are justified in Your verdict” (Tehillim 51:6). (Ta'anit 11a)
In light of our discussion above, he has the option of denying the justice of his sentence. We find that Datan and Aviram accepted their sentence out of their free will, when they declared in Gehennom,
"Moshe and his Torah are true, while we were liars." (Bava Batra 74a)
It is only when a person has exhausted the process of choosing there between truth and falsity and has knowingly chosen his path in either direction, without endless small, local slips and stumbles owing to the small desires that are so common in our world – it is only then that he can present himself for the great Day of Judgment at the time of the Resurrection. There his fate is sealed for eternal life or for shame and eternal contempt.
However, according to the Rambam's view, it would seem that there can be no free choice in the world of the souls, either in the Garden of Eden or in Gehennom. He maintains that what obstructs a person from seeing the complete truth and following it is the body, one's physical existence; without it, we cannot speak of a choice to perform evil. Perhaps this is the role of the Resurrection; it therefore must occur in order to restore a person's body to him with his free choice on its true level, the level of choosing between truth and falsity, as Adam experienced it until it was removed from him at the time of his sin. Only after this is his verdict finally sealed for life in the World to Come or to be cut off, like an animal, from eternal life.
Still, we must ask: According to the Rambam, only the righteous will merit to rise at the time of the Resurrection, as he argues in his introduction to the tenth chapter of Massekhet Sanhedrin (Perek Chelek). If so, we return to our original question: what need is there for a physical Resurrection, if the reward for the righteous is in the World to Come, which is a world of souls? Moreover, how would the Rambam understand the verses in Daniel and the gemara in Rosh Ha-Shana, which teach that the wicked, too, arise at the time of the Resurrection, “for shame and for eternal contempt”? Perhaps, according to the Rambam, it is only the completely wicked who will not be resurrected and who will have no further opportunity in the world of choosing between truth and falsity that comes after the Resurrection, because they failed in that choice already in this world.
It would seem that we might prove our view above concerning the two levels of choice from another topic that is related to life in the World to Come: the punishment of karet.
The gemara in Sanhedrin 64b (and elsewhere) teaches that karet is actually a double punishment; it is severance from this world as well as severance from the World to Come:
"Hikaret tikaret” [“the soul shall surely be cut off”]: “hikaret” – in this world; “tikaret” – from the World to Come; this is the view of R. Akiva. R. Yishmael said to him: But was it not previously written, “ve-nikhreta” (“it shall be cut off”)? Are there then three worlds?! [Surely not;] rather, “nikhreta” – from this world; “hikaret” – from the World to Come; “tikaret” – the Torah speaks in human language.
Karet itself is annihilation, as we learn from the punishment meted out to a person who performs labor on Yom Kippur.Being “cut off” in this world includes the annihilation of one's offspring, as we learn fromRashi on Bereishit 17:14, Vayikra 17:9, and elsewhere, and as is largely apparent from the definition of karet in Vayikra 20:5, 20. In theTosafot on Shabbat 25a, the Riba (R. Yitzchak ben Asher ha-Levi) and Rabbenu Tam are divided as to whether his offspring are cut off with a karet that includes no explicit punishment of childlessness.
The Rambam, both in his Hilkhot Teshuva (8:1, 5), and in his introduction to Perek Chelek, speaks at length about the non-existence of the souls of the wicked in the World to Come. According to his plain meaning, as discussed above, a wicked person is cut off, like an animal, from the eternal life of the soul in the World to Come. Ramban, in Sha'ar Ha-Gemul, adds the suffering and positive punishment for his sins. Ramban (Sha'ar Ha-Gemul and Vayikra 18:29) and many others who adopt his view discuss the question of when karet applies only to this world, and when it applies (also) to the World to Come. Ramban, based on a precise reading of the verses, draws a distinction between the punishment of karet formulated with the words, “ve-nikhrat me-amav” ("he shall be cut off from his people"), meaning this world, and karet formulated with the words, “ve-nikhreta ha-nefesh ha-hi milfanai” ("that soul shall be cut off from before Me"), where the verse is referring (also) to the World to Come. The Rambam, on the other hand, does not specify which karet applies only to this world and which includes also the World to Come.
Were it not for the Ramban's teaching, one might have concluded that karet means annihilation from this world, except for one instance in which Chazal, in the above gemara in Sanhedrin, applied it also to the World to Come:
But a person who acts arrogantly – whether native born or a stranger – he dishonors God, and that soul shall be cut off (ve-nikhreta) from among his people. For he has despised the word of God and has violated His command; that soul shall surely be cut off (hikaret tikaret), his sin shall be upon him. (Bamidbar 15:30-31)
According to the plain meaning, the verses are talking about a person who acts arrogantly – in other words, he sins deliberately, or contemptuously, rather than simply out of capitulation to his desires. Perhaps this is the reason for his being cut off from the World to Come. However, for any other person who sins knowingly, ceding to his desires, the punishment may be only karet in this world – a shortening of his life and/or the death of his children. It may also be that there are certain prohibitions which are treated, owing to what they entail, as belonging to the category of sinning out of contempt. It would seem that one who sins contemptuously or deliberately to anger God does so out of a choice that is very close to the level of the distinction between truth and falsity. This is the law that applies to a heretic ("min"), which the gemara(Horayot 11a) identifies as a person who converts out of defiance. Perhaps it is only these who are sentenced to complete karet from eternal life. A person who converts out of weakness, on the other hand, and who is on the level of choosing between good and evil, is punished for his sins in Gehennom, and once he acknowledges his sins and accepts his verdict with an acceptance of the yoke of Heaven and with his choice there, he is deserving of having his soul remain illuminated with life.