History

Was it predestined for Aadam (alaihis salaam) to eat from the tree in Jannah?

Q: Someone I know asked me a question regarding Islam, and I didn't have a substantial answer to give due to lack of knowledge. And frankly, I myself am in a delimma regarding it.

In surah al Baqarah 2:30 Allah Ta'ala told the angels that He is going to create a new being who will act as his khalifa on earth. This was prior to creation of Adam (alaihis salaam). As I understand, Adam (alaihis salaam) was predestined to be sent to earth even before he was created. However after his creation, he had to eat from the tree to be expelled from earth.

From my feeble understanding, Adam (alaihis salaam) didn't have any choice because Allah Ta'ala created Adam (alaihis salaam) with the specific purpose of functioning as His khalifa on earth.

So was Allah Ta'ala going to send Adam (alaihis salaam) to the earth regardless of his disobedience? Doesn't this also mean that Adam (alaihis salaam) predestined to disobey Allah Ta'ala?