Knowledge is an attribute of Allah

Knowledge

Know that the Knowledge of Allah is Eternal, Beginningless, just as His Self is Eternal. So He never ceased to be Knowledgeable about His Self, Attributes, and what He Brings into existence of His creations. So He is not attributed with an eventual knowledge, because had it been permissible for Him to be attributed with eventual attributes, Eternality would be negated from Him, because whatever is a vessel for events must then be an event.

Whatever gives a false impression of the renewal of Allah’s Knowledge, Exalted is He, of the Qur’anic verses like the Saying of the Exalted:

﴿الْئَــٰنَ خَفَّفَ اللهُ عَنكُم وَعَلِمَ أَنَّ فِيكُم ضَعفًا﴾

[which means] “Now Allah has lightened [the ruling of jihad] for you, and He Knew about weakness in you,” it does not mean that. His Saying:

﴿وَعَلِمَ﴾

[which means] “He knew…” does not refer back to:

﴿الْئَــٰنَ﴾

[which means] “Now…”

Instead, the meaning is that Allah the Exalted has lightened the ruling for you now.

And likewise His Saying:

﴿وَلَنَبلُوَنَّكُم حَتَّى نَعلَمَ الْمُجـٰهِدِينَ مِنكُم وَالصَّــٰبِرِينَ﴾

[which translates literally as] “And We will test you so that We would Know the one who strives among you and those who are patient.” It means “We would test you so that We would differentiate, i.e., make apparent for the creation between you who strives and who is patient and others. Allah was already Knowledgeable about that, as copied by Al-Bukhariyy from Abu ^Ubaydah Ma^mar Ibni-l-Muthanna. This is similar to the Saying of Allah:

﴿لِيَمِيزَ اللهُ الخَبِيثَ مِنَ الطَّيِّبِ﴾

[which means] “So that Allah would distinguish [for the slaves] between the wicked and the good.

t. However, the existence of the world is confirmed by the senses and necessity without doubt.