Can Parliament stop a no-deal Brexit in autumn? With Boris Johnson looking likely to win the Conservative leadership election on a platform of leaving the EU on 31 October, "do or die," this is now one of the most important questions in UK politics. We know there is a comfortable parliamentary majority against no-deal in principle — it was defeated by 400 votes to 160 in the indicative votes process. But practical attempts to block no-deal have seen much tighter margins, and there are also well-documented procedural obstacles to blocking no-deal in practice. Ultimately, MPs may have to reach for the nuclear option — bringing the government down in a vote of no confidence. The parliamentary arithmetic in such a scenario is extraordinarily tight.

Back in January, Theresa May comfortably saw off a no confidence vote tabled by Jeremy Corbyn by 327-308 — a majority of 19 (including two tellers for each side). However, the parliamentary arithmetic is now far tighter. Four Conservative MPs — Anna Soubry, Sarah Wollaston, Heidi Allen and Nick Boles -- have resigned the whip. A fifth, Chris Davies, looks likely to lose his seat to the Liberal Democrats in the Brecon and Radnorshire by-election.

Assuming the Lib Dems take Brecon, the new Prime Minister will nominally be able to call on 321 MPs for confidence matters (311 Conservatives, plus the DUP), while the combined weight of all opposition MPs would stand at 318. That means a successful no confidence vote would require just two Tory MPs to actively vote for it (or four to abstain) if all opposition MPs remain united. This raises two questions: are enough Conservative MPs prepared to bring down their own Government to prevent no-deal, and could any opposition MPs counteract them by going the other way.

On the Tory side, the former Attorney General Dominic Grieve is the obvious candidate. Just a month ago, he told the House of Commons he "will not hesitate" to bring down the government to stop no-deal without parliamentary approval. Beyond him, though, the picture is less clear. Father of the House Ken Clarke had suggested he might back a no confidence vote as a last resort, but subsequently rowed back. A handful of other MPs have publicly put themselves in "not ruling it out" territory, including Philip Lee, Antoinette Sandbach, Margot James, Roger Gale and even Philip Hammond, though only Lee and Sandbach have a track record of rebellion on Brexit. Keep an eye, too, on Guto Bebb, the second referendum advocate announced yesterday that he will not stand again as a Conservative MP, and may therefore feel that he has little to lose. Other anti-no-dealers have already said they will not support a no confidence vote, a position that British Future's Sunder Katwala has christened "the Meat Loaf Caveat" ("I would do anything to stop no-deal, but I won't do that").

Even those who have floated the possibility of a no confidence vote may not put their money where their mouth is. Voting no confidence in one's own government is a huge, likely career-ending decision for any MP to make. Tory MPs currently hope to avoid the choice entirely; Antoinette Sandbach probably spoke for several when she said recently, "I would not like to vote against my government in a vote of no confidence. I would probably try and support any other mechanism for making sure that no-deal didn't happen." Any no confidence vote at the start of September is unlikely to pass, as Conservative MPs won't feel that they have exhausted all other options or given their new party leader a chance. The new Prime Minister's first European Council summit, for example, is not until 16 October. But by then, it might be too late, even a successful no confidence vote after 3 September would not leave enough time for a general election before 31 October. In that scenario, MPs would have to rely on the Prime Minister asking for and securing an extension to Article 50.

The other crucial piece of the jigsaw is the behaviour of opposition MPs. For instance, if just two opposition MPs abstained, the magic number of Tory rebels needed jumps from two (plausible) to four (much more challenging).

