*Well, this is unexpected — a comic book about the quest for logical certainty in mathematics. The story spans the decades from the late 19th century to World War II, a period when the nature of mathematical truth was being furiously debated. *

The stellar cast, headed up by Bertrand Russell, includes the greatest philosophers, logicians and mathematicians of the era, along with sundry wives and mistresses, plus a couple of homicidal maniacs, an apocryphal barber and Adolf Hitler.

Improbable material for comic-book treatment? Not really. The principals in this intellectual drama are superheroes of a sort. They go up against a powerful nemesis, who might be called Dark Antinomy. Each is haunted by an inner demon, the Specter of Madness. Their quest has a tragic arc, not unlike that of Superman or Donald Duck.

So, at least, the creators of “Logicomix” would have us believe. First published last year in Greece (where it became a surprise best seller), the comic book — er, graphic novel? — is the brainchild of Apostolos Doxiadis, previously the author of a not-bad mathematical fiction called “Uncle Petros and Goldbach’s Conjecture.” For expert assistance on logic, Doxiadis called on his friend Christos Papadimitriou, a professor of computer science at Berkeley and the author of a novel about Alan Turing. The art was done by Alecos Papadatos (drawings) and Annie Di Donna (color).

All four collaborators pop up in interludes throughout the book. (Doxiadis, evidently a handsome fellow, is drawn to look rather like Robert Goulet.) We see them chatting in the artists’ studio or strolling around contemporary Athens, accompanied by an adorable dog called Manga (Greek slang for “cool dude,” not a reference to Japanese comics). They argue about the developing logic-and-madness theme and fret over whether there’s too much or too little technical stuff for the average reader. It’s almost as if they want to pre-empt the stern judgment of the reviewer. Fat chance.

The story proper opens on Sept. 4, 1939, three days after the Nazi invasion of Poland. Bertrand Russell is giving a public lecture at an American university on the role of logic in human affairs. Angry isolationists in the audience challenge Russell to explain how logic could justify participating in a world war. Ah, he responds, but what is logic?

In a series of flashbacks, Russell recounts his epic struggle with that question. We see him first as a little boy, in the 1870s, being brought up by his grandparents after the mysterious — to him, at least — disappearance of his mother and father. (Before succumbing to disease, Russell’s parents lived in a scandalous ménage-a-trois with a rather sinister amateur scientist.) Russell’s grandfather, Lord John Russell, a Whig aristocrat and reformer, had twice been prime minister, but it was his dour and pious grandmother who dominated his childhood. Not only did he suffer from crushing loneliness, but it was borne in upon him that his Uncle Willy had to be shut away as a violent lunatic. (His Aunt Agatha was none too sane either.) This was the beginning of his lifelong terror of hereditary madness, and the impetus for many a nightmare, which the cartoonists depict with lurid relish.

The adolescent Russell sought refuge in the abstractions of mathematics. (In his autobiography, he claimed it was his love of mathematics that saved him from suicide.) His vision of an enchanted logical world was jarred, however, when he reached Cambridge and found that mathematics as practiced there was little more than a bag of calculating tricks, sloppily based on physical intuition rather than rigorous proof. If certain knowledge was to be achieved, he grew convinced, the house of mathematics had to be rebuilt from scratch on firm logical foundations.

Russell’s quest for certainty coincided with a busy erotic career. We see him courting Alys, the pretty American Quaker girl who would become the first of his four wives. (The cartoonists inexplicably neglect to depict what Russell later described as “the happiest morning of my life,” when Alys allowed him to kiss her breasts). The young couple set off on a tour of the Continent, where Russell seeks out Gottlob Frege, the greatest logician since Aristotle, and Georg Cantor, the creator of the mathematical theory of infinity. Both men, to Russell’s consternation, prove to be slightly daft. In Paris, at the 1900 International Congress of Mathematicians, he witnesses a titanic clash between Henri Poincaré and David Hilbert, the two greatest mathematicians of the day, over the importance of intuition versus proof. Returning to England, Russell spends the next decade laboring with Alfred North Whitehead to complete the epic “Principia Mathematica” — all the while doing his best to seduce Whitehead’s comely wife, Evelyn. Their (stillborn) masterpiece runs many thousands of pages, a mere 362 of which are required to prove the interesting proposition “1 + 1 = 2.”

All of this is presented with real graphic verve. (Even though I’m a text guy, I couldn’t keep my eyes off the witty drawings.) To ginger up the story, the authors often deviate from the actual facts. As they admit in an afterword, Russell never met Frege or Cantor in the flesh. Nor, I am fairly certain, did he ever say to Whitehead, “I’m tired, man.” (You expect Whitehead to reply, “Me too, bro!”) We are assured, however, that no liberties have been taken with “the great adventure of ideas.” And for the most part the ideas are conveyed accurately, and with delightful simplicity. If you don’t know much about infinity, for instance, you are invited to check in to “Hilbert’s Hotel” — which, with its infinite number of rooms, can miraculously accommodate additional guests even when it’s completely full.

There is one serious misstep, though. It has to do with the notorious paradox that Russell discovered in the spring of 1901: the paradox of the set of all sets that don’t contain themselves as members. (Think of the barber of Seville, who shaves all men, and only those men, who do not shave themselves. Does this barber shave himself or not? Either possibility yields a contradiction.) The authors have fun unpacking Russell’s paradox, but they exaggerate its fallout. The paradox did ultimately doom Russell’s (and Frege’s) project of reducing mathematics to pure logic. However — and this is something that Russell himself failed to realize, along with the authors — it left mathematics pretty much undisturbed. When Cantor heard of Russell’s paradox, he did not react like a madman, the way “Logicomix” caricatures him. He calmly observed that it did not apply to his own theory of sets, which evolved into the present-day foundation of mathematics.

It is true that Cantor did suffer fits of madness (the magus of infinity died in a mental asylum), as did many other figures in this story. Frege, the consummate logician, ended up a foaming anti-Semite. Kurt Gödel, who proved that no logical system could capture all of mathematics, starved himself to death out of a paranoid fear that people were poisoning his food. Russell maintained his own grip on sanity, but his fear of hereditary madness was borne out when his elder son became schizophrenic and his granddaughter, also schizophrenic, committed suicide by setting herself afire. Russell’s philosophical confidence, however, was shattered by his onetime pupil Ludwig Wittgenstein, who made him realize that he had never really understood what logic was.

Is it madness to be driven by a passion for something as inhuman as abstract certainty? This is a question the four creators of “Logicomix” ponder as, in a beguiling coda, they make their way through nighttime Athens to an open-air performance of the “Oresteia.” Oddly enough, Aeschylus’ trilogy furnishes the concluding wisdom, which, at the risk of triteness, I’ll condense into a mathematical inequality:

Life > logic.