Patanjali has systematically compiled the teachings of Yoga in his Yoga Sutras, which is dated between fourth and ninth centuries B.C., but he is not the founder of the Yoga system, which is an ancient practice predating him by several millennia. Vācaspati Miśra, the ninth century A.D. Hindu philosopher of the Advaita Vedanta tradition, notes that, according to the Yajnavalkya Smrti, which has been dated between third and fifth centuries A.D., and belongs to the Dharmasastras tradition, a sage known as Hiranyagarbha is the original teacher of Yoga. That is why Patanjali begins his Yoga Sutras with the following aphorism:
अथ योगानुशासनम् ॥१॥
The prefix “anu” indicates that the aphorisms in the Yoga Sutras are a continuation of an earlier activity which is indicated in the suffix “śāsanam” (teachings of Yoga). The term “atha” means now and the entire aphorism can be roughly translated as: “Now, the teachings of Yoga [follow in this treatise]”.
The Mahabharata too identifies Hiranyagarbha as the founder of Yoga. In the Puranic literature, for example, the Bhagavata Purana, Hiranyagarbha is regarded as Brahma, the creator god of Hinduism, who is born on the lotus sprouting from the navel of Vishnu when Vishnu is reclining on the divine serpent Sesa which floats on the cosmic waters pervading the entire universe before creation. (It’s noteworthy that Patanjali is described as the reincarnation of Vishnu’s divine serpent Sesa.) When Hiranyagarbha awakens in the lotus, he is confused and disoriented—he has no means of knowing anything. He manages to calm his mind and entering into a stage of Yoga (samadhi), he attains the divine vision of Vishnu. Thus Hiranyagarbha becomes the first practitioner of Yoga, and by virtue of that, the founder of the Yoga system.
In the Shvetashvatara Upanishad, which is embedded in the Yajurveda, Kapila, the founder of the Samkhya system, is identified as Hiranyagarbha. Another interesting portrayal of Hiranyagarbha is found in the account of primary creation of the universe given in the Matsya Puraṇa—here Hiranyagarbha is depicted as the golden womb (cosmic egg) inside which Brahma creates himself. Since he creates himself, this Brahma is also called Svayambhu, (the self-manifested).