@37818 you found God's Covenant will being executed at the cross funny. I have no idea how you find God giving us an inheritance funnyThe scripture for the names being already written is here:
*Hebrews 9:15-17*
Therefore he is the mediator of a new covenant, so that those who are called may receive the promised eternal inheritance, since a death has occurred that redeems them from the transgressions committed under the first covenant. For where a will is involved, the death of the one who made it must be established. For a will takes effect only at death, since it is not in force as long as the one who made it is alive.
The writer tells us that a will (covenant) was already created. When Jesus died, the inheritance was given and all who are written into that will receive their inheritance.
This means the election is indeed before the foundation of the world. It means God foreknew precisely because God has already elected and chosen.
There is the exegesis. It's in the text exactly as the speaker to the Hebrews expressed it.