Patanjali has compiled the teachings of Yoga in his Yoga Sutras. 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 philosopher of the Advaita Vedanta tradition, notes that, according to the Yajnavalkya Smrti, which has been dated between the third and fifth centuries AD, and belongs to the Dharmasastras tradition, 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 Puranic literature (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. (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 became the first practitioner of Yoga, and 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 called Svayambhu, (the self-manifested).