Subject–auxiliary inversion
Subject–auxiliary inversion (SAI; also called subject–operator inversion) is a frequently occurring type of inversion in English, whereby a finite auxiliary verb – taken here to include finite forms of the copula be – appears to "invert" (change places) with the subject. The word order is therefore Aux-S (auxiliary–subject), which is the opposite of the canonical SV (subject–verb) order of declarative clauses in English. The most frequent use of subject–auxiliary inversion in English is in the formation of questions, although it also has other uses, including the formation of condition clauses, and in the syntax of sentences beginning with negative expressions (negative inversion). In certain types of English sentences, inversion is also possible with verbs other than auxiliaries; these are described in the article on subject-verb inversion. Overview
Subject–auxiliary inversion involves placing the subject after a finite auxiliary verb, rather than before it as is the case in typical declarative sentences (the canonical word order of English being subject–verb–object). The auxiliary verbs which may participate in such inversion (e.g. is, can, have, will, etc.) are described at English auxiliaries and contractions. Note that forms of the verb be are included regardless of whether or not they function as auxiliaries in the sense of governing another verb form. (For exceptions to this restriction, see  below.) A typical example of subject–auxiliary inversion is given below. a. Sam has read the paper. b. Has Sam read the paper? Here the subject is Sam, and the verb has is an auxiliary. In the question, these two elements change places (invert). If the sentence does not have an auxiliary verb, this type of simple inversion is not possible. Instead, an auxiliary must be introduced into the sentence in order to allow inversion:
 
a. Sam enjoys the paper. b. *Enjoys Sam the paper? c. Sam does enjoy the paper. d. Does Sam enjoy the paper? For details of the use of do, did and does for this and similar purposes, see do-support. For exceptions to the principle that the inverted verb must be an auxiliary, see  below. It is also possible for the subject to invert with a negative contraction (can't, isn't, etc.). For example:

a. He isn't nice. b. Isn't he nice? Compare this with the uncontracted form Is he not nice? and the archaic Is not he nice?. Uses of subject–auxiliary inversion
The main uses of subject–auxiliary inversion in English are described in the following sections, although other types can occasionally be found. Most of these uses of inversion are restricted to main clauses; they are not found in subordinate clauses. However other types (such as inversion in condition clauses) are specific to subordinate clauses. In questions
The most common use of subject–auxiliary inversion in English is in question formation. It appears in yes–no questions:

a. Sam has read the paper. b. Has Sam read the paper? and also in questions introduced by other interrogative words (wh-questions):

a. Sam is reading the paper. b. What is Sam reading? Inversion does not occur, however, when the interrogative word is the subject or is contained in the subject. In this case the subject remains before the verb (it can be said that wh-fronting takes precedence over subject–auxiliary inversion):

a. Somebody has read the paper. b. Who has read the paper? c. Which fool has read the paper? Inversion also does not normally occur in indirect questions, where the question is no longer in the main clause, due to the penthouse principle. For example:

a. "What did Sam eat? ", Cathy wonders. b. *Cathy wonders what did Sam eat. c. Cathy wonders what Sam ate. Similarly:

a. We asked whether Tom had left. b. *We asked whether had Tom left. Negative inversion
Another use of subject–auxiliary inversion is in sentences which begin with certain types of expressions which contain a negation or have negative force. For example,

a. Jessica will say that at no time. b. At no time will Jessica say that. c. Only on Mondays will Jessica say that. This is described in detail at negative inversion. Inversion in condition clauses
Subject–auxiliary inversion can be used in certain types of subordinate clause expressing a condition:

a. If the general had not ordered the advance,...
b. Had the general not ordered the advance,... Note that when the condition is expressed using inversion, the conjunction if is omitted. More possibilities are given at . Other cases
Subject–auxiliary inversion is used after the anaphoric particle so, mainly in elliptical sentences. The same frequently occurs in elliptical clauses beginning with as. a. Fred fell asleep, and Jim did too. b. Fred fell asleep, and so did Jim. c. Fred fell asleep, as did Jim. Inversion also occurs following an expression beginning with so or such, as in:

