You may want to think about what you just said. If Im reading that correctly you would agree that because God knew what was going to happen but created the world anyway that God is the author of sin. I would suggest that is great error.
God is the creator of the world and all in it, and, as you say, He knows everything. Therefore He is not the author of sin, be He did intentionally allow it. This makes Him the Allower of Sin. We see that in His allowing Satan to torment Job.
There are many other instances, even prophesied ones, perhaps the most egregious being the response to the birth of Christ being the massacre of infants around Bethlehem by evil King Herod.