1) THE SOURCE IN THE TORAH FOR RECITING HALLEL AND FOR READING THE MEGILAH
OPINIONS: The Gemara says that the Chachamim instituted the reading of the Megilah on Purim because they found a source in the Torah for such an enactment. They derived from a Kal v'Chomer that there is a Mitzvah to give praise to Hash-m when He saves the Jewish people through a miracle. The Torah relates that the Jewish people sang praise (the "Shirah") to Hash-m when they left Mitzrayim, passed through the Sea, and saw the Egyptians drown. If it was appropriate to sing praise to Hash-m when He performed a miracle to deliver the Jewish people from slavery to freedom, then certainly it is appropriate to sing praise to Hash-m when He performs a miracle to save the Jewish people from death and gives them life (as occurred at the time of Purim).
Does the obligation to sing praise to Hash-m, as derived from the Kal v'Chomer, have the status of a Mitzvah d'Oraisa or a Mitzvah d'Rabanan? (See Insights to Erchin 11:2.)
(a) The CHASAM SOFER (YD 233) maintains that the obligation to sing praise to Hash-m when He saves the Jewish people through a miracle is a Mitzvah d'Oraisa, because it is derived through a Kal v'Chomer from the Shirah that the Jewish people sang when they were saved from Mitzrayim. Their Shirah was a fulfillment of a Torah Mitzvah to praise Hash-m.
This apparently is the source for the opinion of the BEHAG (quoted by the RAMBAN in Sefer ha'Mitzvos, Shoresh Rishon) who maintains that Hallel (on Chanukah) and the reading of the Megilah (on Purim) are Mitzvos d'Oraisa. The Kal v'Chomer mentioned in the Gemara here teaches that there is a Torah obligation to thank Hash-m when He saves the Jewish people through a miracle.
The Chasam Sofer points out that this does not mean that there is a Mitzvas Aseh d'Oraisa to read the Megilah on Purim. Rather, it means that mid'Oraisa there is a requirement to make some display of praise to Hash-m to show appreciation for the miracle. The Chachamim instituted exactly what form of praise to make; in the case of Purim, it is the reading of the Megilah. However, even if one does not fulfill the d'Rabanan requirement but makes some other display of praise to Hash-m, he fulfills the Torah obligation to praise Hash-m for the miracle.
(b) The NETZIV (in HA'EMEK SHE'EILAH, Vayishlach 26:1) challenges the explanation of the Chasam Sofer. How can an obligation to praise Hash-m every year for a miracle that occurred once be derived from the Jews' praise of Hash-m at the Sea for the miracle He performed then? When they praised Hash-m for taking them from slavery to freedom, that Shirah was said at the time that the miracle actually took place. From that event we may derive only an obligation to praise Hash-m at the time that the miracle occurs, but not an obligation to praise Hash-m every year on the anniversary of the miracle.
Another difficulty with the opinion of the Chasam Sofer is the intent of the Gemara's question here. The Gemara asks that Hallel should also be said on Purim because of the Kal v'Chomer ("Iy Hachi, Hallel Nami Neimra"). If the Gemara means, as the Chasam Sofer explains, that the obligation to express gratitude to Hash-m for His miracle is derived from the Shirah which the Jews sang at the Sea, why does the Gemara ask that Hallel should be said on Purim? There are already a number of other expressions of gratitude to Hash-m for His miracle, such as the reading of the Megilah, the Mitzvos of Mishlo'ach Manos and Matanos l'Evyonim, and the Se'udah. Why does the Gemara ask that Hallel should be said, if any display of praise suffices to fulfill the Torah obligation?
The Netziv asks a third question. According to the Chasam Sofer, how can the Gemara in Rosh Hashanah (19b) say that the festivals listed in Megilas Ta'anis were annulled? Those days were all days on which miracles took place, and which the Chachamim established as days of Simchah to give praise to Hash-m for His miracles. According to the Chasam Sofer, who says that the obligation to give praise to Hash-m for His miracles is mid'Oraisa, how can those days become annulled such that no display of praise is made on those days? According to the Chasam Sofer, refraining from giving praise to Hash-m on those days constitutes a transgression of a Mitzvas Aseh d'Oraisa! (HA'GA'ON RAV CHAIM ZIMMERMAN zt'l, in AGRA L'YESHARIM, ch. 19-21, discusses this question at length and points out that the son of the Rambam debated this issue with Rav Daniel ha'Bavli in SEFER MA'ASEH NISIM, #1.)
Perhaps a resolution to these questions on the opinion of the Chasam Sofer may be suggested as follows.
The Kal v'Chomer which teaches the obligation to praise Hash-m when He saves the Jewish people through a miracle actually includes two parts. The first part is the Kal v'Chomer from the Shirah at the Sea which obligates the Jewish people to praise Hash-m at the time the miracle occurs. The second part is another Kal v'Chomer from the Yamim Tovim -- the annual commemoration of the miracle which the Torah requires the Jewish people to observe. The Torah requires that the festivals of Pesach and Sukos be observed as a form of praise to Hash-m for the miracles He did for the Jewish people many years ago. If the Torah obligates the Jews to commemorate, perpetually, a miracle which brought them from slavery to freedom, then all the more so must they make a perpetual commemoration of a miracle which brought them from death to life. Hence, the Kal v'Chomer teaches both the obligation to praise Hash-m for the miracle when it occurs, and the obligation to commemorate the miracle each year on the anniversary of the event. This answers the first question.
How does the Chasam Sofer answer the second question on his opinion? Perhaps the reason why the Gemara asks that Hallel should be said on Purim even though there are other displays of praise to Hash-m for the miracle of Purim is as follows. The Gemara's question is that the praise for the miracle should be expressed specifically through the exact form of praise which the Torah uses. Since the form of praise in the Torah is the Shirah, a song of praise to Hash-m, the Mitzvah to praise Hash-m for His miracles should similarly be expressed through a song of praise, or Hallel. Why did the Chachamim enact a new form of praise for Hash-m (such as the reading of the Megilah)? The Gemara answers that "the reading of the Megilah replaces the recitation of Hallel." This means that the Chachamim deemed it appropriate to institute the reading of the Megilah to publicize the events of Purim. Once that Mitzvah has been fulfilled, however, it is no longer necessary to recite Hallel because the miracle has already been commemorated (and the Torah obligation to praise Hash-m has already been fulfilled) through the reading of the Megilah.
The answer to the third question -- why did the Chachamim annul the festive days recorded in Megilas Ta'anis -- may be as follows. Those festivals differed from Chanukah and Purim in that the miracles which those days commemorate were not open and obvious miracles. A heretic could attribute those miracles to natural causes and coincidences (see Ta'anis 17b-18b). Consequently, the obligation to praise Hash-m for those miracles is not included in the Kal v'Chomer, and thus the obligation is only mid'Rabanan.
For example, the twenty-eighth day of Adar was instituted as a festive day to commemorate the miracle which occurred when the Jews -- led by Rebbi Yehudah ben Shamu'a and his colleagues -- held a demonstration to protest the harsh decrees which the Romans had issued against them, and the decrees were rescinded. That miracle could easily be attributed to natural factors, such as the political pressure exerted by a prominent segment of the population lobbying on behalf of social reform. Other festive days were enacted to commemorate the deaths of wicked Roman oppressors, and to commemorate the triumph over the claims of the Tzedukim who wanted to abolish certain Mitzvos of the Torah. The Torah obligation, as derived from the Shirah, to praise Hash-m for His miracles applies only to miracles which are similar to the miracle of the redemption from Mitzrayim in that they are open and obvious miracles. The obligation does not apply to miracles which are not obvious.
The miracles of Chanukah and Purim were clear and obvious miracles. On Chanukah, the weak and outnumbered Jews defeated the large and mighty army of the Syrian-Greeks. On Purim, an inexplicable and sudden reversal of the plans of Haman occurred; at one moment he was the highest-ranking official in the empire next to the king whose campaign of genocide was invincible, and moments later he was headed for the gallows. Accordingly, those miracles are included in the Torah obligation to praise Hash-m.
(Although the miraculous salvation of Purim did not involve a miracle as obvious as that of Chanukah, when one day's worth of oil burned for eight days, it certainly was recognized as a miraculous turn of events by all who fasted for three days, prayed for salvation, and then immediately experienced it. Even Haman was caught off-guard by his sudden turn of fate. (See also EMEK BERACHAH, p. 123, s.v. "v'Hineh b'Maseches Megilah.") Compared to the salvation which occurred on Purim, the events recorded in Megilas Ta'anis look mundane (which is why those holidays are no longer observed; see Rosh Hashanah 18b, Shabbos 13b). What was "hidden" about Purim was that all of the circumstances which led to Haman's downfall had already been planted firmly in place ("Refu'ah Kodem l'Makah") unbeknown to all. Even though disaster looked imminent, Hash-m's protection was there all the time.) (M. Kornfeld)

OTHER D.A.F. RESOURCES
ON THIS DAF