It is the morning of June 24. Britain has just voted narrowly to leave the EU. Jubilant pro-Brexit campaigners wave Union Jacks in Trafalgar Square.

A shattered-looking David Cameron appears outside 10 Downing Street to say that he respects the verdict of the British people and that he intends to carry on as prime minister.

The atmosphere of crisis is compounded by a stock market plunge across Europe. The French and German governments issue a joint statement saying that it is imperative that the EU now make decisive steps towards political union and promise an “economic government” for Europe.

In Edinburgh, Nicola Sturgeon, Scotland’s first minister, points out that Scots have voted to stay inside the EU — and announces that she will now press for a second referendum on Scottish independence.

In the days that follow, the Conservative government is consumed by infighting. It becomes clear that the prime minister’s authority is too badly damaged for him to carry on.

Mr Cameron announces that he will resign, and the Tories call a leadership election. On the second ballot, Boris Johnson defeats George Osborne — and is invited to form a government. On the steps of Downing Street, the new prime minister amuses the press by speaking in Latin, before entering his new home, appearing to stumble over the doorstep as he enters.

Once inside Number 10, Boris is served a cup of tea and then ushered into the Cabinet Room for a meeting with Sir Jeremy Heywood, the cabinet secretary and the head of Britain’s civil service.

Sir Jeremy, who is known to have privately opposed Brexit, is polite but firm. With the markets in turmoil, he tells the new prime minister that it is imperative that he introduce some clarity into the Brexit process.

The Leave campaign, fronted by Mr Johnson, had made two key pledges. It had promised to control immigration by withdrawing Britain from the EU’s laws on the “free movement of persons”. And it had also promised that Britain would continue to enjoy free trade with the EU.

Sir Jeremy politely points out that these two promises are incompatible. He reminds Boris that the EU’s internal market is based on the free movement of goods, capital, services and people.

Under EU law, these four freedoms are inseparable. Countries such as Switzerland and Norway — that are not part of the EU but still want unfettered access to the EU market — have had to accept free movement of labour. So which is it to be? Controls on immigration or full access to the internal market?

During the campaign, Boris has managed to shrug off this choice by repeating a favourite joke: “My policy on cake is pro having it, and pro eating it.”

As he toys with a piece of Victoria sponge in the Cabinet Room, however, the new prime minister finally has to confront the cake problem. His instinct tells him that free trade matters a lot more than immigration controls.

As mayor of London, he saw that Britain’s capital relied on the flow of labour from Europe. But he also knows that immigration was the issue that delivered victory for the Brexit campaign.

A Norwegian-style deal — in which Britain accepted all EU laws, including free movement of people, in return for access to the single market — will not be acceptable to his own party, which is demanding controls on immigration and a restoration of parliamentary sovereignty.

Looking up from his cake, Boris asks, “How about Canada?” Sir Jeremy has been expecting this. With a mixture of sorrow and sadism, he begins to lay out the limitations of the EU-Canada free-trade deal as a model for Britain.

First, there is the question of time. Once Britain triggers Article 50 of the Lisbon Treaty and announces that it intends to leave the EU, it will have just two years to negotiate a new trade deal with the EU. But negotiations on the EU-Canada deal began in 2009.

Here Sir Jeremy adopts the Wodehousian language that Boris favours, and adds: “And I’m afraid to tell you, prime minister, that the bally thing still hasn’t been ratified.”

Boris looks momentarily crestfallen, so Sir Jeremy presses on.

The second problem with the Canadian model is that while it abolishes tariffs on manufactured goods, it does not secure true free trade in services. But, Sir Jeremy murmurs, the prime minister might recall from his period as London’s mayor that services — and in particular, financial services — are rather important to the UK economy.

Boris decides that there is nothing for it. He must fly to Germany and woo the true leader of Europe. In Berlin, he is pleasantly surprised by the warmth of his reception by Angela Merkel.

The German chancellor says that while she regrets Britain’s decision she will do her best to help secure a fair deal for the UK.

The British prime minister returns to Downing Street encouraged. But for weeks, nothing further is heard from Berlin. Finally, the phone rings. It is Aunt Angela.

She sounds regretful. She says that Germany would like to give Britain enhanced access to the single market, without the need for full free movement of labour. But the European Commission says that this is illegal, the European Parliament will not hear of it, and as for the French . . .

Boris is about to put the phone down and pour himself a stiff one, when Ms Merkel adds: “There is one thing that might help.” There is a long pause. “Would you consider accepting 200,000 Syrian refugees?”

gideon.rachman@ft.com