ONE MUST EAT MATZAH AND THE AFIKOMAN BEFORE MIDNIGHT [Pesach: Matzah: time]
Gemara
(Mishnah): Pesach is eaten only... (until midnight).
(Rav Yosef): Our Mishnah is like R. Elazar ben Azaryah;
(Beraisa - R. Elazar ben Azaryah): It says that Pesach is eaten "ba'Laylah ha'Zeh", like it says about Makas Bechoros. Just like that was at midnight, also Pesach may be eaten until midnight.
R. Akiva: It says that Pesach is eaten "b'Chipazon" (in haste), i.e. until Yisrael were rushed out of Mitzrayim (in the morning)!
Question (Abaye): Perhaps our Mishnah is R. Akiva. Chachamim decreed not to eat it past midnight, lest one eat it after dawn (like they decreed about all Korbanos eaten until morning)!
Answer (Rav Yosef): The Mishnah says 'Ela (only) it is eaten only until midnight', just like it says about the other laws of Pesach, to teach that also this is mid'Oraisa.
Pesachim 96a (Mishnah): Pesach Mitzrayim was eaten hastily in one night.
119a (Mishnah): Afikoman (dessert) is forbidden after eating Korban Pesach.
Version #1 (Shmuel): (Nowadays, we eat Matzah at the end to commemorate the Pesach, which was eaten at the end, with Matzah (according to Hillel).) We may not eat after this Matzah.
Question (Mishnah): We may not have Afikoman after Pesach.
Inference: Afikoman is forbidden after Pesach, but it is permitted after Matzah.
Answer: No, the Mishnah teaches a bigger Chidush. Matzah's taste is not so strong, so we may not eat after it (lest the taste of Matzah not remain in our mouths). One might have thought that one may eat after Pesach, for its taste is strong, and it would remain in our mouths! The Mishnah teaches that this is not so.
Version #2 - Mar Zutra - (Shmuel): We may have Afikoman after Matzah.
Support (Mishnah): We may not have Afikoman after Pesach (but it is permitted after Matzah).
Rejection: No, the Mishnah teaches a bigger Chidush. Dessert is forbidden not only after Matzah, whose taste is not strong; rather, it is forbidden even after Pesach, whose taste is strong!
120b (Mishnah): Pesach is Metamei the hands after midnight.
(Rav Yosef): This is like R. Elazar ben Azaryah. (He holds that after midnight it is Nosar.)
(Rava): Nowadays, according to R. Elazar, if someone ate Matzah after midnight, he was not Yotzei.
Objection: This is obvious! Since Matzah is Hukash (equated) to Pesach, it is like Pesach!
Answer: One might have thought that the Torah uprooted it from the Hekesh (by commanding to eat Matzah even when there is no Pesach). Rava teaches that this is not so. The Mitzvah to eat Matzah nowadays is like when there is Pesach.
Berachos 2a (Mishnah): Any Korban that may be eaten for one day and a night is permitted until dawn.
9a (Rav Yosef): The Mishnah does not mention that (mid'Oraisa) the Korban Pesach may be eaten until dawn. It is like R. Elazar ben Azaryah.
Megilah 20b (Mishnah): Every nighttime Mitzvah is Kosher the entire night.
21a: This includes eating Korban Pesach. It is unlike R. Elazar ben Azaryah:
Rishonim
Rif and Rosh (Pesachim 27a and Rosh 10:34): Presumably, the Halachah follows Version #1, for it is the Stam Gemara, whereas Version #2 is the opinion of an individual. This is our custom.
Rambam (Hilchos Chametz 6:1): It is a Torah Mitzvah to eat Matzah on the night of the 15th. It does not depend on Korban Pesach. The Mitzvah is the entire night.
Rambam (8:9): Nowadays he eats a k'Zayis of Matzah at the end and he does not taste anything afterwards.
Rosh (38): Seemingly, the Halachah follows R. Elazar, for Stam Mishnayos in Pesachim, Zevachim and Berachos are like him. However, the Stam Mishnah in Megilah is like R. Akiva. Two or three Stam Mishnayos are no stronger than one. Also, the Mishnah in Megilah was taught with clearcut Halachah. However, one should be stringent like R. Elazar, for perhaps R. Akiva agrees that we make a fence to distance from an Isur mid'Oraisa. R. Tam would rush to eat the Afikoman before midnight.
Hagahos Maimoniyos (8:10): The Mechilta says that we eat Pesach until dawn. Chachamim made a fence, and said until midnight. This is unlike R. Elazar ben Azaryah. Also the Mishnah (Megilah 20b) says that it is only a fence, and Rava said 'according to R. Elazar, if one ate Matzah after midnight, he was not Yotzei.' This connotes we hold like R. Akiva, that he was Yotzei. Also, the Halachah follows R. Akiva against his colleague. R. Simchah brought a proof from the Tosefta, which says that Matzah is an obligation. We eat from dark, the entire night. The Mitzvah is to eat before midnight, to stay far from Aveirah. Also others hold like this. However, Sefer ha'Mitzvos rules like R. Elazar ben Azaryah. Three Stam Mishnayos are like R. Elazar ben Azaryah, in Zevachim, Pesachim (120b), and Berachos 2a. Also Avi ha'Ezri rules like R. Elazar ben Azaryah. R. Simchah says that the Gemara in Berachos does not say 'the Mishnah omitted Pesach.' Rather, it brings a Beraisa that says that Keri'as Shema and Pesach are until midnight. Rav Yosef answers that the Beraisa is like R. Elazar, and our Mishnah (which holds that we eat Pesach until dawn) is like R. Akiva. Two Stam Mishnayos are like R. Elazar, and two are like R. Akiva. The beginning of our Masechta connotes like R. Akiva. (Perhaps he refers to Pesachim 3a, which says 'we learn from Kodshim eaten for one day, which are burned right after they are forbidden to eat (at dawn)' - PF.) Re'em says that one should be concerned for R. Elazar's opinion, for the Mishnah in Zevachim is like him.
Ran (27b DH Garsinan): Yevamos 101b says that two or three Stam Mishnayos are no stronger than one, for we do not know which was taught last (i.e. Rebbi retracted and concluded like the Halachah. When Rebbi codified the Mishnayos, we do not know in which order he taught the different Masechtos.) Therefore, we are stringent like R. Elazar ben Azaryah. Tosfos is stringent to finish even Hallel before midnight. Others say that the Halachah follows R. Akiva. One should not be lenient about this.
Note: I do not know why the Ran (and other Meforshim) cite Yevamos 101b. It says that if we follow Stam Mishnayos against individuals, it does not matter if there is one, two or three Stam Mishnayos. A better proof is from Kidushin 54b, which says that when there is a contradiction in Stam Mishnayos, two Stam Mishnayos are no stronger than one! Even though there it does not mention three Stam Mishnayos, the same applies to three. (The reason two are no better than one is because we do not know which was taught last.)
Simchas Kohen (OC 141): Why do the Meforshim say that only one Stam Mishnah is like R. Akiva? Tosfos Yom Tov derives that also Mishnah 9:5 (96a) is like R. Akiva! Perhaps we do not count this, for the last Mishnah in Pesachim (120b) is Stam, like R. Elazar. This shows that Rebbi retracted from what he held when he codified Mishnah 9:5.
Note: Seemingly, it is better to say that Rebbi retracted only once and concluded like R. Elazar, than to say that he initially held like R. Akiva (when he taught Pesachim 9:5), retracted (before teaching the last Mishnah), and retracted again and concluded like R. Akiva (in Megilah)!
Tosfos (Pesachim 89a DH d'Ilu): Our Gemara calls Pesach a Korban eaten for a day and a night (even though one may eat it only at night). If so, why did Rav Yosef say that the Mishnah (Berachos 2a) is like R. Elazar ben Azaryah, for it omitted Pesach? That Mishnah says 'all Korbanos eaten for a day and a night...'! Since a Mishnah in Zevachim says that Pesach is eaten (mid'Oraisa) only until midnight, if the Tana in Berachos disagrees, he should have explicitly taught Pesach.
Tosfos (Zevachim 57b DH v'Ibo'is): If 'until midnight' were mid'Rabanan for Pesach, it would have been taught at the end, like the Mishnayos of Chatas, Asham... Rather, it is mid'Oraisa, like the other laws taught with it (it is eaten only at night, only Manuyim may eat it, and it is eaten only roasted).
Tosfos (Pesachim 120b DH Amar): Regarding Chatas and Todah it says 'they are eaten until midnight', i.e. l'Chatchilah, mid'Rabanan. Regarding Pesach it says 'only until midnight, i.e. even b'Di'eved, for this is mid'Oraisa.
Tosfos (Megilah 21a DH Le'atuyei): The Halachah follows R. Elazar. One must be careful to eat the Matzah before midnight, including the Afikoman, for Matzah is mid'Oraisa nowadays. One need not be so stringent to finish Hallel before midnight, for it is mid'Rabanan.
Poskim
Shulchan Aruch (OC 477:1): One must be careful to eat the Afikoman before midnight.
Beis Yosef (DH u'Le'acher): The Tur and Ran require eating Matzas Mitzvah before midnight. The Rambam (6:1) says that the Mitzvah is the entire night.
Gra (DH v'Yehei): Zevachim 57b shows that even R. Akiva holds that l'Chatchilah one must eat Afikoman before midnight.
Mishnah Berurah (6): One must eat the Afikoman before midnight, for it commemorates Korban Pesach, which was eaten before midnight. All the more so one must eat the first k'Zayis of Matzah on which we bless before midnight. If one delayed after midnight, perhaps he was not Yotzei. Therefore, after midnight he does not bless on it, nor on Maror, even though Maror is only mid'Rabanan nowadays.
Kaf ha'Chayim (10): Pischei Teshuvah was unsure if after midnight one may bless Ga'al Yisrael at the end of Magid, for the Magen Avraham says that it is only when Matzah, Maror and Pesach are in front of you, and perhaps these Mitzvos do not apply after midnight. One should bless without Hash-m's name.
Kaf ha'Chayim (12): If one did not eat Afikoman before midnight, he eats it after midnight, for perhaps he fulfills the Mitzvah.
Rema: One should (eat it) early, so he will also recite Hallel before midnight.
Mishnah Berurah (7): L'Chatchilah, one should finish also the Berachah at the end of Hallel before midnight.
Kaf ha'Chayim (14): Since one must say Hallel while eating Pesach, this is a commemoration of Pesach just like Afikoman, so also Hallel should be before midnight. Medrash Tehilim (113:1) connotes that it is better to say Hallel after midnight. (Yisrael sang after Makos Bechoros, when they ceased to be Avdei Paro and became "Avdei Hash-m.") The Zohar agrees. However, some are stringent l'Chatchilah (to say it before), so one should fulfill all opinions.
Bi'ur Halachah (DH v'Yehei): Some say that the Rif holds that the time for Matzah is the entire night, since he omitted Rava's teaching. However, many great Rishonim say that one is not Yotzei after midnight, others were unsure and said that one must be stringent, and others say that R. Akiva agrees that mid'Rabanan one must eat before midnight.
Avnei Nezer (OC 381:5): Surely, the obligation that the taste of Pesach remain in our mouths is only during the time of the Mitzvah. The same applies to the Afikoman. I.e., the opinion that requires eating it before midnight allows eating again after midnight. One may eat a k'Zayis of Matzah before midnight on condition that if the Halachah follows this opinion, this is the Afikoman, and he may eat more after midnight. To fulfill the other opinion, at the end of his meal he eats another k'Zayis on condition that if the Halachah follows the opinion that the Mitzvah applies the entire night, this is the Afikoman.