STIPULATING AGAINST RECEIVING ONE'S WIFE'S PROPERTY (Yerushalmi Halachah 5 Daf 24a)
תמן תנינן רשב''ג אומר אם מתה יירשנה שהתנה על מה שכתוב בתורה
Mishnah in Maseches Kesuvos: (If a person wrote a document to his wife that said, "I have no claim on your property...if she dies, he does not inherit her.) Rabban Shimon ben Gamliel says that he does inherit her, since he made a stipulation against the Torah. (According to Rabban Shimon, it is a Torah law that a husband inherits his wife.)
רב ירמיה בשם רב מפני שהתנה על הכתוב בתורה והמתנה על הכתוב בתורה תנייו בטל בתנאי שאינו של ממון וכא בתנאי ממון נן קיימין.
Rav Yirmiyah citing Rav: That concept (that we ignore the stipulation) is only true for non-monetary laws, but for monetary laws, like here, one can make a stipulation against the Torah.
מה טעמא דרב
Question: What is the reasoning of Rav?
בסוף הוא זכה.
Answer: Because only after death he inherits her, but before that, he cannot make a stipulation since the property is not yet in his possession.
אמר רבי יוחנן הלכה (כרבי יוחנן בן ברוקה)[רבן שמעון בן גמליאל]
R. Yochanan; The Halacha follows Rabban Shimon ben Gamliel.
דמר ר' יוחנן מכרה ונתנה בדין הוא להיות קיים ולמה אמרו מכרה בטל שלא תהא מברחת נכסיה מבעלה ואומרת שלי הן
Proof: R. Yochanan said that if a wife sold her property during her husband's lifetime, the sale should be valid. Why did Chazal say that it is not valid? To prevent her from taking property from her husband and selling it and claiming that it was her's.