Mathematical foundations of population dynamics