There is a tradition that Eliyahu (Elijah the Prophet) will come before Moshiach, to inform the world of the advent of Moshiach. Is this showing of Eliyahu a mandatory pre-requisite for Moshiach?

The Talmud relates:1

Once, Rabbi Joshua met Moshiach and asked him: ‘When are you going to come?’ Moshiach replied: ‘Today!’

Rabbi Joshua then met Eliyahu, who asked him: ‘What did he (Moshiach) tell you?’ Said Rabbi Joshua: ‘He lied to me, for he told me that he is coming today, but he didn’t come!’

Said Eliyahu: ‘He didn’t lie, but this is what he really meant: He will come “Today, if you hearken to the voice of G‑d.”2

Maharsha explains that if Moshiach comes today, we assume that Eliyahu came yesterday to the Supreme Beth Din (in Tiberias).

Another explanation is that if we merit, and Moshiach comes sooner (before the appointed time), he may then come on his own before the revelation of Eliyahu. This is presented in Krayti U’playti (by Rabbi Yonason Eibschutz):3

Rambam posits4 that it is not a certainty that Eliyahu must come before Moshiach. Although some Sages maintain that before the advent of Moshiach, Eliyahu will appear, yet, there is no definite basis for this.

This poses a difficulty, inasmuch as the Talmud states5 that Eliyahu will come first, and as is seen in Tanach,6 “Behold I send unto you Eliyahu the Prophet.” How do we reconcile these two statements re: the coming of Eliyahu?

The answer is seen in the timing of Moshiach, as the Talmud cites the verse:7 “In its time will I hasten it” — If Jews do not merit, Moshiach will come in his appointed time; but if they merit, then Moshiach will come sooner, in haste.

Rambam holds that there is an order to the coming of Moshiach, that Eliyahu comes first to foretell of his coming. This, however, is effective only when Moshiach comes in his appointed time. But when Jews merit and the redemption is hastened, as expressed in,8 “He is leaping over the mountains, skipping over the hills” — G‑d then changes the order, as a sign of His love for Jewish merits and good deeds. This is expressed in the Rambam’s concise words.

The Sages note that Eliyahu comes first, to convey the news of Moshiach; yet, this is not definite. For, perhaps G‑d will have mercy and bestow His holy spirit upon the Jews to serve Him with a full heart; then He will swiftly bring Moshiach without the need for Eliyahu’s message.9