According to Crangle, some researchers have favoured a linear theory, which attempts "to interpret the origin and early development of Indian contemplative practices as a sequential growth from an Aryan genesis",[note 4] just like traditional Hinduism regards the Vedas to be the ultimate source of all spiritual knowledge.[note 5] Thomas McEvilley favors a composite model where pre-Aryan yoga prototype existed in the pre-Vedic period and its refinement began in the Vedic period.
The origins of yoga have been speculated to date back to pre-Vedic Indian traditions; it is mentioned in the Rigveda,[note 1] but most likely developed around the sixth and fifth centuries BCE, in ancient India's ascetic and śramaṇa movements.[note 2] The chronology of earliest texts describing yoga-practices is unclear, varyingly credited to Upanishads. The Yoga Sutras of Patanjali date from the first half of the 1st millennium CE, but only gained prominence in the West in the 20th century. Hatha yoga texts emerged sometimes between the 9th and 11th century with origins in tantra.
Alexander Wynne observes that formless meditation and elemental meditation might have originated in the Upanishadic tradition. The earliest reference to meditation is in the Brihadaranyaka Upanishad, one of the oldest Upanishads. Chandogya Upanishad describes the five kinds of vital energies (prana). Concepts used later in many yoga traditions such as internal sound and veins (nadis) are also described in the Upanishad. Taittiriya Upanishad defines yoga as the mastery of body and senses.
During the period between the Mauryan and the Gupta eras (c. 200 BCE–500 CE) the Indic traditions of Hinduism, Buddhism and Jainism were taking form and coherent systems of yoga began to emerge. This period witnessed many new texts from these traditions discussing and systematically compiling yoga methods and practices. Some key works of this era include the Yoga Sūtras of Patañjali, the Yoga-Yājñavalkya, the Yogācārabhūmi-Śāstra and the Visuddhimagga.
Yoga is discussed in the ancient foundational Sutras of Hindu philosophy. The Vaiśeṣika Sūtra of the Vaisheshika school of Hinduism, dated to have been composed sometime between 6th and 2nd century BCE discusses Yoga.[note 14] According to Johannes Bronkhorst, an Indologist known for his studies on early Buddhism and Hinduism and a professor at the University of Lausanne, Vaiśeṣika Sūtra describes Yoga as "a state where the mind resides only in the soul and therefore not in the senses". This is equivalent to pratyahara or withdrawal of the senses, and the ancient Sutra asserts that this leads to an absence of sukha (happiness) and dukkha (suffering), then describes additional yogic meditation steps in the journey towards the state of spiritual liberation.
Classical yoga incorporates epistemology, metaphysics, ethical practices, systematic exercises and self-development techniques for body, mind and spirit. Its epistemology (pramana) and metaphysics is similar to that of the Sāṅkhya school. The metaphysics of Classical Yoga, like Sāṅkhya, is mainly dualistic, positing that there are two distinct realities. These are prakriti (nature), which is the eternal and active unconscious source of the material world and is composed of three gunas, and the puruṣas (persons), the plural consciousnesses which are the intelligent principles of the world, and are multiple, inactive and eternal witnesses. Each person has a individual puruṣa, which is their true self, the witness and the enjoyer, and that which is liberated. This metaphysical system holds that puruṣas undergo cycles of reincarnation through its interaction and identification with prakirti. Liberation, the goal of this system, results from the isolation (kaivalya) of puruṣa from prakirti, and is achieved through a meditation which detaches oneself from the different forms (tattvas) of prakirti. This is done by stilling one's thought waves (citta vritti) and resting in pure awareness of puruṣa.