As in Revelation 13:8, the clause “from the foundation” (apo kataboleis) need not mean “from before the foundation” but simply “from the foundation” (= since the foundation). It’s not that names either were or were not written in the “book of life” before they were ever born. Rather, throughout history, in response to the choices people made, God either wrote or omitted their names from the “book of life.” The fact that names may be blotted out even after they’ve been included (Exod. 32:33; Rev. 3:5, cf. Rev. 22:18) further suggests this “book of life” is not eternally written in stone.