Set-builder notation

From Wikipedia, the free encyclopedia

(Redirected from Set abstraction)
Jump to: navigation, search

In set theory and its applications to logic, mathematics, and computer science, set-builder notation (or commonly, "set notation") is a mathematical notation for describing a set by stating the properties that its members must satisfy. Forming sets in this manner is also known as set comprehension, set abstraction or as defining a set's intension.

Contents

Let Φ(x) be a schematic formula in which x appears free. Set builder notation has the form {x : Φ(x)} (some write {x | Φ(x)}), denoting the set of all individuals in the universe of discourse satisfying the predicate Φ(x), that is, the set whose members are every individual x such that Φ(x) is true. Set builder notation binds the variable x and must be used with the same care applied to variables bound by quantifiers.

Examples (the universe of discourse can be taken to be, for example, all complex numbers):

The \and sign stands for and, requiring both conditions be fulfilled simultaneously. It is often replaced by a comma (,) semicolon (;) or written out as and. Alternatively, sets of the form \{ x : x \in X \and \phi(x) \} can be written as \{ x \in X : \phi(x) \}. The set of positive real numbers would then be notated \{ x \in \mathbb{R} : x > 0 \} .

Let {S : S is a set and S does not belong to S} denote the set of all sets that do not belong to themselves. This set cannot exist; Russell's paradox explains why.

Solutions to the paradox restrict set -builder notation in certain ways. Let X={x in A : P(x)} denote the set of every element of A satisfying the predicate P(x). The canonical restriction on set builder notation asserts that X is a set only if A is already known to be a set. This restriction is codified in the axiom schema of separation present in standard axiomatic set theory. Note that this axiom schema excludes {S : S is a set and S does not belong to S} from sethood.

The notation can be complicated, especially as in the previous example, and abbreviations are often employed when context indicates the nature of a variable. For example:

  • {x : x > 0}, in a context where the variable x is used only for real numbers, indicates the set of all positive real numbers;
  • {p/q : q is not zero}, in a context where the variables p and q are used only for integers, indicates the set of all rational numbers; and
  • {S : S does not belong to S}, in a context where the variable S is used only for sets, indicates the set of all sets that don't belong to themselves.

As the last example shows, such an abbreviated notation again might not denote an actual nonparadoxical set, unless there is in fact a set of all objects that might be described by the variable in question.

Another variation on set-builder notation describes the members of the set in terms of members of some other set. Specifically, {F(x) : x in A}, where F is a function symbol and A is a previously defined set, indicates the set of all values of members of A under F. For example:

  • {2n : n in N}, where N is the set of all natural numbers, is the set of all even natural numbers.

In axiomatic set theory, this set is guaranteed to exist by the axiom schema of replacement.

These notations can be combined in the form {F(x) : x in A, P(x)}, which indicates the set of all values under F of those members of A that satisfy P. For example:

  • {p/q : p in Z, q in Z, q is not zero}, where Z is the set of all integers, is the set of all rational numbers (Q).

This example also shows how multiple variables can be used (both p and q in this case). This notation is acceptable even though e.g. 2/3 and 4/6 are both included in this definition, and a set can not contain multiple copies of an element; the case p=4, q=6 says with harmless redundancy that 2/3 is in the set.

Main article: List comprehension

Set-builder notation is closely related to a construct in some programming languages, most notably Python and Haskell, called list comprehension.

In Python, list comprehensions are denoted by square brackets, and have a different syntax to set-builder, but are fundamentally the same. Consider these examples, given in both set-builder notation and Python list comprehension.

  • Set-builder:
    • {l: l in L}
    • {{k, x}: k in K and x in X if P(x)
  • List comprehension:
    • [l for l in L]
    • [(k, x) for k in K for x in X if P(x)]

Note: While Python's list comprehension works similarly to set-builder notation, it does not denote a set but rather creates a mathematical tuple (as opposed to Python's native tuple datatype; the actual returned value's type is list) based on existing tuples. It is possible to use true sets in Python with the set keyword and set class, but this causes additional deviations from set-builder notation:

  • set(l for l in L)
  • set((k, x) for k in K for x in X if P(x))

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.