143 Yevamot 4/11-13

(יא) אַרְבָּעָה אַחִין נְשׂוּאִין אַרְבַּע נָשִׁים, וָמֵתוּ, אִם רָצָה הַגָּדוֹל שֶׁבָּהֶם לְיַבֵּם אֶת כֻּלָּן, הָרְשׁוּת בְּיָדוֹ. מִי שֶׁהָיָה נָשׂוּי לִשְׁתֵּי נָשִׁים, וָמֵת, בִּיאָתָהּ אוֹ חֲלִיצָתָהּ שֶׁל אַחַת מֵהֶן פּוֹטֶרֶת צָרָתָהּ. הָיְתָה אַחַת כְּשֵׁרָה, וְאַחַת פְּסוּלָה, אִם הָיָה חוֹלֵץ, חוֹלֵץ לַפְּסוּלָה. וְאִם הָיָה מְיַבֵּם, מְיַבֵּם לַכְּשֵׁרָה:

(יב) הַמַּחֲזִיר גְּרוּשָׁתוֹ, וְהַנּוֹשֵׂא חֲלוּצָתוֹ, וְהַנּוֹשֵׂא קְרוֹבַת חֲלוּצָתוֹ, יוֹצִיא, וְהַוָּלָד מַמְזֵר, דִּבְרֵי רַבִּי עֲקִיבָא. וַחֲכָמִים אוֹמְרִים, אֵין הַוָּלָד מַמְזֵר. וּמוֹדִים בְּנוֹשֵׂא קְרוֹבַת גְּרוּשָׁתוֹ, שֶׁהַוָּלָד מַמְזֵר:

(יג) אֵיזֶהוּ מַמְזֵר, כָּל שְׁאֵר בָּשָׂר שֶׁהוּא בְלֹא יָבֹא דִּבְרֵי רַבִּי עֲקִיבָא. שִׁמְעוֹן הַתִּימְנִי אוֹמֵר, כָּל שֶׁחַיָּבִין עָלָיו כָּרֵת בִּידֵי שָׁמַיִם. וַהֲלָכָה כִדְבָרָיו. רַבִּי יְהוֹשֻׁעַ אוֹמֵר, כָּל שֶׁחַיָּבִים עָלָיו מִיתַת בֵּית דִּין. אָמַר רַבִּי שִׁמְעוֹן בֶּן עַזַּאי, מָצָאתִי מְגִלַּת יֻחֲסִין בִּירוּשָׁלַיִם וְכָתוּב בָּהּ, אִישׁ פְּלוֹנִי מַמְזֵר מֵאֵשֶׁת אִישׁ, לְקַיֵּם דִּבְרֵי רַבִּי יְהוֹשֻׁעַ. אִשְׁתּוֹ שֶׁמֵּתָה, מֻתָּר בַּאֲחוֹתָהּ. גֵּרְשָׁהּ וָמֵתָה, מֻתָּר בַּאֲחוֹתָהּ. נִשֵּׂאת לְאַחֵר וָמֵתָה, מֻתָּר בַּאֲחוֹתָהּ. יְבִמְתּוֹ שֶׁמֵּתָה, מֻתָּר בַּאֲחוֹתָהּ. חָלַץ לָהּ וָמֵתָה, מֻתָּר בַּאֲחוֹתָהּ:

(11) [If] four brothers marry four women and [all] die, the eldest [among other surviving brothers] he has the right to perform Yibum for all them [the widows] if he so wishes. If one was married to two wives and died, relations [for Yibum] or Chalitzah with one of them exempts her rival. [If] one is eligible and one is ineligible, [then] if [he chooses] to undergo Chalitzah he undergoes Chalitzah from the ineligible woman; and if [he chooses] to perform Yibum he performs Yibum with the eligible woman.

(12) [If] one re-marries his divorced wife, or [if] one marries his one Chalutzah [after performing Chalitzah], or [if] one marries the relative of his Chalutzah, he must divorce the woman, and any child [resulting from the union] is a Mamzer [the offspring of a severely prohibited union between a Jewish man and woman], these are the words of Rabbi Akiva; but the Sages say the child is not a Mamzer. And they agree that [if] one marries the relative of his divorced wife, the child is a Mamzer.

(13) Who is a Mamzer? [Relations with] any close relative subject to "He shall not enter" (Devarim 23:3) [produces a Mamzer], these are the words of Rabbi Akiva. Shimon HaTimni says: [Relations with] anyone with whom one is liable to Karet [excision] at the hands of Heaven [produces a Mamzer], and the law follows his approach. Rabbi Yehoshua says: [Relations with] anyone with whom one is liable to capital punishment [produces a Mamzer]. Rabbi Shimon ben Azzai said: I found a genealogical scroll in Jerusalem and [the following] was written in it: So-and-so is a Mamzer [as the product of a forbidden union with] a married woman, which supports the position of Rabbi Yehoshua. If one's wife died, he is permitted to her sister; if one divorced [his wife] and she died, he is permitted to her sister. If she [his former wife] married another man and then died, he is permitted to her sister. [If] his Yevama died, he is permitted to her sister. [If] he underwent Chalitzah from her and she died, he is permitted to her sister.