a. We felt so tired (such tiredness) that we fell asleep. b. So tired (Such tiredness) did we feel that we fell asleep. Subject–auxiliary inversion may optionally be used in elliptical clauses introduced by the particle of comparison than:
 
a. Sally knows more languages than her father does. b. Sally knows more languages than does her father. Inversion with other types of verb

There are certain sentence patterns in English in which subject–verb inversion takes place where the verb is not restricted to an auxiliary verb. Here the subject may invert with certain main verbs, e.g. After the pleasure comes the pain, or with a chain of verbs, e.g. In the box will be a bottle. These are described in the article on subject-verb inversion. Further, inversion was not limited to auxiliaries in older forms of English. Examples of non-auxiliary verbs being used in typical subject–auxiliary inversion patterns may be found in older texts or in English written in an archaic style:

Know you what it is to be a child? (Francis Thompson)

The verb have, when used to denote broadly defined possession (and hence not as an auxiliary), is still sometimes used in this way in modern standard English:

Have you any idea what this would cost? Inversion as a remnant of V2 word order
In some cases of subject–auxiliary inversion, such as negative inversion, the effect is to put the finite auxiliary verb into second position in the sentence. In these cases, inversion in English results in word order that is like the V2 word order of other Germanic languages (Danish, Dutch, Frisian, Icelandic, German, Norwegian, Swedish, Yiddish, etc.). These instances of inversion are remnants of the V2 pattern that formerly existed in English as it still does in its related languages. Old English followed a consistent V2 word order. Structural analyses
Syntactic theories based on phrase structure typically analyze subject-aux inversion using syntactic movement. In such theories, a sentence with subject-aux inversion has an underlying structure where the auxiliary is embedded deeper in the structure. When the movement rule applies, it moves the auxiliary to the beginning of the sentence. An alternative analysis does not acknowledge the binary division of the clause into subject NP and predicate VP, but rather it places the finite verb as the root of the entire sentence and views the subject as switching to the other side of the finite verb. No discontinuity is perceived. Dependency grammars are likely to pursue this sort of analysis. The following dependency trees illustrate how this alternative account can be understood:

These trees show the finite verb as the root of all sentence structure. The hierarchy of words remains the same across the a- and b-trees. If movement occurs at all, it occurs rightward (not leftward); the subject moves rightward to appear as a post-dependent of its head, which is the finite auxiliary verb. See also

Auxiliary verb
Discontinuity
Inverse copular constructions
Inversion
Negative inversion
Subject-verb inversion
V2 word order

Notes

References

Adger, D. 2003. Core syntax:A minimalist approach. Oxford, UK: Oxford University Press. Bach, E. 1974. Syntactic theory. New York: Holt, Rinehart and Winston, Inc.
Culicover, P. 1997. Principles and parameters: An introduction to syntactic theory. Oxford, UK: Oxford University Press. Downing, A. and Locke, P. 1992. English grammar: A university course, second edition. London: Routledge. Greenbaum, S. and R. Quirk. 1990. A student's grammar of the English language. Harlow, Essex, England: Longman. Groß, T. and T. Osborne 2009. Toward a practical dependency grammar theory of discontinuities. SKY Journal of Linguistics 22, 43-90. Hudson, R. English Word Grammar. 1990. Oxford, UK: Blackwell. Lockwood, D. 2002. Syntactic analysis and description: A constructional approach. London: continuum. Ouhalla, J. 1994. Transformational grammar: From rules to principles and parameters. London: Edward Arnold. Quirk, R. S. Greenbaum, G. Leech, and J. Svartvik. 1979. A grammar of contemporary English. London: Longman. Radford, A. 1988. Transformational Grammar: A first course. Cambridge, UK: Cambridge University Press. Radford, A. 2004. English syntax: An introduction.Cambridge University Press. English grammar
Syntactic entities
Syntactic transformation
Word order