# Generalized quantifier

In formal semantics, a generalized quantifier (GQ) is an expression that denotes a set of sets. This is the standard semantics assigned to quantified noun phrases. For example, the generalized quantifier every boy denotes the set of sets of which every boy is a member: $\{X\mid \forall x(x{\text{ is a boy}}\to x\in X)\}$
This treatment of quantifiers has been essential in achieving a compositional semantics for sentences containing quantifiers.

## Type theory

A version of type theory is often used to make the semantics of different kinds of expressions explicit. The standard construction defines the set of types recursively as follows:
* e and t are types.
* If a and b are both types, then so is $\langle a,b\rangle$
* Nothing is a type, except what can be constructed on the basis of lines 1 and 2 above.
Given this definition, we have the simple types e and t, but also a countable infinity of complex types, some of which include: $\langle e,t\rangle ;\qquad \langle t,t\rangle ;\qquad \langle \langle e,t\rangle ,t\rangle ;\qquad \langle e,\langle e,t\rangle \rangle ;\qquad \langle \langle e,t\rangle ,\langle \langle e,t\rangle ,t\rangle \rangle ;\qquad \ldots$
* Expressions of type e denote elements of the universe of discourse, the set of entities the discourse is about. This set is usually written as $D_{e}$. Examples of type e expressions include John and he.
* Expressions of type t denote a truth value, usually rendered as the set $\{0,1\}$, where 0 stands for "false" and 1 stands for "true". Examples of expressions that are sometimes said to be of type t are sentences or propositions.
* Expressions of type $\langle e,t\rangle$ denote functions from the set of entities to the set of truth values. This set of functions is rendered as $D_{t}^{D_{e}}$. Such functions are characteristic functions of sets. They map every individual that is an element of the set to "true", and everything else to "false." It is common to say that they denote sets rather than characteristic functions, although, strictly speaking, the latter is more accurate. Examples of expressions of this type are predicates, nouns and some kinds of adjectives.
* In general, expressions of complex types $\langle a,b\rangle$ denote functions from the set of entities of type $a$ to the set of entities of type $b$, a construct we can write as follows: $D_{b}^{D_{a}}$.
We can now assign types to the words in our sentence above (Every boy sleeps) as follows.
* Type(boy) = $\langle e,t\rangle$
* Type(sleeps) = $\langle e,t\rangle$
* Type(every) = $\langle \langle e,t\rangle ,\langle \langle e,t\rangle ,t\rangle \rangle$
* Type(every boy) = $\langle \langle e,t\rangle ,t\rangle$
and so we can see that the generalized quantifier in our example is of type $\langle \langle e,t\rangle ,t\rangle$
Thus, every denotes a function from a set to a function from a set to a truth value. Put differently, it denotes a function from a set to a set of sets. It is that function which for any two sets A,B, every(A)(B)= 1 if and only if $A\subseteq B$.

## Typed lambda calculus

A useful way to write complex functions is the lambda calculus. For example, one can write the meaning of sleeps as the following lambda expression, which is a function from an individual x to the proposition that x sleeps. $\lambda x.\mathrm {sleep} '(x)$ Such lambda terms are functions whose domain is what precedes the period, and whose range are the type of thing that follows the period. If x is a variable that ranges over elements of $D_{e}$, then the following lambda term denotes the identity function on individuals: $\lambda x.x$
We can now write the meaning of every with the following lambda term, where X,Y are variables of type $\langle e,t\rangle$: $\lambda X.\lambda Y.X\subseteq Y$
If we abbreviate the meaning of boy and sleeps as "B" and "S", respectively, we have that the sentence every boy sleeps now means the following: $(\lambda X.\lambda Y.X\subseteq Y)(B)(S)$ By β-reduction, $(\lambda Y.B\subseteq Y)(S)$ and $B\subseteq S$
The expression every is a determiner. Combined with a noun, it yields a generalized quantifier of type $\langle \langle e,t\rangle ,t\rangle$.

## Properties
### Monotonicity
#### Monotone increasing GQs

A generalized quantifier GQ is said to be monotone increasing (also called upward entailing) if, for every pair of sets X and Y, the following holds:
    if $X\subseteq Y$, then GQ(X) entails GQ(Y).
The GQ every boy is monotone increasing. For example, the set of things that run fast is a subset of the set of things that run. Therefore, the first sentence below entails the second:
* Every boy runs fast.
* Every boy runs.

#### Monotone decreasing GQs

A GQ is said to be monotone decreasing (also called downward entailing) if, for every pair of sets X and Y, the following holds:
    If $X\subseteq Y$, then GQ(Y) entails GQ(X).
An example of a monotone decreasing GQ is no boy. For this GQ we have that the first sentence below entails the second.
* No boy runs.
* No boy runs fast.
The lambda term for the determiner no is the following. It says that the two sets have an empty intersection. $\lambda X.\lambda Y.X\cap Y=\emptyset$ Monotone decreasing GQs are among the expressions that can license a negative polarity item, such as any. Monotone increasing GQs do not license negative polarity items.
* Good: No boy has any money.
* Bad: *Every boy has any money.

#### Non-monotone GQs

A GQ is said to be non-monotone if it is neither monotone increasing nor monotone decreasing. An example of such a GQ is exactly three boys. Neither of the following sentences entails the other.
* Exactly three students ran.
* Exactly three students ran fast.
The first sentence does not entail the second. The fact that the number of students that ran is exactly three does not entail that each of these students ran fast, so the number of students that did that can be smaller than 3. Conversely, the second sentence does not entail the first. The sentence exactly three students ran fast can be true, even though the number of students who merely ran (i.e. not so fast) is greater than 3.
The lambda term for the (complex) determiner exactly three is the following. It says that the cardinality of the intersection between the two sets equals 3. $\lambda X.\lambda Y.|X\cap Y|=3$

### Conservativity

A determiner D is said to be conservative if the following equivalence holds: $D(A)(B)\leftrightarrow D(A)(A\cap B)$ For example, the following two sentences are equivalent.
* Every boy sleeps.
* Every boy is a boy who sleeps.
It has been proposed that all determiners—in every natural language—are conservative. The expression only is not conservative. The following two sentences are not equivalent. But it is, in fact, not common to analyze only as a determiner. Rather, it is standardly treated as a focus-sensitive adverb.
* Only boys sleep.
* Only boys are boys who sleep.