Kiddushin 81a: It is permitted to be alone with a woman in a room that has a door open to a public area.
קידושין פא ע”א: אמר רב יוסף: פתח פתח לרשות הרבים ־ אין חוששין משום ייחוד.
Rabbi Yaakov Kamenetsky related that he heard that Rabbi Yisroel Salanter once said, “If there would be a question of yichud on a train, I would jump out the window to avoid it.” R’ Yaakov reasoned that since jumping out of a moving train is life-threatening, the prohibition of yichud must be in the category of yehareg v’al yaavor, a sin that one must rather be killed than transgress.
Six years after R’ Yaakov passed away, his analysis was confirmed when the book Kisvei Hasaba Vetalmidav Mikelm was published. There in v. 2 p. 786 the full story appears in the name of Rabbi Naftali Amsterdam, a student of R’ Yisroel, as transcribed in a notebook by Rabbi Gershon Miadnik. The story was that R’ Yisroel had an actual problem of yichud during a train ride, and he stated explicitly that he was ready to endanger his life by jumping out the window – had he not found a leniency.
[It is not stated what the leniency was, but possibly it was that although at that moment R’ Yisroel and the woman may have been the only ones in the train car, people sometimes pass between cars, and it is similar to yichud with an open door to the street.
The question here is that even if yichud is considered to be in the category of arayos and is therefore yehareg v’al yaavor, why should that obligate him to kill himself to escape the transgression? In arayos itself there is a principle of קרקע עולם, that one who transgresses passively does not have to give his life. Tosafos argues (Pesachim 25b and other places) that this is derived from the laws of murder, where one need not forfeit his life to avoid allowing one’s body to be used as a murder weapon. The opinion of Tosafos is brought down as halacha by the Rema in Yoreh Deah 157:1. Here too, seemingly it would be allowed to remain sitting passively in the train after situation of yichud arises.
The answer is that R’ Yisroel was machmir for the opinion of the Rambam, who doesn’t bring down קרקע עולם. Reb Chaim in his first piece on the Rambam explains that he held that the Gemara in Sanhedrin 74b only uses the logic of passivity to explain Esther marrying Achashveirosh, since – according to that sugya – that was not an act of גילוי עריות at all. The problem there was a different one – that even the smallest sin becomes yehareg v’al yaavor when done in public. But real גילוי עריות is yehareg v’al yaavor even when done passively.
Reb Chaim there offers two possible explanations as to why the Rambam disagreed with Tosafos’ idea to derive from murder that a passive transgression is not yehareg v’al yaavor: 1) There it is one life against another and you have no right to decide which is more valuable, but here giluy arayos in any form, active or passive, is more valuable than your life; 2) Even in murder itself, letting one’s body be used as a weapon does not constitute any act of murder at all, even a passive one, but if a real passive case of murder could be found, it would be prohibited.] � �