Ulla said: From where do we know forewarning from the Torah? As it is written, "And a man who takes his sister, the daughter of his father or the daughter of his mother, and sees her nakedness" (Leviticus 20:17) - and does the matter depend on seeing? Rather, it means until they show him the gravity of the matter [that is, warn him]. If the verse is not needed for the penalty of excision, apply it to the penalty of lashes. The school of Hezekiah taught: "And if a man acts with intent against his fellow to kill him by cunning" - that they forewarned him and he is still acting with intent. The school of Rabbi Yishmael taught: "those who found him gathering wood" (Numbers 15:33) - that they forewarned him and he is still gathering. The school of Rabbi taught: "because she did not cry out in the city" (Deuteronomy 22:24) - concerning matters of speech [her failure to protest implies she could have been warned]. And all three are necessary. For had the Merciful One written only regarding his sister, I would have said: those liable to lashes, yes, but those liable to court-imposed death, no; the Merciful One therefore wrote "and if a man acts with intent." And had the Merciful One written only "and if a man acts with intent," I would have said: these words apply to death by the sword, which is lenient, but to stoning, which is severe, say it does not apply; therefore it is necessary. Why are two cases needed among those who are stoned? According to Rabbi Shimon, to include those who are burned; according to the Sages, a matter that comes by an inference from minor to major Scripture nevertheless takes the trouble to write out explicitly.
Yalkut Shimoni on Torah 326:1
Yalkut Shimoni on Torah 326:1
אֲמַר עוּלָא, מִנַּיִן לְהַתְרָאָה מִן הַתּוֹרָה, דִּכְתִיב (ויקרא כ, יז) "וְאִישׁ אֲשֵׁר יִקַּח אֶת אֲחֹתוֹ בַּת אָבִיו אוֹ בַּת אִמּוֹ וְרָאָה אֶת עֶרְוָתָהּ", וְכִי בִּרְאִיָּה תַּלְיָא מִלְּתָא, אֶלָּא עַד שֶׁיַּרְאוּהוּ טַעֲמוֹ שֶׁל דָּבָר, אִם אֵינוֹ עִנְיָן לְכָרֵת, תְּנֵהוּ עִנְיָן לְמַלְקוֹת. דְּבֵי חִזְקִיָּה תָּנָא, וְכִי יָזִד אִישׁ עַל רֵעֵהוּ לְהָרְגוֹ בְעָרְמָה, שֶׁהִתְרוּ בּוֹ וַעֲדַיִן הוּא מֵזִיד. דְּבֵי רַבִּי יִשְׁמָעֵאל תָּנָא, "הַמֹּצְאִים אֹתוֹ מְקֹשֵׁשׁ עֵצִים", שֶׁהִתְרוּ בּוֹ וַעֲדַיִן הוּא מְקוֹשֵׁשׁ. דְּבֵי רַבִּי תָּנָא, (דברים כב, כד) "עַל דְּבַר אֲשֶׁר לֹא צָעֲקָה בָעִיר". עַל עִסְקֵי דִּבּוּר. וּצְרִיכָא, דְּאִי כְּתַב רַחֲמָנָא בַּאֲחֹתוֹ, הֲוָה אֲמִינָא חַיָּיבֵי מַלְקִיּוֹת, אִין, חַיָּיבֵי מִיתוֹת בֵּית דִּין לָא, כְּתַב רַחֲמָנָא וְכִי יָזִד, וְאִי כְּתַב רַחֲמָנָא וְכִי יָזִד, הֲוָה אֲמִינָא הָנֵי מִלֵּי בְּסַיִף, דְּקִיל, אֲבָל סְקִילָה, דְּחָמִיר, אֵימָא לָא, צְרִיכָא. תַּרְתֵּי בְּנִסְקָלִים, לָמָּה לִי לְרַבִּי שִׁמְעוֹן, לְאָתוּיֵי נִשְׂרָפִים, לְרַבָּנָן, מִלְּתָא דְּאַתְיָא בְּקַל וָחֹמֶר טְרַח וְכְתַב לָהּ קְרָא.