In preparation for the High Efficiency and Resolution Multi-Element Spectrograph (HERMES) chemical tagging survey of about a million Galactic FGK stars, we estimate the number of independent dimensions of the space defined by the stellar chemical element abundances [X/Fe]. This leads to a way to study the origin of elements from observed chemical abundances using principal component analysis. We explore abundances in several environments, including solar neighbourhood thin/thick disc stars, halo metal-poor stars, globular clusters, open clusters, the Large Magellanic Cloud and the Fornax dwarf spheroidal galaxy. By studying solar-neighbourhood stars, we confirm the universality of the r-process that tends to produce [neutron-capture elements/Fe] in a constant ratio. We find that, especially at low metallicity, the production of r-process elements is likely to be associated with the production of α-elements. This may support the core-collapse supernovae as the r-process site. We also verify the overabundances of light s-process elements at low metallicity, and find that the relative contribution decreases at higher metallicity, which suggests that this lighter elements primary process may be associated with massive stars. We also verify the contribution from the s-process in low-mass asymptotic giant branch (AGB) stars at high metallicity. Our analysis reveals two types of core-collapse supernovae: one produces mainly α-elements, the other produces both α-elements and Fe-peak elements with a large enhancement of heavy Fe-peak elements which may be the contribution from hypernovae. Excluding light elements that may be subject to internal mixing, K and Cu, we find that the [X/Fe] chemical abundance space in the solar neighbourhood has about six independent dimensions both at low metallicity (−3.5 ≲ [Fe/H] ≲−2) and high metallicity ([Fe/H] ≳−1). However the dimensions come from very different origins in these two cases. The extra contribution from low-mass AGB stars at high metallicity compensates the dimension loss due to the homogenization of the core-collapse supernovae ejecta. Including the extra dimensions from [Fe/H], K, Cu and the light elements, the number of independent dimensions of the [X/Fe]+[Fe/H] chemical space in the solar neighbourhood for HERMES is about eight to nine. Comparing fainter galaxies and the solar neighbourhood, we find that the chemical space for fainter galaxies such as Fornax and the Large Magellanic Cloud has a higher dimensionality. This is consistent with the slower star formation history of fainter galaxies. We find that open clusters have more chemical space dimensions than the nearby metal-rich field stars. This suggests that a survey of stars in a larger Galactic volume than the solar neighbourhood may show about one more dimension in its chemical abundance space.