מדרש אויף שמות 21:4

אִם־אֲדֹנָיו֙ יִתֶּן־ל֣וֹ אִשָּׁ֔ה וְיָלְדָה־ל֥וֹ בָנִ֖ים א֣וֹ בָנ֑וֹת הָאִשָּׁ֣ה וִילָדֶ֗יהָ תִּהְיֶה֙ לַֽאדֹנֶ֔יהָ וְה֖וּא יֵצֵ֥א בְגַפּֽוֹ׃

אױב זײַן האַר װעט אים געבן אַ װײַב, און זי װעט אים געבערן זין אָדער טעכטער, זאָל די װײַב מיט אירע קינדער געהערן צו איר האַר, און ער זאָל אַרױסגײן אַלײן.

Mekhilta DeRabbi Yishmael

(Exodus 21:3) "If alone (i.e., without a wife) he came, alone shall he go out." What is the intent of this? It is written (9) "If his master gives him a woman" (a Canaanite bondswoman). ("If" here is) optional (and not mandatory). You say "optional," but perhaps it is mandatory. It is, therefore, written "If alone he come, alone shall he go out" — It is optional and not mandatory. These are the words of R. Yishmael.
פֿרעגט אַ רבֿBookmarkShareCopy

Mekhilta DeRabbi Yishmael

(Exodus, Ibid.) "If he were the husband of a woman": Scripture speaks of a Jewish woman. You say "a Jewish woman," bur perhaps a gentile woman is intended? (This cannot be, for) (4) "If his master gives him a woman" speaks of a Canaanite woman. How, then, is "If he were the husband of a woman" to be understood? As referring to a Jewish woman.
פֿרעגט אַ רבֿBookmarkShareCopy

Mekhilta DeRabbi Yishmael

(Exodus 21:4) "If his master gives him a wife": ("If" here connotes) optionality. But perhaps it is mandatory? (This is not so, for) "If alone (i.e., without a wife) he came, alone shall he go out" connotes what is optional and not what is mandatory. These are the words of R. Yishmael.
פֿרעגט אַ רבֿBookmarkShareCopy