four processes that result in the formation of minerals