All opposition parties will whip in favour of no confidence, including Change UK who have recently clarified that their earlier position of opposing no confidence motions does not apply in a "stop no-deal" scenario. You might think that the Government could rely, as it has before, on a small number of Leave-supporting Labour MPs. But no confidence motions are fundamentally partisan. For any Labour MP to oppose the chance of a Labour Government on the altar of a no-deal Brexit would be career-ending. The question, therefore, is whether any Labour MPs are as committed to delivering a no-deal Brexit as Dominic Grieve is to preventing it. Most of the Labour Leave MPs are not no-dealers — only three supported it in indicative votes (Kate Hoey, Dennis Skinner and Ronnie Campbell), and of these, Skinner and Campbell are left-wing Eurosceptics who would never desert Jeremy Corbyn in a confidence vote in a million years. That only leaves Hoey, a committed no-dealer who is stepping down at the next election anyway and has nothing to lose. If she does rebel, she will almost certainly be in a minority of one as far as Labour MPs are concerned.

A more difficult group to predict is the 15-strong contingent of independent MPs, who have a diverse set of views on Brexit and other political issues. In a no-deal context, at least 10 of the 15 can almost certainly be ruled out from propping up the government. The five former Change UK MPs, for example, are committed Remainers -- and the two ex-Conservatives among them (Allen and Wollaston) have already said they would support a no confidence motion in a no-deal context. Ex-Conservative Nick Boles has made a similar commitment. Stephen Lloyd may have resigned the Lib Dem whip to vote for May's deal in January, but he also supported the previous no confidence motion just a day later and has supported most anti-no-deal measures. Ex-Labour MP Jared O'Mara supports a second referendum. As for the two Labour MPs suspended for disciplinary issues, Chris Williamson remains a staunch Corbyn loyalist, while left-wing Brexiteer Kelvin Hopkins is in the same category as Ronnie Campbell and Dennis Skinner - he might rebel on Brexit legislation, but not on a confidence vote.

In January's no confidence vote, the May Government was supported by Sylvia Hermon, an independent unionist MP from Northern Ireland. However, although Hermon is an avowed opponent of a Corbyn-led Government, she also believes no-deal is a threat to the union and she might not support Johnson as she did May. The government's majority in January was also bolstered by abstentions from two anti-Corbyn former Labour MPs, John Woodcock and Ivan Lewis. Woodcock has since aligned himself to pro-Remain MPs in the new "Independents" caucus, so a second abstention from him seems unlikely — provided that the no confidence motion can be decoupled from the prospect of a Corbyn-led government. Lewis, on the other hand, favours delivering Brexit (though not via no-deal), and remains an important swing vote.

That leaves two former Labour MPs sitting as independents, Frank Field and Ian Austin. From the Government's point of view, they are potential allies. Both detest Jeremy Corbyn (having resigned the whip over anti-Semitism), and both are committed to delivering Brexit. While neither actually supports no-deal, they have also been unwilling to support many of the parliamentary measures aimed at preventing it. However, their historical Labour roots remain important to them. Field, in particular, is a fierce critic of the Government's approach to welfare, and supported January's no confidence vote as an independent. As with Hermon, Woodcock and Lewis, much will ride on whether or not Austin and Field see a no confidence vote as a tacit endorsement of a Corbyn government. Reports suggest some of them are already agonising over the choice.

Ultimately, the number of potential confidence rebels on both sides of the Commons is tiny — even a generous estimate suggests less than half a dozen swing votes on either side. Given that the Government has more votes to begin with, the opposition is at a slight disadvantage — essentially, they need the number of Tory rebels to be two more than the number of opposition rebels. When every vote counts, the political context will be crucial. To win, a successful no confidence motion will need to do two things. First, it needs to persuade enough Tory MPs that it is their last, and only, chance to stop no-deal. And second, a confidence motion will only win if the idea of bringing down a no-deal government is sufficiently distanced from the prospect of a Corbyn government, not just to ensure buy-in from Tory rebels, but also to keep anti-Corbyn independents like Hermon, Woodcock and Austin on board.

Timing is crucial here too — if Tory Remainers and anti-Corbyn independent MPs have an excuse to tell themselves that a no confidence motion is about stopping Corbyn rather than stopping no-deal, most of them will probably take it.

Dominic Walsh is a Policy Analyst at the think-tank Open Europe. He tweets @DomWalsh13