“The inhabitants of the earth whose names have not been written in the book of life from the foundation of the world”
The Greek form, here for “from” means separation, a completed act. God entered the names of those who would be saved and those not entered are revealed at the last judgment. Not foreknowledge, but a deliberate act known only by God, but since He is a God of love and justice, He had His reasons.