Possible from Impossible: Masechet Horayot Siyyum for the Fast of the Firstborn 5778

וכי דנין אפשר משאי אפש'?

The Gemara asks: And does one derive the halakha of the possible from the impossible?

מתני׳ הורו בית דין לעבור על אחת מכל מצות האמורות בתורה והלך היחיד ועשה שוגג על פיהם בין שעשו ועשה עמהן בין שעשו ועשה אחריהן בין שלא עשו ועשה פטור מפני שתלה בב"ד

MISHNA: If a court erroneously issued a ruling permitting the Jewish people to violate one of all the mitzvot that are stated in the Torah, and an individual proceeded and performed that transgression unwittingly on the basis of the court’s ruling, then whether the judges performed the transgression and he performed it with them, or whether the judges performed the transgression and he performed it after them, or whether the judges did not perform the transgression and he performed it alone, in all these cases the individual is exempt from bringing an offering. This is due to the fact that he associated his action with the ruling of the court.

אמר רב יהודה אמר רב לעולם יעסוק אדם בתורה ובמצות אפילו שלא לשמה שמתוך שלא לשמה בא לשמה שבשכר מ"ב קרבנות שהקריב בלק הרשע זכה ויצתה ממנו רות דאמר רבי יוסי ברבי חנינא רות בת בנו של עגלון בן בנו של בלק מלך מואב
Rav Yehuda says that Rav says: A person should always engage in Torah study and the performance of mitzvot, even if he does so not for its own sake, as through the performance of mitzvot not for its own sake, one gains understanding and comes to perform them for its own sake. Proof for this can be adduced from the incident involving Balak, as in reward for the forty-two offerings that Balak the wicked sacrificed to God, despite the fact that he did this in order to curse the Jewish people (see Numbers, chapter 23), he merited and Ruth emerged from him, as Rabbi Yosei, son of Rabbi Ḥanina, says: Ruth was the daughter of the son of Eglon, the son of the son of Balak, king of Moab.
אמר רבי יוחנן פליגו בה רבן שמעון בן גמליאל ורבנן חד אמר סיני עדיף וחד אמר עוקר הרים עדיף
§ Rabbi Yoḥanan said: Rabban Shimon ben Gamliel and the Rabbis disagreed with regard to this matter. One said: Sinai, i.e., one who is extremely knowledgeable, is preferable; and one said: One who uproots mountains, i.e., one who is extremely incisive, is preferable.