The prohibition of asking a non-Jew to do melakha on Shabbat, like other rabbinic prohibitions, is called a shvut. There is a disagreement among the poskim whether the Sages permit transgressing such a prohibition in order to enable the performance of a mitzva. For example, if the lights go out on Friday night, and it will be impossible to enjoy the Shabbat meal or to learn Torah, may one ask a non-Jew to turn on the lights?
According to Itur, whenever a mitzva is involved, the Sages permit asking a non-Jew to perform melakha. However, according to Rambam and most poskim, one may not ask a non-Jew to do a melakha that is forbidden by Torah law, even for the sake of a mitzva. They agree that one may ask a non-Jew to perform a rabbinic prohibition for the sake of a mitzva. In other words, the Sages did not permit transgressing a shvut even to enable the performance of a mitzva, but they did permit transgressing a shvut di-shvut. It can be helpful to think of a shvut as half a Torah prohibition and a shvut di-shvut as a quarter of a Torah prohibition, since it is prohibited only by combining two rabbinic safeguards.
In practice, one may engage in a shvut di-shvut for the sake of a mitzva. Thus, if a brit must be performed on Shabbat, and there is no mila knife at the location, one may ask a non-Jew to bring the knife through a karmelit (where carrying on Shabbat is rabbinically forbidden), because this action is a shvut di-shvut for the sake of a mitzva. The prohibition of asking a non-Jew to do melakha is rabbinic, and the prohibition to carry in a karmelit is also rabbinic. However, one may not ask a non-Jew to carry the knife through a reshut ha-rabim, because one may not violate a normal shvut even for the sake of a mitzva. There is another solution for the problem of transporting the mila knife. The non-Jew may be asked to carry the knife with a shinui, thus creating a case of shvut di-shvut, since the prohibition of asking the non-Jew to do melakha is rabbinic, and the prohibition of carrying with a shinui is also rabbinic (see below, 24:4).
According to most poskim, for the sake of a mitzva even a Jew may violate a shvut di-shvut. For example, if one needs to bring a knife through a karmelit to perform a brit and no non-Jew is available to do so, a Jew may carry the knife with a shinui so that the action becomes a shvut di-shvut. To be sure, some are stringent and forbid this; but in practice, if it is necessary to enable the performance of a mitzva, even a Jew may perform a shvut di-shvut.
Just as a shvut di-shvut is permitted for the sake of a mitzva, it is also permitted in a case of minor illness (SA 307:5) and in order to avoid a substantial monetary loss (MB 307:22). Shvut di-shvut may not be incorporated into one’s normal Shabbat routine.
. Eruvin 67b states that one may tell a non-Jew to bring hot water for a brit through an area without an eruv. There are three opinions as to why this is permitted. According to Itur (quoted by Ran at the end of Shabbat, ch. 19) the non-Jew is asked to carry in the public domain. This is prohibited by Torah law for a Jew, but is permitted here because violating a shvut is permitted for the sake of a mitzva. However, according to Rambam (MT 6:9-10), the non-Jew is asked to carry in a karmelit, which is only rabbinically prohibited even for a Jew. Thus we see that a shvut di-shvut is permitted for the sake of a mitzva or for the sake of one who is slightly ill. According to Tosafot (BK 80b) the leniency in the case of a shvut di-shvut is only in the case of a brit because it is a particularly important mitzva (and violating a single shvut is permitted for the supremely important mitzva of settling the Land of Israel), but the leniency of shvut di-shvut is not relevant when it comes to other mitzvot.In practice, SA 307:5 rules according to Rambam and allows one to transgress a shvut di-shvut in the case of a minor illness, a great need, or for the sake of a mitzva. MA explains that “a great need” refers to a great monetary loss.
Nevertheless, some poskim rule stringently, maintaining that one may not ask a non-Jew to perform a Torah prohibition with a shinui (see Be’er Yitzĥak §14). But in practice, when it is necessary we are lenient. (See MA ad loc.; MB 340:3; SSK ch. 30 n. 49, following R. Shlomo Zalman Auerbach. The latter adds that according to Eshel Avraham 307:5, even if the non-Jew then performs the melakha in the normal fashion, the Jew may still benefit from it, since he requested that the non-Jew do it with a shinui.)
Some prohibit a Jew from transgressing a shvut di-shvut even for the sake of a mitzva. They maintain that the entire leniency discussed (Eruvin 67b) is relevant only to asking a non-Jew to perform a melakha, because this does not require that a Jew take direct action (Pri Megadim, Eshel Avraham 307:7; Maharam Schick, OĤ §121). However, most poskim rule leniently even for a Jew in the case of shvut di-shvut (Ha-elef Lekha Shlomo §146; Maharam Brisk 2:64-66; Livyat Ĥen §35). Since the prohibition is rabbinic, the law follows those who are lenient.
It is important to emphasize that one should not make regular use of the leniency of shvut di-shvut. It should be used only occasionally, in cases of true necessity.