Save "Y'N D: The Melacha of מכבה
"
Y'N D: The Melacha of מכבה

מתני׳ המכבה את הנר מפני שהוא מתירא: מפני נכרים, ומפני ליסטי', מפני רוח רעה, מפני החולה שיישן. פטור כחס על הנר, כחס על השמן. כחס על הפתילה חייב. רבי יוסי פוטר: בכולן חוץ מן הפתילה מפני שהוא עושה פחם:

This is a statement.
A man covers the light because he is afraid of gentiles, robbers, and the evil spirit: Patur.
[***Rashi: It is not just any goi, it is Persians.]
In the case of turning off the light for a sick person who can't sleep because the light is on: He is patur. If the guy putting out the light is concerned about conserving the candle, oil, or wick, he's chaiv.

Rav Yosi disagrees with the immediately preceding line about the candle and oil. Even THEN you are not chaiv. You are only chaiv if you are only concerned about the wick.
We learn from this that the real melacha of Mechabe is making coal.

גמ׳ מדקתני סיפא חייב. ש"מ ר' יהודה היא, רישא במאי עסיקנא? אי בחולה שיש בו סכנה, מותר מיבעי ליה. ואי בחולה שאין בו סכנה, חייב חטאת מיבעי ליה.

The fact that the end of the Mishnah teaches us about the concern for wax, wick, and oil as chaiv allows us to see here that the author of this line is clearly Rabbi Yehudah.
***Rashi: Rabbi Yehudah and Rabbi Shimon have a disagreement about Melacha Sheaino Sricha Legofa (meaning you are doing a melacha with an external purpose). According to Rabbi Yehudah it is Chaiv, and according to Rabbi Shimon it is Patur. The concern for the lamp and oil in the Mishnah is an example of Melacha Sheaino Sricha Legofa.
Therefore, this teaches that the mishnah is said by Rabbi Yehudah. However, the first line in the Mishnah--discussing the sick guy-- is ambiguous and potentially problematic. It can be interpreted into two ways: Either he is very sick or just had a mild cold. This is ambiguous. Let's follow both sides.
-->If the guy is very sick and his life is in danger, then the Mishanh is problematic because it should have taught Mutar--one is permitted to turn off the light.
If the guy is mildly sick, non life-threatening, then it should have been Melacha Sheaino Sricha Legofa, which as we already stated Rabbi Yehuda says is Chaiv...but our Mishnah says Patur.
Nothing fits with Rabbi Yehudah.
Mutar Patur Chaiv
Rabbi Yehudah says that its mutar if his life is threatened--very sick. Rav Shimon says that turning off the light for someone sick is a Melacha Sheaino Sricha Legofa, so it's patur.
Rav Oshya agrees. (We'll see that later).
Rabbi Yehudah says you are chaiv if you turn off the light for someone who is not so sick.

לעולם בחולה שיש בו סכנה ובדין הוא דליתני מותר, ואיידי דבעי למתני סיפא חייב. תנא נמי רישא פטור.

This is a statement.
Really, it is talking about a situation that the person is very sick. And the halach should be that it is mutar, but the mishnah chose patur as a concern to the last case, which is chaiv. Even though it would be more precise to use mutar. (Chaiv is parallel to Patur, so that's why the mishnah used patur instead of mutar).

והדתני רבי אושעיא: אם בשביל החולה שיישן לא יכבה ואם כבה, פטור.

This is a question.
רבי אושעיא taught (which will be problematic with what we just said) that turning off the light for a sick guy you are actually patur. but before we said that it is actual mutar or chaiv... what's going on?

אבל אסור? ההיא בחולה שאין בו סכנה ,ורבי שמעון היא:

This is an answer.
He paskins like shimon (follows what he says) but this is a Melacha Sheaino Sricha Legofa,
Today, we follow Rabbi Shimon, but lebbonites follow the Rambam (Yehuda).