"Proof" is a play, but it is based upon a women finishing a proof that her father was unsuccessfully working on as he slips into mental decline. In fact, the play has done quite well, and they even made a movie version with Gwenneth Paltrow, Anthony Hopkins and Jake Gyllenhall.
When you mention the audience being narrow and adding other elements to attract a larger spectrum of the population, I would amend your comment about spies and intrigue to note that a majority of the "popular" novels and movies about mathematicians involve mental illness as a "lead" character. Also true in "A Beautiful Mind". One could argue the same for "Flatland," but the interactions of the main character are a little more "antisocial" than "mentally ill," per se.