قُل لِّمَن مَّا فِى ٱلسَّمَٰوَٰتِ وَٱلْأَرْضِ قُل لِّلَّهِ كَتَبَ عَلَىٰ نَفْسِهِ ٱلرَّحْمَةَ
"Say: 'To whom belongs what is in the heavens and the earth?' Say: 'To God. He has written mercy upon Himself.'"
The construction of the sentence must be recorded: kataba ʿalā nafsih — in Arabic this construction is used for a person's taking an obligation upon himself.
I record this as my own reading: the verse does not state mercy as an attribute — it gives it as a record written upon Himself. And the same expression will occur once more in the 54th verse of this sūra: kataba rabbukum ʿalā nafsihi'r-raḥma. The two occurrences are a repetition that can be verified within the sūra.
And at Ghāfir (al-Muʾmin) 40/7 the prayer of the angels (rabbanā wasiʿta kulla shayʾin raḥmatan wa ʿilmā) was treated, and it was recorded there that mercy is named before knowledge. The two sūras set up the same priority.