When it comes to the question of who is a mamzer, numerous conflicting theories abound in the early rabbinic literature. The opinion presented anonymously in Qiddushin 3:12, which appears to be halakhically authoritative (Rambam, Hilkhot Issurei Biah 15:1) follows the opinion given in the name of Shimon haTeimani in Yevamot 4:13, which is concluded with the parenthetical aside: והלכה כדבריו. This is the opinion that a mamzer is one born of a union that merits karet (in the words of Yevamot 4:13; in Qiddushin 3:12 - זה הבא על אחת מכל העריות שבתורה).
It appears that these mishnayot are referring to every sexual union prohibited in Leviticus 18, with the exception of sexual intercourse with a menstruating woman (as per the Bartenura on Yevamot 4:13). Opinions to the contrary include those of Rabbi Akiva (who defines a mamzer as the offspring of any prohibited union) and Rabbi Yehoshua (who defines a mamzer as the offspring of any union that merits death at the hands of a bet din).
In Yevamot 4:13, R' Shimon ben Azzai provides a proof for the opinion of Rabbi Yehoshua:
אמר רבי שמעון בן עזאי: מצאתי מגלת יֹחסין בירושלים וכתוב בה: איש פלוני ממזר מאשת איש לקים דברי רבי יהושע
Rabbi Shimon ben Azzai says, "I found a genealogical scroll in Jerusalem, in which was written: So-and-so is a mamzer born of adultery - which substantiates the opinion of Rabbi Yehoshua [who says that a mamzer is one born of any union that merits death at the hands of a bet din]!"
An adulterous union does indeed merit the death penalty (Leviticus 20:8, Sanhedrin 11:1), but it also merits karet (Leviticus 18:20, Keritot 1:1)! I appreciate how the Tur and the Shulchan Arukh have combined the two opinions (Even haEzer 4:13), but I'm specifically interested in understanding this mishna in Yevamot. How did Rabbi Shimon ben Azzai think that his example was a support for the opinion of Rabbi Yehoshua over the opinion of Shimon haTeimani?