The Brexit mess in Westminster shows what happens when a parliamentary system confronts a decision that cuts deeply across traditional party lines, compounded by leadership failures of epic proportions.

The leadership failures are well known. David Cameron made the feckless and fateful decision to hold the referendum in the first place. Theresa May made the catastrophic miscalculation to call an early election she didn’t have the political skill to win, blowing her Commons majority.

She then negotiated a deal with the EU that she needed to get through parliament, without listening to what parliamentarians wanted. Jeremy Corbyn has a relentless and corrosive inability to lead Labour to an unassailable position when confronted with a government in chaos.

These are the worst British party leaders for generations. Better leaders would not have made these awful mistakes, causing so much harm to civil political discourse.

Nobody wins a negotiation by rubbing the other side’s nose in the dirt

The root of the problem is well-known to political scientists. It’s a voting cycle. Option A is beaten by B. Option B is beaten by C. But then option C is beaten by A. And so the cycle continues. Every option is opposed by a majority. Simply putting things to a vote, no matter how many times, can’t solve this.

The Brexit voting cycle is plain to see. The referendum result was 52 per cent for leave and 48 for remain. But the “leave” option was so vague that it in effect combined at least two options. One option is to leave but only with a negotiated deal.

The other is to walk away with no deal. This was a fatal flaw in Cameron’s referendum process.

Many leave voters were voting for different things. We’ll never know how many leave voters were in each camp, but it’s safe to say that each contained more than 2 per cent of voters. So, while there was no majority for remain, there was no majority for leaving with a deal and no majority for a no-deal Brexit.

BREXIT: The Facts Read them here

That left British politics in a voting cycle, reflected in a parliamentary arithmetic that is unlikely to change with a new election. Remain is beaten by the combined majority of those wanting a deal and those wanting no deal.

Deal is beaten by the combined majority of those wanting remain and those wanting no deal. No deal is beaten by the combined majority of those wanting remain and those wanting a deal. This is why the House of Commons can’t vote itself out of the Brexit crisis.

If any of these options is imposed by force majeure, furthermore, a majority will be deeply unhappy.

Skilled leadership

How do parliamentarians resolve such seemingly intractable problems? The answer is skilled leadership. The usual solution is to find a logroll.

You vote for my choice on this policy you hate, and I’ll vote for your policy on something else you really care about, even though I don’t like it.

We’re both better off at the end of the day because we each have at least something we want, rather than nothing. But feelings about Brexit now run too deep for logrolls. Hardcore right-wingers are unlikely to be bought off on Brexit by building more prisons, or dyed-in-the-wool liberals by legalising cannabis.

So a deal on Brexit is still on the table. This does depend, however, on Johnson realising he’s only pretending to play chicken with Brussels

What a good leader does in such an impasse is to find a way to make at least some of the losers happy – enough of them to get a solution through the democratic process without breaking all the rules and provoking a constitutional crisis. This is a fine art and requires exceptional political skill. We don’t yet know if Boris Johnson is a political artist of this quality.

He’s currently pretending to play a chicken game with Brussels. He bangs the table and bellows that he’s not going to swerve on the backstop, so if Brussels won’t swerve either there’ll be a crash and we’ll all get badly hurt. But Johnson is driving a Mini while Brussels is driving a bus – with Leo Varadkar sitting at the front of the top deck, looking anxiously out the window.

All of this is hopefully not a real do-or-die chicken game, more a Punch and Judy show to amuse hardcore supporters while the key players are all on holiday.

A little spin

EU negotiators still have a little something up their sleeves for when the holidays are over. They have to. They’d be criminally negligent if they didn’t. The beauty of that little something is that it’s not yet been made public.

If Johnson is a real leader he’ll work with EU negotiators, deeply behind the scenes, to shape that little something, whatever it is, into a form of words that will let at least some of the losers in the Brexit debate feel they’ve won after all. He can boast to his supporters that he’s won a new deal.

The EU can soothe other prime ministers by saying it’s just a “clarification” of the deal they all agreed to. If EU negotiators are smart they won’t say this too loudly in public and won’t care a fig what Johnson tells his supporters. Nobody wins a negotiation by rubbing the other side’s nose in the dirt.

So a deal on Brexit is still on the table. This does depend, however, on Johnson realising he’s only pretending to play chicken with Brussels. What he should be doing is listening carefully to his supporters so he can figure out how to spin that little something the EU surely still has up its sleeve, so he can make “winning” it seem like a great victory. When skilled negotiators get to work, everyone walks away a winner.

Michael Laver is professor of politics at New York University and a former professor of political science at Trinity College. He lives in London