Adi Shankara wrote a treatise on this theory, titled – Panchikaranam, which was elaborated by his disciple Sureshvaracharya, and later on commented upon in 2400 slokas by Ramananda Saraswati, disciple of Ramabhadra, and in 160 slokas by Ananda Giri, disciple of Suddhananda Yati.
The Chandogya Upanishad teaches the Doctrine of Trivirtkarana, later borrowed by the Samkhya philosophy, from which developed the Vedantic Theory of Panchikarana with regard to the creation of the transformed evolutes of the original elements.
The Vedic seers believed that the Panchbhootas firstly divided themselves in two parts one part of which was further divided into four parts, which 1/8th parts of each subtle element then combined with other halves.
They believed that at the very beginning of creation Mahat, on account of disturbance of the three gunas, gave rise to Ahamkara from which were produced in their subtle states Akasa, Vayu, Agni, Apah and Prithvi.(seven stages).
Primary creation took place in three parts,
For purpose of creation Brahman divided itself into Prakrti, the combination of three gunas, the word also meaning before creation or primary factor/female form for creation, and representing matter, and Purusa (spirit),
Panchikarana involves one half of the original subtle element to be mixed up with 1/8th part each of the other original subtle elements to produce the gross element of the subtle element contributing its own one half.
The Vedic texts do not mention any order of creation but they do declare that Brahman being mere Existence cannot originate from itself, nor can Brahman be derived from a particular form of Existence, and nor can Brahman come out of non-existence (Chandogya Upanishad VI.ii.2)(Shvetashvatara Upanishad VI.9)