סימן קכז סעיף ד
אַף אִם לֹא קִבֵּל עָלָיו אֶת הַתַּעֲנִית בְּפִיו, אֶלָּא בְּהִרְהוּר קִבֵּל עָלָיו וְגָמַר בְּדַעְתּוֹ לְהִתְעַנּוֹת לְמָחָר, וַאֲפִלּוּ שֶׁלֹּא בִּשְׁעַת תְּפִלַּת מִנְחָה, אֶלָּא קֹדֶם תְּפִלַּת מִנְחָה אוֹ אַחַר כָּךְ בְּעוֹד שֶׁהוּא יוֹם, הֲוֵי קַבָּלָה וְחַיָּב לְהִתְעַנּוֹת (תקסב).
Even if you did not commit yourself verbally, to fast; doing so, only in your mind, resolving to fast the following day, and even [if you made this resolution] not during Minchah, but either before or after Mincha, while it was still daytime, it is considered an acceptance, and you are required to fast.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)