This is probably best discussed in a separate thread Ant_222. Nevertheless,
In the case of modalities (
can, may , must, etc.), negation may apply to the modality or to the residue (the proposition)..
Let's start with
You have to do it. (
You must do it.)
Negating the modality gives:
You don't have to do it. (
You need not do it.) (
You are permitted/allowed not to do it.)
Negating the residue gives:
You must not do it. (
You are not permitted/allowed to do it.)
Each modal verb has its own way of acting when
not is added, and it can depend on the context of the modal verb as well. Typically,
must not negates the residue, and
need not negates the modality, to mention just two.
CJ