In accordance to shia books, there was a time, when Ali (r.a) was more knowledgeable than prophet (sallalahu alaihi wa ala alihi wa sallam).
Ayatolla Jafar as-Subhani in his book “The message” (ch. The first revelation) wrote:
“Just like the dates of birth and death of the Holy Prophet the date of his appointment to the prophetic mission is also not known definitely from the historical point of view; the Shi’ah scholars are almost unanimous that he was appointed to the prophetic mission on the 27th of Rajab and his prophethood commenced from the same day. However the Sunni scholars usually claim that he was appointed to this mission during the holy month of Ramadan.
As Shi’ahs claim to be the followers of the progeny of the Prophet and consider their reports to be true and final in the light of ‘Hadith Thaqalayn’ they have accepted the report of the progeny of the Prophet’s Household about the date of this appointment to the prophetic mission to be correct. The descendants of the Prophet say: “The chief of the family was appointed to the prophetic mission on the 27th of Rajab”. In view of this Shi’ahs do not entertain any doubt about the correctness of this date”. (end of quote).
Other shia history book, “A Glance at the Life of the Holy Prophet of Islam” says:
“By the time the Holy Prophet of Islam reached the age of 40, he was ready for his divine mission.” One day suddenly, while he sat in a cave at Mount Hira, Gabriel, the Angel of Revelation, appeared to him and said, ‘Recite!’ He said in surprise, ‘What shall I recite?’ Again the divine voice very clearly and openly called out, ‘Recite, O Muhammad!’
And a third time Gabriel repeated, ‘Recite in the Name of Your Lord Who created. He created the human being from a clot. Recite and your Lord is Most Honourable, Who taught (to write) with the pen, taught the human being what he knew not’ (95:1-5)”. (ch. The prophet at the age of forty).
From these quotes it’s clear for us that before this incident, Muhammad (sallalahu alaihi wa ala alihi wa sallam) didn’t know that he was a prophet, and for sure Quran still wasn’t revealed upon him.
Muhammad al-Kulayni narrated in al-Kafi (1/453), from imam, which said:
“Amir al-Mu’minin Ali (alaihi salam) was born thirty years after the birth of the Holy Prophet (sallalahu alaihi wa ali)”.
So in accordance to shia sources, when prophet (sallalahu alaihi wa ala alihi wa sallam) received his first revelation, Ali was 10 years old.
Kulayni in the very same book (1/386) gave some details, how imam is coming to this earth. He quoted imam Abu Abdullah, which said:
إن نطفة الامام مما أخبرتك وإذا سكنت النطفة في الرحم أربعة أشهر وانشئ فيها الروح بعث الله تبارك وتعالى ملكا يقال له: حيوان فكتب على عضده الايمن ” وتمت كلمة ربك صدقا وعدلا لا مبدل لكلماته وهو السميع العليم ” وإذا وقع من بطن امه وقع واضعا يديه على الارض رافعا رأسه إلى السماء فأما وضعه يديه على الارض فإنه يقبض كل علم لله أنزله من السماء إلى الارض وأما رفعه رأسه إلى السماء فان مناديا ينادي به من بطنان العرش من قبل رب العزة من الافق الاعلى باسمه واسم أبيه يقول: يا فلان بن فلان اثبت تثبت، فلعظيم ما خلقتك أنت صفوتي من خلقي وموضع سري وعيبة علمي وأميني على وحيي وخليفتي في أرضي، لك ولمن تولاك أوجبت رحمتي ومنحت جناني وأحللت جواري، ثم وعزتي وجلالي لاصلين من عاداك أشد عذابي وإن وسعت عليه في دنياي من سعة رزقي فإذا انقضى الصوت – صوت المنادي – أجابه هو واضعا يديه رافعا رأسه إلى السماء يقول ” شهد الله أنه لا إله إلا هو والملائكة واولوا العلم قائما بالقسط لا إله إلا هو العزيز الحكيم “
The seed of the Imam is from what I just explained to you. When the seed is accommodated in the womb for four months and the spirit is established therein Allah, the Most Holy, the Most High, then send an angel. This angel is called Haywan (animal or living). He then writes on his right shoulder “. . .in all truth and justice, your Lord’s Word has been completed. No one can change His Words. He is All-hearing and All-knowing.”. (6:115) When he comes out of his mothers womb he places his hands on the floor and raises his head to the sky. Placing his hands on earth is an indication of his taking possession of all the knowledge of Allah that is sent from the heavens to earth. Raising his head to the sky is that because a caller from inside the Throne calls him from the high horizon with his name and the name of his father. It is for (on behalf of) the Lord, the Most Majestic, the Most gracious, saying, “O so and so, son of so and so. Be firm so that you would be established. For the great purpose that I have created you, you are my chosen one in my creatures. You are the keeper of My secrets, the container of My knowledge, the trustee of My inspiration and My deputy and representative on earth. I have made it necessary for My blessings and mercy to reach you and those who would love you (and acknowledge your Divine Authority). I have gifted My paradise and given a place near Myself to you and to them. Also, by My Majesty and Grace, I will make your enemies to feel the heat of My punishment even though I may have given them expanded prosperity in My world such as prosperity in their livelihood. When the call of caller ends he responds to it by placing his hands on the ground and raising his head to the sky and says the following. “God Himself testifies that He is the only Lord. The angels and the men of knowledge and justice testify that God is the only Lord, the Majestic, and All-wise.” (3:18) (end of quote)
So as I wrote, in accordance to shia source, Ali was born 30 years after prophet (sallalahu alaihi wa ala alihi wa sallam), and 10 years before prophet (sallalahu alaihi wa ala alihi wa sallam) received his prophecy. As we can see in this narration, when he was born he already recited verse from Quran, which was not yet revealed upon prophet (sallalahu alaihi wa ala alihi wa sallam).
In the same book, Kulayni narrated (1/387):
فإذا ولد بعث ذلك الملك فيكتب بين عينيه: ” وتمت كلمة ربك صدقا وعدلا لا مبدل لكلماته وهو السميع العليم “
When he (imam) is born that angel comes and writes between his eyes, “. . .in all truth and justice, your Lord’s Word has been completed. No one can change His Words. He is All-hearing and All-knowing.” (6:115) (end of quote).
And he also narrated from imam (1/388):
لا تتكلموا في الامام فإن الامام يسمع الكلام وهو في بطن امه فاذا وضعته كتب الملك بين عينيه ” وتمت كلمة ربك صدقا وعدلا لا مبدل لكلماته وهو السميع العليم “
“Do not speak about the Imam. The Imam (a.s.) hears the words while he still is in the womb of his mother. When she would give birth the angel write between his eyes, “. . .in all truth and justice, your Lord’s Word has been completed. No one can change His Words. He is All-hearing and All-knowing.”. (6:115)
So obviously, even Fatima bint Asad (r.a), mother of Ali, was more knowledgeable than prophet (sallalahu alaihi wa ala alihi wa sallam). We know that shias believe Ali was born in Kaaba. Shia author Mufti Jafar Husayn in his book “Sirat amir al-muminin” (ch. The fecicitous birth, p 116) wrote:
“Fatimah bint Asad emerged from the Ka`bah three days after the birth of `Ali (a.s) with the baby in her arms”. (end of quote).
For sure during these days she would read words, written between eyes of her new born child, and as we can understand she knew and recite this mentioned verse of Quran, before it was revealed upon prophet (sallalahu alaihi wa ala alihi wa sallam).
As a result we can say that these books teaches people, that verses of Quran were first revealed upon Ali and his mother.