The chances that Britain will stay in the European Union increased slightly this week. It was no surprise that Michel Barnier, the EU negotiator, said that insufficient progress had been made to move to the next stage of the Brexit talks. But he also said the talks were “deadlocked”, which he found “disturbing”.

This may be tough talk for the purposes of negotiation, but it has the effect of turning a corner to find that a low murmur is actually the noise of a burning building. Those close to the negotiations have known this for months, but now we all know that what Theresa May set out in her Florence speech is not going to happen. We are heading for a deal pretty much on the EU’s terms – or no deal at all.

And the prospect of a “no deal” Brexit has concentrated minds. It caused a spat at Cabinet, when Philip Hammond refused to authorise spending to prepare for border checks that would be needed if we were shut out of the single market on 30 March 2019.

It also prompted Labour to restate its opposition to “no deal”. Jeremy Corbyn’s spokesperson said on Wednesday: “If the Government comes back with that outcome, we will seek to push for continued negotiations to get the kind of deal that’s in the interests of the country.”

Labour said in its manifesto that “we will reject” no deal, but it remains unclear what this means. It could mean sending David Davis back for more talks before the deadline expires, or it could mean trying to extend the deadline. But extending the deadline would require the EU27 to agree – which they may do only if they thought it was a way of averting Brexit altogether.

All of which creates just enough uncertainty to keep Corbyn’s options open, despite his insistence (echoing Theresa May) that Brexit will happen.

Here is how it could be stopped: the only plausible way of reversing the decision of the referendum is to hold another one. For that to be possible, three things need to happen.

Jean-Claude Juncker: Brexit will take longer than initially thought

Firstly, public opinion has to shift. This week’s YouGov poll showing more people think Brexit was the “wrong decision” could be the start of a sustained movement that could pave the way for the other two things.

The next thing that needs to happen is Corbyn changing Labour’s policy. He said this week that there will be no second referendum, but this may have been a way of trying to play down his answer as to how he would vote if there were one. In any case, it may be wise for him to hold back from supporting another referendum until the pressure for one increases.

That pressure is likely to grow. As Andrew Grice wrote yesterday, on the question of Europe Corbyn is “unlikely to lead public opinion, but might follow it”.

There is also the opinion in the Labour Party that it is one thing to be in favour of Brexit, but another to support it on Tory terms.

Harold Wilson came under pressure in 1971 to oppose “Tory terms” for joining the European Economic Community. By the summer of 1972, he had taken refuge in the policy of renegotiation followed by a referendum, which held the Labour Party together and resulted in the 1975 vote to stay in the EEC.

The third thing that needs to happen is that an amendment to Brexit legislation requiring a second referendum has a prospect of getting through the Commons. That means reminding pro-EU Tories that they can vote for a referendum without bringing down the Government.

There have to be enough of them to cancel out Labour’s Eurosceptics, but there are many more pro-EU Tories than the well-known quartet of Kenneth Clarke, Anna Soubry, Nicky Morgan and Dominic Grieve. Many are ministers, but enough of them may put what they see as the national interest ahead of keeping their jobs.

Theresa May caught in Brexit trap after EU leaders block future trade talks

The Commons arithmetic would become easier if the DUP’s 10 MPs took refuge in another referendum as the way to solve their party’s contradictory position. At the moment, it wants to leave the EU single market and keep an open border between Northern Ireland and the Republic. Something has to give, and this might be it.

If those three things happen, Theresa May will not be in control of events. As I have pointed out before, the Government does not control the House of Lords. The EU Withdrawal Bill is expected to arrive in the Lords in February. That is probably too early for an attempt to go for a second referendum, given that the shape of any deal won’t be known until early summer 2018. But there are several other Brexit bills in the the pipeline, and the Lords can amend any of them.

If that happens, the Commons will be forced to vote to remove – or keep – the Lords amendment.