There is much confusion about this question and many of the supporters of Brexit claim that an à la carte arrangement can be crafted for the UK to trade with the EU without having to accept free movement of people. Others hope that a second referendum to confirm or cancel Brexit may be possible.
Interpretation of Article 50 of the Lisbon Treaty should help.
Paragraph 2: A member state [the UK] may give notice of withdrawal. Negotiations will occur “taking account of the framework for its [the UK’s] future relationship with the Union”. Agreement will be reached by Council qualified majority, excluding the exiting member state [meaning that at least 4 member states representing at least 28% of the EU’s population - (i.e. 0.28*440M=123million) - may veto an agreement]. The European Parliament or the UK government may also veto an agreement.
[The European Parliament or member states containing at least 123 million people could block an agreement that does not respect free movement of people. A further intracacy is that until March 2017, a member state can ask for Council votes to take place under the old pre-Lisbon voting system. This would mean that a qualified majority could be blocked instead by 85 out of 323 votes on the Council or by 10 member states if they collectively have fewer than 85 votes. If agreement is easier under the old system, there will be a time pressure to conclude negotiations before March 2017.]
Paragraph 3: The UK exits on the date the agreement comes into force. If there is no agreement, the UK exits without an agreement and is outside the EU treaties exactly two years after giving notice. [The UK could exit before the two years are up if this is part of an agreement.] The only way to stop this is if the Council (all 27 plus the UK) unanimously agrees to continue the talks beyond the two-year cut-off point.
Paragraph 4: During the negotiations, the UK will be absent from meetings where the EU’s governments decide their position.
Article 50 is deliberately non-committal as to whether a member state could cancel its notice of withdrawal before the two years are up if it changes its mind, for example, through a second referendum. Indeed, if the referendum result is for LEAVE, then it is difficult to see how the British government could delay giving formal notice while hoping to secure concessions from the EU that would allow a re-run of the referendum.
If the UK does indeed leave without an agreement, it would find itself outside all of the EU’s projects and market, including scientific research. Access to these would need to be negotiated one by one with no guarantee of success. Without an agreement on free movement of people, British expatriates resident in other member states of the EU may have their rights of residency withdrawn if the rights of EU nationals resident in the UK are also affected.
Article 50 appears below:
1. Any Member State may decide to withdraw from the Union in accordance with its own constitutional requirements.
2. A Member State which decides to withdraw shall notify the European Council of its intention. In the light of the guidelines provided by the European Council, the Union shall negotiate and conclude an agreement with that State, setting out the arrangements for its withdrawal, taking account of the framework for its future relationship with the Union. That agreement shall be negotiated in accordance with Article 218(3) of the Treaty on the Functioning of the European Union. It shall be concluded on behalf of the Union by the Council, acting by a qualified majority, after obtaining the consent of the European Parliament.
3. The Treaties shall cease to apply to the State in question from the date of entry into force of the withdrawal agreement or, failing that, two years after the notification referred to in paragraph 2, unless the European Council, in agreement with the Member State concerned, unanimously decides to extend this period.
4. For the purposes of paragraphs 2 and 3, the member of the European Council or of the Council representing the withdrawing Member State shall not participate in the discussions of the European Council or Council or in decisions concerning it.
A qualified majority shall be defined in accordance with Article 238(3)(b) of the Treaty on the Functioning of the European Union.
5. If a State which has withdrawn from the Union asks to rejoin, its request shall be subject to the procedure referred to in Article 49.