The Mishnah in Sotah (3:4) states:
אם יש לה זכות היתה תולה לה יש זכות תולה שנה אחת יש זכות תולה ב' שנים יש זכות תולה ג' שנים מכאן אומר בן עזאי חייב אדם ללמד את בתו תורה שאם תשתה תדע שהזכות תולה לה ר"א אומר כל המלמד בתו תורה לומדה תפלות
IF SHE POSSESSED A MERIT, IT [CAUSES THE WATER] TO SUSPEND ITS EFFECT UPON HER. SOME MERIT SUSPENDS THE EFFECT FOR ONE YEAR, ANOTHER FOR TWO YEARS, AND ANOTHER FOR THREE YEARS. HENCE DECLARED BEN AZZAI, A MAN IS UNDER THE OBLIGATION TO TEACH HIS DAUGHTER TORAH, SO THAT IF SHE HAS TO DRINK [THE WATER OF BITTERNESS], SHE MAY KNOW THAT THE MERIT SUSPENDS ITS EFFECT. R. ELIEZER SAYS: WHOEVER TEACHES HIS DAUGHTER TORAH TEACHES HER OBSCENITY.
(Soncino translation; capitals in original)
In this answer I made the following point:
Here we have a tannaic dispute wherein one tanna asserts that teaching girls Torah is obligatory. He does not specify what forms of Torah he is referring to. The other tanna does not state that teaching girls Torah is forbidden; rather, he states that teaching girls Torah has a negative consequence.
However, when Rambam codifies this law (Hilchot Talmud Torah 1:13) he writes as follows:
ואע"פ שיש לה שכר צוו חכמים שלא ילמד אדם את בתו תורה מפני שרוב הנשים אין דעתם מכוונת להתלמד אלא הן מוציאות דברי תורה לדברי הבאי לפי עניות דעתן אמרו חכמים כל המלמד את בתו תורה כאילו למדה תפלות
Even though she will receive a reward, the Sages commanded that a person should not teach his daughter Torah, because most women cannot concentrate their attention on study, and thus transform the words of Torah into idle matters because of their lack of understanding.
[Thus,] our Sages declared: "Whoever teaches his daughter Torah is like one who teaches her tales and parables."
Rambam here explicitly states that the Sages commanded one to not teach his daughter Torah. Yet as I mentioned above, the Mishnah does not actually seem to say that. It just presents the tannaic opinion that there is a negative effect of teaching Torah to women.
How, then, did Rambam extend this to say that the Sages actually issued a command to not teach them?
I am aware that in the parallel passage in the Jerusalem Talmud, an opinion is presented which states that the Torah should be burned rather than given to women, which is somewhat closer to a "command" to not teach them. However, I did not see the standard Rambam commentaries cite the Jerusalem Talmud as Rambam's source for this statement; they cited the version in the Babylonian Talmud which does not say this.1
So did Rambam have a different version of the text in Sotah that did in fact say that the Sages commanded to not teach women Torah? Did he somehow extrapolate this command from the text that we have, even though it does not appear to say that? Was there some other external source that he was referring to?
It is perhaps noteworthy that he first says that they commanded not to teach women and only then mentions the statement that teaching them is like teaching them tiflut, perhaps implying that these are two separate things.
1. The relatively recent commentary Avodat Hamelech by R. Menachem Karakovsky does indeed cite the passage from the Jerusalem Talmud