Our Gemara on Amud Aleph discusses the status of an Egyptian, who may not intermarry with a Jew, even if converted, until the third generation post-conversion. As the verses (Devarim 23:8) state:

לֹֽא־תְתַעֵ֣ב אֲדֹמִ֔י כִּ֥י אָחִ֖יךָ ה֑וּא לֹא־תְתַעֵ֣ב מִצְרִ֔י כִּי־גֵ֖ר הָיִ֥יתָ בְאַרְצֽוֹ׃

You shall not abhor an Edomite, for such is your kin. You shall not abhor an Egyptian, for you were a stranger in that land.

בָּנִ֛ים אֲשֶׁר־יִוָּלְד֥וּ לָהֶ֖ם דּ֣וֹר שְׁלִישִׁ֑י יָבֹ֥א לָהֶ֖ם בִּקְהַ֥ל ה׳

The third generation shall be permitted to enter the congregation of Hashem.

The Riva and Rosh (Bereishis 25:1) ask how Avraham could have married Hagar, as she was an Egyptian. They answer that since Avraham himself had the status of a convert, we hold that while converts are Jewish, they are not fully “of the congregation" (Kiddushin 69). Therefore, a convert is not under the restriction against allowing an Egyptian to enter the "congregation of Hashem."

I would like to offer a different answer. The Biblical ban against marrying Egyptians might have been a reaction to their cruelty in enslaving the Jews. Therefore, even though we have a tradition that Avraham kept the entire Torah, this aspect of the Torah was not any more relevant than a ban on eating from the Gid Hanashe, since Yaakov was yet to be born and did not yet injure his leg wrestling with the angel (see Bereishis 32:33).

But my answer is too good. Why didn't it occur to the Rosh or the Riva? I believe it depends on how you read the verses above. Is the Torah saying that Egyptians are to be distanced because of their cruelty, but after all, since they still hosted us and we dwelled in their land, we will allow them to join the Tribe after three generations? Or, perhaps, Egyptians were always to be despised just like the other seven nations, even prior to the slavery. However, out of consideration that we lived in their land and they hosted us, we allow entry for the third generation? Apparently, Rosh and Riva held the second way, and my answer would rely on the first interpretation. Or, perhaps we might say that Rosh and Riva agree with my interpretation of the reason for rejecting Egyptians, but they held that indeed Avraham followed these prohibitions in advance. If we go with that logic, Avraham also didn't eat Gid Hanashe. How does that make sense? It is possible to argue that in every Mitzvah, there is a teleological and/or logical human reason for a mitzvah, but also a deeper spiritual reason. The historical event is merely a manifested reality at a certain point in time. As the Zohar in the beginning of Toldos states, Hashem looked at the Torah and created the world. The Torah shapes reality and history, and not the reverse.

There is strong proof for this position, as we have a Midrashic tradition (see Rashi Bereishis 19:3) that Avraham ate Matzah on Pesach. We eat Matzah on Pesach either to commemorate that we left Egypt suddenly, and the dough did not have time to rise, or to remember the simple rations we ate as slaves (see Shemos 12:39 and Rashi Devarim 16:2-3). If so, why would Avraham eat Matzah when slavery, nor the exodus, even happened? We must say that the innermost reason for Matzah is deeper than any physical and historical manifestation. The historical occurrences that surround Matzah, Gid Hanashe, and the Egyptian marriage ban are only physical manifestations that represent an "is-ness", so to speak, the Platonic Universal form of Matzah, and its spiritual essence, and the same with God Hanashe or the Egyptian marriage ban. Ironically, the Exodus commemorates Matzah, and Yaakov’s injury commemorates Gid Hanashe, instead of the opposite.

 

Plato, and most Rishonim, hold that there are separate, immortal non-physical ideas, that are imposed on physical matter. This is like the software that dictates reality’s form, which is the hardware. Consider that there is a concept of a perfect triangle or square, which in reality can never exist, as it will never be perfectly proportionate, yet it guides your thinking when you make a triangle or square. (For Rishonim who discuss Chomer and Tzurah, Form and Substance, see Ramban Bereishis 1:1, Seforno ibid 1:2, Moreh I:35, and Kuzari 1:83).

Avraham's level of understanding of the Torah made it incumbent upon him to observe the mitzvos in these universal and timeless dimensions.

If we accept this idea, it allows us to understand a famous Ramban regarding the rainbow, When he encountered the clearly demonstrable scientific fact, that a rainbow comes from the light spectrum and can be created at will via refracting light through a glass of water, he does not deny it.  However, the simple reading of the Biblical text indicates that God created the rainbow only after the Flood, and as a sign and reminder of His covenant. The verse says, “My rainbow I therefore have placed”, which sounds like it’s being made now for the occasion. Ramban reinterprets the verses to mean, “The pre-existing phenomenon of the rainbow shall NOW serve (and be placed) as a reminder of the covenant.” Or to accurately use the past tense of the verse, “The pre-existing phenomenon of the rainbow, which I have already placed in the sky, as a result of creation, shall NOW serve as a reminder of the covenant.”

We can be satisfied with the Ramban’s answer and interpretation of the verse. However, we can deepen our appreciation for what he is saying by utilizing the concept we discussed. That is, the historical manifestation of the rainbow after the flood is only the tip of the iceberg. There is a universal rainbow which represents gods capacity to make a covenant and forgive, and no longer bring a flood which existed even before creation, just as a Torah existed before creation. The fact of the rainbow may or may not have happened at a particular time is not particularly significant in the universal realm of God’s ideas and timeless existence.