The Rambam codified the triplicate biblical injunction not to dwell permanently in the Land of Egypt as follows:
וּמֻתָּר לִשְׁכֹּן בְּכָל הָעוֹלָם חוּץ מֵאֶרֶץ מִצְרַיִם. מִן הַיָּם הַגָּדוֹל וְעַד הַמַּעֲרָב אַרְבַּע מֵאוֹת פַּרְסָה עַל אַרְבַּע מֵאוֹת פַּרְסָה כְּנֶגֶד אֶרֶץ כּוּשׁ וּכְנֶגֶד הַמִּדְבָּר. הַכּל אָסוּר לְהִתְיַשֵּׁב בָּהּ. בִּשְׁלֹשָׁה מְקוֹמוֹת הִזְהִירָה תּוֹרָה שֶׁלֹּא לָשׁוּב לְמִצְרַיִם. שֶׁנֶּאֱמַר (דברים יז טז) "לֹא תֹסִפוּן לָשׁוּב בַּדֶּרֶךְ הַזֶּה עוֹד". (דברים כח סח) "לֹא תֹסִיף עוֹד לִרְאֹתָהּ". (שמות יד יג) "לֹא תֹסִפוּ לִרְאֹתָם עוֹד עַד עוֹלָם". וַאֲלֶכְּסַנְדְּרִיאָה בִּכְלַל הָאִסּוּר:
It is permissible to live anywhere in the world, except for Egypt, defined as the area extending west of the Mediterranean Sea, 400 parsangs by 400 parsangs, in the direction of Ethiopia and in the direction of the desert. The Torah warned us in three places not to return to Egypt: “And do not return in this way again” [Deut. 17:16], and “And you shall no longer see it” [Deut. 28:68], and “And you shall not ever again see it” [Exodus 14:13]. Alexandria is included in this prohibition. [Mishneh Torah, Kings and Wars 5:7]
The area he delimited includes not only today's Egypt, but also the Sudan, Ethiopia, and some of the Sahara Desert. What is his source for this apparent extension?