Inversions after negative adverbials
There are some words and phrases that function as adverbials that sometimes need an inversion. Look at these two sentences.
Bob rarely speaks to himself.
Rarely does Bob speak to himself.
The adverb here is "rarely". If it comes after the subject, there is no inversion (as in the first sentence), but if it comes before the subject, we need an inversion. The word order is inverted and in the case of the sentence about Bob we use the auxiliary verb "does" in the same way we do in questions (although this isn't a question).
The sentence with the inversion sounds more formal or more literary, and sentences like this are less common in ordinary conversation.
Here are some examples with other phrases used in the same way.
does Bob get invited to parties.
(seldom = rarely)
Never have we seen such a breathtaking view.
At no time did the prisoner look as if he might confess.
Not only is she a great dancer but she is also an amazing mathematician.
Not until she took up rock climbing did she overcome her fear of heights.
Under no circumstances* will prisoners be allowed to give interviews to the media.
Little** did she realize that her grandmother was really a wolf.
* This is used to describe rules for which there are no exceptions. The alternative without the inversion is: Prisoners will not be allowed to give interviews to the media under any circumstances.
** This means that the girl didn't realize at all that her grandmother was really a wolf.
N.B. Remember that no inversion is possible if the adverbial doesn't come before the subject. Compare the following sentences with the corresponding sentences above.
She is not only a great dancer but she is also an amazing mathematician.
It was not until Effie left Brooklyn that she realized how attached she had become to the
The following three are used to describe an event that happened immediately after another.
had he stepped outside when it started to rain.
Scarcely had he stepped outside when it started to rain.
No sooner had he stepped outside than it started to rain.
Note that the past perfect tense is used to describe the event that happened first.