THE JUDGMENT OF ROSH HASHANAH [Rosh Hashanah: judgment]
Gemara
(Mishnah #1): Hash-m bestows good to anyone who does a Mitzvah, and lengthens his days. He will inherit the land. The opposite applies if he does not do the Mitzvah.
Contradiction (Mishnah #2): For the following Mitzvos, a person is rewarded with dividends in this world, and the principal remains for him in the world to come: honoring parents, bestowing Chesed... and Talmud Torah is equal to all of them.
Answer (Rav Yehudah): Mishnah #1 discusses one does one Mitzvah beyond his merits (so now they outweigh his sins). Hash-m bestows good to him, like one who onserved the entire Torah.
Inference: Regarding the Mitzvos listed in Mishnah #2, he gets these rewards for doing one Mitzvah alone!
Rejection (Rav Shemayah): No. The Mitzvos listed can tip the scales if a person's merits (with that Mitzvah) equal his sins.
Contradiction (Beraisa): Anyone whose merits outweigh his sins, Hash-m does evil to him. He will appear to be punished like one who burned the entire Torah without a remnant;
Anyone whose sins outweigh his merits, Hash-m will do good to him. He will appear to be rewarded like one who kept every letter of the Torah. (This is unlike Mishnah #1, which says that one is rewarded for Mitzvos.)
Answer #1 (Abaye): (Mishnah #1 teaches that) Hash-m prepares him for a good day or a bad day (in the world to come. If one's merits and sins were equal and he did a Mitzvah, he is punished here (in this world) for his sins so he will enjoy the world to come. If he did not do the Mitzvah, He is paid here for his Mitzvos, and will not enjoy the world to come.)
Answer #2 (Rava): The Beraisa is like R. Yakov, who says that reward for a Mitzvah cannot come in this world.
40b (R. Elazar b'Rebbi Shimon): The world is judged according to its majority, and also individuals. One who does one Mitzvah can make himself a Tzadik, and change the judgment of the world to merit! One who does one sin can make himself a Rasha, and make the world liable!
Rosh Hashanah 16a (Beraisa): Everyone is judged on Rosh Hashanah, and his verdict is sealed on Yom Kipur.
16b - R. Kruspedai: Three books are opened on Rosh Hashanah: of utter Resha'im, of utter Tzadikim, and Beinonim (intermediate people).
Utter Tzadikim are immediately written and sealed for life. Utter Resha'im are immediately written and sealed for death. Beinonim are suspended until Yom Kipur. If they merit they are written for life; if not, for death.
Rishonim
Rif and Rosh (Rosh Hashanah 3b and 1:5): Utter Tzadikim are immediately sealed for life. Utter Resha'im are immediately sealed for death. Beinonim are suspended until Yom Kipur. Similarly, a state is Tzadik or Rasha depending on the total merits and Aveiros of its residents. The same applies to the entire world.
Lechem Mishneh: If a state is judged to be a Rasha, it is destroyed but the Tzadikim are spared, like happened to Sedom. If it is judged to be a Tzadik, it is saved, and the Resha'im themselves are punished.
Rambam (Hilchos Teshuvah 3:1): If one's merits are greater than his Aveiros he is a Tzadik. If his Aveiros are greater he is a Rasha. If they are equal he is a Beinoni. Similarly, a state is Tzadik or Rasha depending on the total merits and Aveiros of its residents. The same applies to the entire world.
Rambam (2): If one's Aveiros are greater than his merits, he dies immediately in his evil - "Al Rov Avonecha".
Question #1: We see Tzadikim written for death, and Resha'im written for life!
Answer #1 (Kesef Mishneh): We cannot know who is a Tzadik or Rasha. The Rambam continues 'only Hash-m knows how to weigh Mitzvos and Aveiros.'
Answer #2 (Ra'avad): The Gemara does not mean that he dies immediately. Rather, it is immediately sealed that he will not live out his allotted years (see Yevamos 50a).
Answer #3 (Ran DH Tzadikim): R. Yeshayah and the Ramban say that we discuss Tzadikim and Resha'im in this judgment. Even if one is mostly Aveiros, perhaps he merits in this judgment because Hash-m is paying him for his deeds in this world (or vice-versa). However, 'three categories on the day of judgment' discusses all of the person's deeds.
Question #2: The Gemara says that Hash-m does evil to one whose merits outweigh his Aveiros, and good to one whose sins outweigh his merits!
Answer to both questions (Lechem Mishneh): Here the Rambam means that a Tzadik/Rasha is sealed for life/death in the world to come. Later the Rambam discusses the judgment on every Rosh Hashanah.
Rambam (ibid.): The same applies to a state or the entire world - "Za'akas Sedom va'Amorah Ki Rabah...", "Va'Yar Hash-m Ki Rabah Ra'as ha'Adam ba'Aretz". The weighing is not simply the number. Rather, it is according to their size. One merit can counter many Aveiros, and one Aveirah can counter many merits. Hash-m knows how to weigh them against each other.
Rambam (3): A Tzadik is sealed for life, and a Rasha for death. A Beinoni is suspended until Yom Kipur. If he did Teshuvah he is sealed for life. If not, he is sealed for death.
Poskim
Rema (OC 582:9): Our custom is that on Rosh Hashanah everyone says to his friend 'may you be written for a good year'.
Taz (4): The Levush says not to say this after the Tefilah during the day, for the inscription for Tzadikim is during the first three hours of the day, and it is improper to suggest that your friend is only a Beinoni. However, one should consider himself a Beinoni. This is why we say 'Kosveinu l'Chayim' until Yom Kipur. I say that since the primary judgment is sometimes on the second day, one may give this greeting also on the second night.
Magen Avraham (8): We say 'may you be written and sealed for a good year.' One may say it until midday, for the second quarter of the day Hash-m moves from the throne of Din to the throne of Mercy.
Gra (DH v'Nohagin): The Magen Avraham holds like the Ran, that the inscriptions in the three books are for this world. The Rema omits 'and sealed'. He holds like Tosfos (Rosh Hashanah 16 DH v'Nechtamin), that the inscriptions are for life in the world to come. Tosfos learns from the Beraisa (16a) that the verdict of everyone (even Tzadikim) is sealed on Yom Kipur.
Kaf ha'Chayim (63): The Gemara connotes that Tzadikim are sealed immediately. Even according to those who say that the judgment for this world is not sealed until Yom Kipur, one may ask mercy for others right away!