Surrounded by walls of water
On the seventh day of Pesach, we commemorate the day of the great miracle of the splitting of the sea. On the Jew’s seventh day of their Exodus from Egypt, the sea’s splitting allowed them to escape the Egyptians once and for all. As an expression of their thanks to Hashem for saving them, they sang what is known as the Song of the Sea. One of the chapters of Psalms describes the miracles that occurred during this monumental event. The verse unusually describes the sea as running away. Why didn’t it use the more appropriate term: that the sea split?
To answer this question, the Midrash asks a different one: what was it that the sea saw that made it split? The answer is it saw the coffin of Yosef. We know this from how the verse is phrased. The verse in Psalms which says that the sea ran away is an allusion to a different verse that mentions Yosef running away. This parallelism is to teach us what the verse in Psalms is referring to when it says the sea saw something. It saw the coffin of Yosef. What was it about Yosef’s coffin that made the sea split? The answer could be based on the solution to a different question: The verse describes that the walls not only split, but became rock-solid walls, which surrounded the Jews as they traveled between them. Why was it necessary to produce a miracle of such magnitude?
When did the Jews cross the sea? One opinion says that they arrived in the evening on the seventh day of their journey from Egypt. However, another opinion says that they said the Song of the Sea on the eighth day of their journey. Are they in disagreement? Not necessarily. Although in Jewish law the day begins the previous evening, before the Torah was given this wasn’t so. The Jews had the status of bnei Noach, non-Jews, whose day begins in the morning. Consequently, the original first day of Pesach, when the Jews left Egypt, was considered the second day of their redemption. This is because the night of the first Seder was when Pharaoh told them leave Egypt forever. The following morning was then considered a new day. This would then mean the seventh day of Pesach, also considered a Yom Tov, when the Jews sang at the sea, was the eighth day of their redemption. It’s possible then to say they sang on the eighth day. However, after the Torah was given, the day follows the night. This means they sang the Song of the Sea on the seventh day of Pesach. Therefore, we commemorate this event on the final Yom Tov of Pesach.
Shabbos, while a Holy day in its own right, is also in commemoration of the Exodus from Egypt. This is why we mention it in the words of the Shabbos Kiddush. All of the Yomim Tovim are also in commemoration of the Exodus. Besides the prohibited labors that are on Shabbos and Yom Tov, there’s a separate prohibition known as techumin, or boundaries. A person isn’t allowed to travel more than two thousand amos (approximately 1 km) outside their city boundaries. Therefore, techumin are also in commemoration of the Exodus of Egypt. However, this creates a difficulty. Since on the seventh day of Pesach they traveled across the sea, they surely traveled more than two thousand amos. How can we say that techumin are in commemoration of the Exodus of Egypt, when the Jews during the Exodus didn’t even observe the laws of techumin?
However, if we say that the Jews at that time had the status of bnei Noach, then in reality the night that they crossed the sea wasn’t Yom Tov. The seventh day of Pesach wouldn’t begin for them until morning, the eighth day of their redemption. They therefore didn’t transgress the prohibition of techumin. Still, the tribe of Yosef at that point definitely had the status of Jews. We find that Yosef observed Shabbos, as well as the rest of the Torah, while he was viceroy in Egypt. For sure his descendants continued his practice, and therefore considered themselves to have the status of full-fledged Jews. Since the Jewish day begins at evening, it was considered Yom Tov for the tribe of Yosef. How did they avoid transgressing the prohibition of techumin?
The answer is from what we started with. The sea split, forming solid walls for the Jews to travel through. Since the prohibition of techumin doesn’t apply to an area enclosed by walls, there was no issue. The reason why the sea performed this miracle was in the merit of Yosef. He and his descendants voluntarily observed Shabbos. The sea “saw” his coffin and didn’t want his descendants to transgress the prohibition of techumin. Therefore, not only was there an incredible miracle that the sea split, it even formed rock-solid walls.
Chag Sameach and Good Shabbos
 Based on Chasam Sofer’s Toras Moshe III to Exodus 14:21
 This verse is referring to the ים סוף, often translated as the Red Sea, but more correctly as the Reed Sea
 Psalms 114:3
 This is why we read about it in that day’s Torah Reading (see Megillah 31a with Rashi)
 Exodus Chapter 15
 loc. cit.
 Like it does in Exodus 14:21
 The Chasam Sofer understands that the Midrash is motivated by this question, even though it explicitly asks a different one. This is similar to how the meforshim understand Rashi when he asks a question in his commentary. Usually he doesn’t say what is bothering him, and those times are no exception. They understand that something else is motivating the question
 Mechilta D’Rabbi Yishmael 14:15; Bereishis Rabbah 87:8; Midrash Tehillim § 114
 It’s actually a big dispute in whose merit the sea split: in Shemos Rabbah 21:8 it’s stated as either Avraham, Yaakov, or Moshe and in Sotah 37a (with Mahasha ad. loc) it’s either the tribe of Binyomin or Nachshon Ben Aminadav’s act of jumping in the sea that caused it
 Genesis 39:15
 The Chasam Sofer writes אפשר אפשר. Unless this is a typo, it appears he admits that this answer is a big stretch
 Exodus 14:22
 Mechilta D’Rabbi Yishmael 14:22; Mechilta D’Rashbi 14:20
 Rashi to Exodus 14:5
 As evident from ibid verses 20 and 24
 The Chasam Sofer brings this in the name of Rav Moshe HaDarshan to Numbers 15:36-41
 As in the verse ויהי ערב ויהי בקר (Genesis 1:5)
 The Chasam Sofer in his Derashos II pg. 238c cites this idea from his teacher, the Hafla’ah, who seems to have originated this idea. The Hafla’ah says this, among other places, in his works Panim Yafos to Genesis 8:22 and HaMakneh to Kiddushin 37b s.v. בתוספות ד”ה ממחרת. He bases it off the verse ויום ולילה לא ישבתו (Genesis loc. cit.), which in the context of Noach and his sons mentions day first, and then night. The Hafla’ah uses this idea to answer a question posed by many Achronim: How could the Avos observe Shabbos (see http://parshaponders.com/vayeitzei-5778) if they had the status of bnei Noach, who are prohibited from observing Shabbos (See Minchas Asher Bereishis § 11)? He says that they observed Shabbos according to the Jewish day, which begins Friday evening and ends Saturday evening. Bnei Noach are prohibited from observing Shabbos only according to their day, which is from morning to evening. Since the Avos didn’t observe Shabbos Friday day and Saturday evening, they had no problem. See Binyan Tzion I § 126 who takes issue with this innovation, as well as Bikkurei Yaakov by Rav Yaakov Chai Zrihen to Orach Chaim § 4, who besides bringing those who oppose this idea, suggests it’s also the opinion of the Tzlach, brought by the Toras Chesed § 25
 Exodus 12:31
 As per Deuteronomy 5:15
 See Pesachim 117b with Rashbam s.v. צריך שיזכור, and Ramban to Deuteronomy loc. cit.
 Exodus 16:29 with Rashi. Even though this verse is dealing specifically with Shabbos, the prohibition of techumin applies to Yom Tov as well (see Mishneh Torah Hilchos Eruvin 8:4)
 Assuming the prohibition is on a Torah level, or at least an asmachtah (see Eruvin 35b and Sotah 30b)
 I’m not sure why the Chasam Sofer points this out. Since they were outside the city limits, they should really have only four amos (approximately 2.2 meters) to travel (see Eruvin 4:1; Shulchan Aruch Orach Chaim 405:1). Perhaps he’s just making the point stronger
 There is for sure no question against the Jews at that time. They were definitely permitted to ignore the prohibition of techumin, as their lives were in danger
 Even though bnei Noach aren’t obligated in techumin (or Shabbos/Yom Tov for that matter), the Chasam Sofer wants the Jews at that time to observe techumin to answer his question. He therefore finds a way to avoid it being Yom Tov when they crossed the sea
 To clarify: the fifteenth of Nissan is for everyone considered the first day of Pesach. For Jews this starts in the evening, and for bnei Noach it would hypothetically start the following morning. Pharaoh freed them that night, making the next morning (the fifteenth) the second day of their redemption. Therefore, the seventh day of Pesach, the twenty-first of Nissan, for Jews begins the night after the twentieth, and for bnei Noach the following morning. The following morning is six days after the fifteenth, making it the eighth day of their redemption
 Bereishis Rabbah 92:4. See Torah Sheleimah Bereishis Chapter 43 § 45 for other sources to this idea. However, all of them seem to only mention Yosef observing Shabbos, with no mention of the rest of the Torah
 Mishnah Berurah § 397 s.k. 3
 I understand that to the Jew’s left and right were walls, but in front of them and behind them there weren’t. I don’t know why this suffices to avoid the issue of techumin. However, some say that in fact they were surrounded in front as well, as the sea didn’t split all the way. It would gradually split in front of them as they walked. This created three walls, with the area behind them open (Rabbeinu Bachaye to Exodus 13:17, brought by Yalkut Me’am Loez Shemos Chapter 15 s.v. הנס השביעי, and Rabbeinu Bachaye to Avos 5:5, explaining an unknown Midrash, see Radak to Psalms 114:3). According to Torah law, a three-walled enclosure is considered entirely enclosed, to the point that there’s no issue of techumin.
 Perhaps the Chasam Sofer is basing himself off the principle taught in Mesillas Yesharim Chapter 1, that the universe desires to help the righteous fulfill their duties