In predicate logic, a universal quantification is a type of quantifier, a logical constant which is interpreted as "given any" or "for all". It expresses that a propositional function can be satisfied by every member of a domain of discourse. In other words, it is the predication of a property or relation to every member of the domain. It asserts that a predicate within the scope of a universal quantifier is true of every value of a predicate variable.
It is usually denoted by the turned A (?) logical operator symbol, which, when used together with a predicate variable, is called a universal quantifier ("?x", "?(x)", or sometimes by alone). Universal quantification is distinct from existential quantification ("there exists"), which only asserts that the property or relation holds for at least one member of the domain.
Quantification in general is covered in the article on quantification (logic). Symbols are encoded ∀ FOR ALL (HTML
∀ · as a mathematical symbol).
Suppose it is given that
2·0 = 0 + 0, and 2·1 = 1 + 1, and 2·2 = 2 + 2, etc.
For all natural numbers n, 2·n = n + n.
This is a single statement using universal quantification.
This statement can be said to be more precise than the original one. While the "etc." informally includes natural numbers, and nothing more, this was not rigorously given. In the universal quantification, on the other hand, the natural numbers are mentioned explicitly.
This particular example is true, because any natural number could be substituted for n and the statement "2·n = n + n" would be true. In contrast,
For all natural numbers n, 2·n > 2 + n
is false, because if n is substituted with, for instance, 1, the statement "2·1 > 2 + 1" is false. It is immaterial that "2·n > 2 + n" is true for most natural numbers n: even the existence of a single counterexample is enough to prove the universal quantification false.
On the other hand, for all composite numbers n, 2·n > 2 + n is true, because none of the counterexamples are composite numbers. This indicates the importance of the domain of discourse, which specifies which values n can take.[note 1] In particular, note that if the domain of discourse is restricted to consist only of those objects that satisfy a certain predicate, then for universal quantification this requires a logical conditional. For example,
For all composite numbers n, 2·n > 2 + n
is logically equivalent to
For all natural numbers n, if n is composite, then 2·n > 2 + n.
Here the "if ... then" construction indicates the logical conditional.
For example, if P(n) is the predicate "2·n > 2 + n" and N is the set of natural numbers, then:
is the (false) statement:
For all natural numbers n, 2·n > 2 + n.
Similarly, if Q(n) is the predicate "n is composite", then
is the (true) statement:
For all natural numbers n, if n is composite, then 2·n > 2 + n
and since "n is composite" implies that n must already be a natural number, we can shorten this statement to the equivalent:
For all composite numbers n, 2·n > 2 + n.
Several variations in the notation for quantification (which apply to all forms) can be found in the quantification article. There is a special notation used only for universal quantification, which is given:
The parentheses indicate universal quantification by default.
Note that a quantified propositional function is a statement; thus, like statements, quantified functions can be negated. The notation most mathematicians and logicians utilize to denote negation is: . However, some use the tilde (~).
For example, if P(x) is the propositional function "x is married", then, for a universe of discourse X of all living human beings, the universal quantification
Given any living person x, that person is married
It can be seen that this is irrevocably false. Truthfully, it is stated that
It is not the case that, given any living person x, that person is married
If the statement is not true for every element of the Universe of Discourse, then, presuming the universe of discourse is non-empty, there must be at least one element for which the statement is false. That is, the negation of is logically equivalent to "There exists a living person x who is not married", or:
Generally, then, the negation of a propositional function's universal quantification is an existential quantification of that propositional function's negation; symbolically,
It is erroneous to state "all persons are not married" (i.e. "there exists no person who is married") when it is meant that "not all persons are married" (i.e. "there exists a person who is not married"):
A rule of inference is a rule justifying a logical step from hypothesis to conclusion. There are several rules of inference which utilize the universal quantifier.
Universal instantiation concludes that, if the propositional function is known to be universally true, then it must be true for any arbitrary element of the universe of discourse. Symbolically, this is represented as
where c is a completely arbitrary element of the universe of discourse.
Universal generalization concludes the propositional function must be universally true if it is true for any arbitrary element of the universe of discourse. Symbolically, for an arbitrary c,
The element c must be completely arbitrary; else, the logic does not follow: if c is not arbitrary, and is instead a specific element of the universe of discourse, then P(c) only implies an existential quantification of the propositional function.
By convention, the formula is always true, regardless of the formula P(x); see vacuous truth.
The universal closure of a formula ? is the formula with no free variables obtained by adding a universal quantifier for every free variable in ?. For example, the universal closure of
In category theory and the theory of elementary topoi, the universal quantifier can be understood as the right adjoint of a functor between power sets, the inverse image functor of a function between sets; likewise, the existential quantifier is the left adjoint.
For a set , let denote its powerset. For any function between sets and , there is an inverse image functor between powersets, that takes subsets of the codomain of f back to subsets of its domain. The left adjoint of this functor is the existential quantifier and the right adjoint is the universal quantifier .
That is, is a functor that, for each subset , gives the subset given by
those in the image of under . Similarly, the universal quantifier is a functor that, for each subset , gives the subset given by
those whose preimage under is contained in .
The more familiar form of the quantifiers as used in first-order logic is obtained by taking the function f to be the unique function so that is the two-element set holding the values true and false, a subset S is that subset for which the predicate holds, and
which is true if is not empty, and
which is false if S is not X.
The universal and existential quantifiers given above generalize to the presheaf category.