The were a group of four troublesome demons who created obstacles and difficulties in Hindu mythology, but who were easily propitiated. One theory of the origin of Ganesha is that he gradually came to prominence in connection with the .
In Puranic literature of a much later period the group of four VinÃÂyakas was merged into one definite god named VinÃÂyaka whom Rudra appointed as the "Leader of the Ganas" (Ganapati). This VinÃÂyaka-Ganapati is associated with another god called Dantin, "the one with the tusk," who is said to possess a twisted trunk () and who holds a corn-sheaf, a sugar cane, and a club. This description of Dantin is so characteristic of the Puranic Ganapati that Heras says "we cannot resist to accept his full identification with this Vedic Dantin." The name VinÃÂyaka is a common name for Ganesha both in the and in Buddhist Tantras.
In the Smrti of YÃÂjñavalkya, written in the 6th century, VinÃÂyaka is definitely mentioned as a demon who had been exalted to the rank of a deva. He is clearly described as elephant-headed by the 8th century.
The VinÃÂyakas in their original demonic role are mentioned only in a limited number of Brahmanical texts that are essentially within only one school of the Vedas, the Ká¹Âá¹£á¹Âa Yajur Veda. The VinÃÂyakas are first mentioned in the MÃÂnava-Gá¹Âhyasà «tras where they appear as four demonic creatures. Dating for the MÃÂnava-Gá¹Âhyasà «tra is only tentative, but P. V. Kane assigns it to a period prior to 600âÂÂ300 BCE and considers that they had attained a position of authority in the 2nd century BCE. S. Bhattachrji dates them between 600 and 200 BCE. Macdonell dates them between 500 and 200 BCE.
Thapan concludes that the period reflected in the VinÃÂyaka section of the MÃÂnava-Gá¹Âhyasà «tra must have been between the end of the 3rd and early 2nd century BCE. She based this conclusion in part on the fact that in the MÃÂnava-Gá¹Âhyasà «tra the VinÃÂyakas are associated with various other beings, including three of the four Buddhist lokpÃÂlas (guardians of the quarters), as well as the deities MahÃÂdeva and MahÃÂsena. MahÃÂdeva and MahÃÂsena were popular gods during the Aà Âokan period, a time when the spread of Buddhism must have posed a challenge to adherents of the Vedic tradition. Thapan says that this association implies that "not only was Buddhism viewed inimically by the brÃÂmaà Âa authors of this text..., but so were MahÃÂdeva and MahÃÂsena."
The VinÃÂyakas are also mentioned in the MahÃÂbhÃÂrata where their role shows a distinct change in two different age strata of that epic.
Thapan notes that almost all of the references to the VinÃÂyakas, Danti, and their related beings do not appear in the main body of the critical edition of the MahÃÂbhÃÂrata, but are only mentioned in the Appendices. This means that the traditions associated with these figures were limited to only a few versions which must have been found in only specific regions.