One of Alice's transformations. Credit: Macmillan Archive, Macmillan Publishers Intl

Lewis Carroll's lucid dreams draw in endless fresh contexts for interpretation as they continue to delight and disturb. How did Charles Dodgson — Carroll's real name — do it? The story used to be that this 'mediocre' English mathematician, isolated at Christ Church College, Oxford, somehow miraculously produced Alice's Adventures in Wonderland (1865) and Through the Looking-Glass, and What Alice Found There (1871). The unlikely tale persisted, perhaps because so little evidence seemed to have survived of Dodgson's reading; at his death, most of his books were hastily sold off.

But recent years have seen the publication of Edward Wakeling's The Diaries of Lewis Carroll (The Lewis Carroll Society, 1993–2007) and Charlie Lovett's Lewis Carroll Among His Books (McFarland, 2005) — a descriptive catalogue of the volumes that Dodgson owned or is known to have read. These have given me convincing external evidence of the range of his curiosity: across evolution and logic, dream theory and botany, mathematics and dictionaries, animal welfare and new ideas about language. I have also explored his fascination with parody and the satirical weekly magazine Punch. In my new book, Alice in Space (University of Chicago Press, 2016), I investigate the array of debates to which Carroll playfully responded, and so find lost jokes and poignant vanished references.

When I started writing it more than a decade ago, I wondered how far intuition and familiarity with Victorian intellectual culture should take me in asserting Carroll's participation in the ideas thronging around him. I had to rely on the Alice books for evidence of allusion and parodies. Now I have a fuller picture of how Carroll used fantasy to pursue thoughts — on radical mathematics and Boolean logic, for example — that he constrained in his professional life as a devout Euclidean (F. F. Abeles Nature 527, 302–304; 2015).

The Victorian culture within which the Alice books were written is largely invisible to us now. It was a period of immense intellectual upheaval in fields from mathematics to language theory, evolution and education. Carroll slips these ideas into the layers of his jokes, sliding infant puns above learned references. He had a teasing openness to the ideas being pursued by his contemporaries in science, such as Thomas Henry Huxley, Charles Darwin, by logician John Stuart Mill and by lawmakers, photographers, museum-makers and novelists including George Eliot and Emily Brontë.

The Alice books move like quicksilver — sleek globules of sense splitting and straying through the maze. This was a period when possible worlds, probability and ideas of space as curved or flat were being eagerly discussed. What mathematician James Joseph Sylvester described as the “rumpling of the page” of 3D space fascinated, among others, physicist Hermann von Helmholtz, who observed that Euclid's geometry holds good for the plane, but not for “surfaces flexible without change of dimensions”. Thus Alice goes through the looking-glass.

Carroll's taste for games and play was shared by many of his contemporaries, and understood as essential intellectual stimulus. For instance, Sylvester's 1869 address to the British Association for the Advancement of Science emphasized the need to quicken the mind of students “with the doctrine of the imaginary and the inconceivable”. The logician Augustus de Morgan wrote in 1859 “All that is thinkable is possible; all that is impossible is unthinkable: that is, so far as our knowledge can go.” Carroll, who knew both men, put it this way in an encounter between Alice and the White Queen in Looking-Glass:

 Alice laughed. “There's no use trying,” she said: “one can't believe impossible things.”

 “I daresay you haven't had much practice,” said the Queen. “When I was your age, I always did it for half-an-hour a day. Why, sometimes I've believed as many as six impossible things before breakfast.”

The idea of rigorous training in believing the impossible nicely tilts at Victorian learning rituals in the style of Gradgrind, Charles Dickens's rigid pedagogue in Hard Times (1854). Nonsense was also valued by the physicist James Clerk Maxwell, who appreciated both the Alice books. His 1873 poem 'Molecular evolution' declared:

 What combination of ideas, Nonsense alone can wisely form! What sage has half the power that she has, To take the towers of truth by storm?

Carroll put several systems in motion at once in his scenes, to produce new absurdities and insights. For example, the names of the snooty talking flowers in Looking-Glass parody the then-popular 1855 poem 'Come into the garden, Maud', and the fashionable 'language of flowers' for lovers. They also nod to a recent theory about the origin of language in animal sounds that Carroll's friend, the philologist Max Müller, scorned as 'the bow-wow theory':

 “But what could it do, if any danger came?” Alice asked.

 “It could bark,” said the Rose.

 “It says 'Bough-wough!'” cried a Daisy. “That's why its branches are called boughs!”

Alice, eager and adamant, is also a transformative figure. In Wonderland she can, after trial and error, manage the scale of her body: wish fulfilment for any child subject to the awkward demands of growing up. And the often improbable relation of childhood appearance to the later adult was being newly dramatized now that they could be set side by side in photographs. Transformation was a perturbing idea for many Victorians, with its threat of kinship between species (in the books, a baby turns into a pig; bottles, plates and forks become birds). All taxonomic systems seemed unstable in the wake of evolutionary theory — to say nothing of the threat to human exceptionalism. After Alice's neck grows, she encounters a pigeon defending its eggs. Hearing that little girls eat eggs, it announces, “then they're a kind of serpent”.

Carroll emphasizes in his sideways stories that everything has a voice and every thing a right to speak, be it queen, cat, door, Time, Mock Turtle, egg or child. The Unicorn in Looking-Glass remarks of Alice:

 “I always thought they were fabulous monsters!” said the Unicorn. “Is it alive?”

 “It can talk,” said Haigha solemnly.

 The Unicorn looked dreamily at Alice, and said: “Talk, child.”

Talk is the stuff of life in these books: deft and provoking talk that draws on an array of then-current ideas and yet holds steady the surface tension of the story.