Summary of the Proof
In this proof, it is established through the Qur’ān and Hadith that all the forefathers and ancestors of the Noble Prophet Muḥammad ﷺ (that is, his parents, paternal and maternal grandparents, and all ancestors further up the lineage) belonged to the best people of their respective eras.
Allah Almighty states:
وَ لَعَبْدٌ مُّؤْمِنٌ خَیْرٌ مِّنْ مُّشْرِكٍ
Translation: And indeed, a believing slave is better than a polytheist.
(Al-Qur’ān al-Karīm, al-Baqarah: 221)
The Messenger of Allah ﷺ states:
بُعِثْتُ مِنْ خَيْرِ قُرُونِ بَنِي آدَمَ قَرْنًا فَقَرْنًا حَتَّى كُنْتُ مِنَ الْقَرْنِ الَّذِي كُنْتُ مِنْهُ
Translation: I was selected from among the best generations of the descendants of Ādam (عليه السلام), one generation after another, until I came into the generation in which I was born and sent as a Prophet.
Imām al-Bukhārī has narrated this Hadith from Sayyidunā Abū Hurayrah (رضي الله تعالى عنه).
(Ṣaḥīḥ al-Bukhārī, Kitāb al-Manāqib, Bāb Ṣifat al-Nabī ﷺ, Dār Ibn Kathīr, Damascus–Beirut, page 877, Hadith No. 3557)

From this Hadith, it is understood that the generations and eras through which the lineage of the Noble Prophet Muḥammad ﷺ passed were all composed of the best people of their respective times.
In an authentic Hadith of Amīr al-Muʾminīn, Mawlā al-Muslimīn, Sayyidunā ʿAlī al-Murtaḍā (كرم الله تعالى وجهه الكريم), it is stated:
لَمْ يَزَلْ عَلَى وَجْهِ الدَّهْرِ سَبْعَةُ مُسْلِمُونَ فَصَاعِدًا، فَلَوْلَا ذَلِكَ هَلَكَتِ الْأَرْضُ وَمَنْ عَلَيْهَا
Translation: There have always been at least seven Muslims on the face of the earth in every era. Had this not been the case, the earth and all those upon it would have perished.
This narration has been transmitted by ʿAbd al-Razzāq and Ibn al-Mundhir with an authentic chain of transmission according to the conditions of the two Shaykhs (Imām al-Bukhārī and Imām Muslim).
(Sharḥ al-Zurqānī ʿalā al-Mawāhib al-Ladunniyyah, citing ʿAbd al-Razzāq and Ibn al-Mundhir, al-Maqṣad al-Awwal, Dār al-Kutub al-ʿIlmiyyah, Beirut, Lebanon, Vol. 1, page 327)
From this narration, it is understood that in every era there have always been righteous and accepted Muslim servants of Allah Almighty, through whose blessings Allah Almighty continued to avert punishment from the inhabitants of the earth.
In a Hadith of the renowned scholar of the Qur’ān and Ḥibr al-Ummah, Sayyidunā ʿAbdullāh ibn ʿAbbās (رضي الله تعالى عنهما), it is stated:
مَا خَلَتِ الْأَرْضُ مِنْ بَعْدِ نُوحٍ مِنْ سَبْعَةٍ يَدْفَعُ اللهُ بِهِمْ عَنْ أَهْلِ الْأَرْضِ
Translation: Since the time of Prophet Nūḥ (عليه الصلاة والسلام), the earth has never been devoid of seven such servants through whom Allah Almighty averts punishment from the inhabitants of the earth.
(Sharḥ al-Zurqānī ʿalā al-Mawāhib al-Ladunniyyah, citing Aḥmad in al-Zuhd and Khallāl in Karāmāt al-Awliyāʾ, al-Maqṣad al-Awwal, Dār al-Kutub al-ʿIlmiyyah, Beirut, Lebanon, Vol. 1, pages 327–328)
This narration also establishes that since the time of Prophet Nūḥ (عليه السلام), there have always been righteous and accepted servants of Allah Almighty in every era.
Scanned copies of the pages relating to the above two references are provided below.

Conclusion Derived from All the Evidences
When it has been established through authentic Hadiths that in every age and era there have always been at least seven (7) righteous and accepted Muslims present in the world; and it has also been established through a Hadith in Ṣaḥīḥ al-Bukhārī itself that the people from whose lineage the Noble Prophet ﷺ was born were the best people of every age and era; and the verse of the Holy Qur’ān clearly states that no disbeliever, regardless of how noble or exalted his family lineage may be, can ever be better than a believing slave; then it necessarily follows that all the forefathers and ancestors of the Prophet Muṣṭafā ﷺ (his parents and paternal and maternal grandparents) must have belonged to those very righteous and accepted Muslims in every era.
Otherwise, (Allah forbid!) this would contradict the statement of the Prophet ﷺ in Ṣaḥīḥ al-Bukhārī and the statement of Allah Almighty in the Glorious Qur’ān.
