Rather...
Rather, it was the fountainhead established for them by their grandfather, Bearer of the Message (S)1 , while they inherited it son from father.
We may notice that the Imams (a.s.), upon being asked about the source of their knowledge of the answers to the questions put forth to them, refer it to their own particular comprehension of the Book (Qur'an), or to what they derived from the book of their mother Fatima (a.s.), or to what they learned from their forefathers who in turn learned it from the Messenger of God (S).
They did not refer it to the narration of a sahabi of the Prophet or a tabi'i or to any other learned scholar or man of knowledge. Their familiarity with various branches of knowledge and with all norms of learning in general was a cause for the nation's admiration of and reverence for them. They were granted the final say in their disputes, in solving a problem which may have then risen among their contemporary scholars or men of learning.
Every time they were asked about something, they would produce an answer for it in such a most astonishing easily convincing manner which unties the knot of what is complex, turning it into a commonsense knowledge, or in turning the theoretical into a practical necessity, without any ambiguity or confusion.
Such a unique distinction was not shared besides them by anyone from among the scholars of the nation or its wise men despite their various ranks in knowledge and degrees of wisdom and power of reasoning.
Suffices us for a proof a magnificent dialogue which is recorded in the books of history and biography between Imam al-Jawad (a.s.), who was then a child, and Yahya ibn Aktham, the supreme judge (or judge of judges) of the then Abbaside regime in the meeting prepared by al-Ma’mun to underscore distinction and superiority of the Imam over all others when al-Ma’mun faced opposition to his decision to marry the Imam to his daughter Ummul-Fadl due to his young age.
He was presumed to be in need of someone to educate him and teach him theology. The conclusion of the dialogue was a victory for the very young Imam in his stance and the shrinking of the judge and the crowd of learned scholars and pillars of Fiqh and Sunnah and their admission of his distinction and the greatness of his status.