The Talmud
כתובות דף פ״דKetubot 84a
Amud a of Ketubot 84 — the first side of the page
English rendering prepared for The Gematria — not a historical translation.
Ketubot 84a · כתובות פ״ד א
וסבר רב תנאו קיים והא איתמר האומר לחבירו על מנת שאין לך עלי אונאה רב אמר יש לו עליו אונאה ושמואל אמר אין לו עליו אונאה
— and does Rav hold that his condition stands? But surely it was stated: one who says to his fellow: "on condition that you have no claim of overcharge against me" — Rav says: he has a claim of overcharge against him; and Shmuel says: he has no claim of overcharge against him.
אלא הלכה כרבן שמעון בן גמליאל דאמר המתנה על מה שכתוב בתורה תנאו בטל ולאו מטעמיה דאילו רבן שמעון בן גמליאל סבר מתה יירשנה ורב סבר מתה לא יירשנה
Rather: the halachah is in accordance with Rabban Shimon ben Gamliel, who said that one who makes a condition against what is written in the Torah — his condition is void, but not for his reason; for Rabban Shimon ben Gamliel holds that if she dies he shall inherit her, and Rav holds that if she dies he shall not inherit her.
האי מטעמיה ולא כהילכתיה הוא
That is for his reason and not in accordance with his halachah!
אלא הלכה כרבן שמעון בן גמליאל דאמר אם מתה יירשנה ולאו מטעמיה דאילו רבן שמעון בן גמליאל סבר בדאורייתא תנאו בטל הא בדרבנן תנאו קיים ורב סבר אפילו בדרבנן תנאו בטל
Rather: the halachah is in accordance with Rabban Shimon ben Gamliel, who said "if she dies, he shall inherit her", but not for his reason; for Rabban Shimon ben Gamliel holds that in what is by Torah law his condition is void, but in what is by the word of the Rabbis his condition stands; and Rav holds that even in what is by the word of the Rabbis his condition is void.
Talmud Bavli, Wikisource edition, via Sefaria — CC BY-SA 4.0. English rendering prepared for The Gematria — not a historical translation.