Prelude to Foundation tells the story of mathematician Hari Seldon, fleeing around the enclosed planet Trantor, evading the Emperor who wants to control his psychohistory, and coming to understand that his invention can indeed have a practical application in predicting the fate of mankind.