The actual procedure hasn't been perfect (six months turns out to be too short a period to negotiate a future relationship from scratch, and there are some awkward game theory problems with extensions to that period needing unanimous approval) but the principle that a state can leave is both clearly written down and entirely uncontested. Disagreements have been about the scope of the future relationship, not the principle that the UK can leave and have the treaties cease to apply.