In
logic
Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premises ...
, extensionality, or extensional equality, refers to principles that judge objects to be
equal if they have the same external properties. It stands in contrast to the concept of
intensionality
In any of several fields of study that treat the use of signs — for example, in linguistics, logic, mathematics, semantics, semiotics, and philosophy of language — an intension is any Property (philosophy), property or Quality (philosophy), ...
, which is concerned with whether the internal definitions of objects are the same.
Example
Consider the two
functions ''f'' and ''g'' mapping from and to
natural number
In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country").
Numbers used for counting are called ''Cardinal n ...
s, defined as follows:
* To find ''f''(''n''), first add 5 to ''n'', then multiply by 2.
* To find ''g''(''n''), first multiply ''n'' by 2, then add 10.
These functions are extensionally equal; given the same input, both functions always produce the same value. But the definitions of the functions are not equal, and in that intensional sense the functions are not the same.
Similarly, in natural language there are many predicates (relations) that are intensionally different but are extensionally identical. For example, suppose that a town has one person named Joe, who is also the oldest person in the town. Then, the two predicates "being called Joe", and "being the oldest person in this town" are intensionally distinct, but extensionally equal for the (current) population of this town.
In mathematics
The extensional definition of function equality, discussed above, is commonly used in mathematics. Sometimes additional information is attached to a function, such as an explicit
codomain
In mathematics, the codomain or set of destination of a function is the set into which all of the output of the function is constrained to fall. It is the set in the notation . The term range is sometimes ambiguously used to refer to either the ...
, in which case two functions must not only agree on all values, but must also have the same codomain, in order to be equal (in contrast, the usual definition of a function in mathematics means that equal functions must have the same
domain
Domain may refer to:
Mathematics
*Domain of a function, the set of input values for which the (total) function is defined
**Domain of definition of a partial function
**Natural domain of a partial function
**Domain of holomorphy of a function
* Do ...
).
A similar extensional definition is usually employed for
relations: two relations are said to be equal if they have the same
extensions
Extension, extend or extended may refer to:
Mathematics
Logic or set theory
* Axiom of extensionality
* Extensible cardinal
* Extension (model theory)
* Extension (predicate logic), the set of tuples of values that satisfy the predicate
* E ...
.
In
set theory
Set theory is the branch of mathematical logic that studies sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory, as a branch of mathematics, is mostly conce ...
, the
axiom of extensionality
In axiomatic set theory and the branches of logic, mathematics, and computer science that use it, the axiom of extensionality, or axiom of extension, is one of the axioms of Zermelo–Fraenkel set theory. It says that sets having the same elements ...
states that two
sets are equal if and only if they contain the same elements. In mathematics formalized in set theory, it is common to identify relations—and, most importantly,
functions—with their extension as stated above, so that it is impossible for two relations or functions with the same extension to be distinguished.
Other mathematical objects are also constructed in such a way that the intuitive notion of "equality" agrees with set-level extensional equality; thus, equal
ordered pair
In mathematics, an ordered pair (''a'', ''b'') is a pair of objects. The order in which the objects appear in the pair is significant: the ordered pair (''a'', ''b'') is different from the ordered pair (''b'', ''a'') unless ''a'' = ''b''. (In con ...
s have equal elements, and elements of a set which are related by an
equivalence relation
In mathematics, an equivalence relation is a binary relation that is reflexive, symmetric and transitive. The equipollence relation between line segments in geometry is a common example of an equivalence relation.
Each equivalence relation ...
belong to the same
equivalence class
In mathematics, when the elements of some set S have a notion of equivalence (formalized as an equivalence relation), then one may naturally split the set S into equivalence classes. These equivalence classes are constructed so that elements a ...
.
Type-theoretical foundations of mathematics are generally ''not'' extensional in this sense, and
setoid
In mathematics, a setoid (''X'', ~) is a set (or type) ''X'' equipped with an equivalence relation ~. A setoid may also be called E-set, Bishop set, or extensional set.
Setoids are studied especially in proof theory and in type-theoretic fou ...
s are commonly used to maintain a difference between intensional equality and a more general equivalence relation (which generally has poor
constructibility or
decidability properties).
See also
*
Duck typing
Duck typing in computer programming is an application of the duck test—"If it walks like a duck and it quacks like a duck, then it must be a duck"—to determine whether an object can be used for a particular purpose. With nominative t ...
*
Identity of indiscernibles
The identity of indiscernibles is an ontological principle that states that there cannot be separate objects or entities that have all their properties in common. That is, entities ''x'' and ''y'' are identical if every predicate possessed by ''x'' ...
*
Structural typing
A structural type system (or property-based type system) is a major class of type systems in which type compatibility and equivalence are determined by the type's actual structure or definition and not by other characteristics such as its name ...
*
Univalence axiom
In mathematical logic and computer science, homotopy type theory (HoTT ) refers to various lines of development of intuitionistic type theory, based on the interpretation of types as objects to which the intuition of (abstract) homotopy theory a ...
References
Intensional Logic (Stanford Encyclopedia of Philosophy)equalityin
nLab
{{Mathematical logic
Set theory
Concepts in logic
Equivalence (mathematics)