Mathematical structures in population genetics