Rabbi Yudan and Rabbi Huna, both of them in the name of Rabbi Yosei ben Zimra: Rabbi Yudan said: Wherever aḥarei is stated, it refers to immediate events; aḥar refers to distant events.8The Hebrew uses both aḥar and aḥarei [“after”] in the common phrase “after these matters.” The Midrash explains that difference between them is that one indicates that what follows took place immediately after the events recorded previously, while the other indicates that it took place after some time.
Rav Huna said: Wherever aḥar is stated, it is immediate; aḥarei, distant. “After these matters”9Devarim, translated here as “matters,” can also mean words. – after thoughts of words that took place there. Who had these thoughts? Abraham had the thoughts.
He said before the Holy One blessed be He: ‘Master of the universe, You made a covenant with Noah that you would not eliminate his descendants. I arose and amassed mitzvot and good deeds more that he did, and my covenant overrode his covenant.10And thus I was able to slay many of his descendants. Perhaps someone else will arise [one day] and amass mitzvot and good deeds more than I did, and his covenant will override my covenant.’11And he will be able to harm me.
The Holy One blessed be He said: ‘From Noah, I did not bring forth righteous protectors [from his descendants], but from You I will produce righteous protectors. Moreover, when your descendants will come to commit transgressions and bad deeds, I will see one righteous man among them, I will consider him to be equal to all of them combined, as he is capable of saying to the attribute of justice: Enough. I will take him away12He will die. and serve as atonement for them.’