# Interface:Set theory

Module usage |
---|

Parameters |

Classical propositional calculus, first-order logic |

Imported by |

Interface:Complex number axioms and others |

Exported by |

Relations 2 |

This page will eventually cover as much of set theory as is generally used in the bulk of mathematics: empty set, singletons, unordered and ordered pairs, relations, functions, subset, union, intersection, etc.

We build on propositional logic and first-order logic (including equality):

param (FIRSTORDER Interface:First-order_logic_with_quantifiability (CLASSICAL) () Unable to load parameter FIRSTORDER(Interface:First-order_logic_with_quantifiability)[CLASSICAL(Interface:Classical_propositional_calculus)[]+]+: Unable to load module Interface:First-order_logic_with_quantifiability

## Contents

## Variables (sets) and objects (classes)[edit]

First-order logic provides us with two kinds: `variable`

is a variable, which represents a set and can be quantified over, and `object`

is an expression which represents a set. For example, a variable might be `x`

, `y`

, or `z`

, but an object could be the singleton `{ x }`

, the unordered pair `{ x, y }`

, the ordered pair `〈 x, y 〉`

, etc. To some extent the concepts of variable and object correspond to set and class in some theories (like metamath's set.mm), but one key difference is that we have no proper classes thanks to the axiom of quantifiability.

## Set membership[edit]

We can test whether one set is an element of another, and define an abbreviation for the negated version.

## Empty set[edit]

We assert the existence of the empty set, a set with no elements.

## Singleton[edit]

Given a set, we can form a set `{ s }`

which has only it as an element.^{[1]}

A set is an element of its singleton: `A ∈ {A}`

.^{[2]}

## Unordered pair[edit]

Given two sets, we can form a unordered pair `{ s, t }`

which has only those sets as elements.

An unordered pair contains each of its members: `A ∈ {A, B}`

.

Unordered pairs are unordered: `{A, B} = {B, A}`

.

Unordered pair equality can imply equality of members: `{A, C} = {B, C} → A = B`

,^{[3]} and likewise if the unordered pairs are commuted.

A singleton is equal to an unordered pair with the same element listed twice.

## Ordered pair[edit]

An ordered pair has a first element and a second element, and two ordered pairs are equal if and only if their first elements are equal and their second elements are equal.

We can extract the first or second element of an ordered pair.

## Relations[edit]

A relation is a set of ordered pairs. We define `relation A`

as a formula meaning "A is a relation". We customarily use the letters `R, S, and T`

for relations.

The Cartesian product of two sets is the set of all ordered pairs consisting of one set from the first given set and one set from the second given set.^{[4]}

The domain of a relation is a set consisting of all of the first elements of the ordered pairs in the relation. Our definition, and the theorems that follow, do not require `R`

to be a relation, but they aren't especially interesting if it is not.

The range is a set containing exactly the values which the second members of the ordered pairs in the relation can take on (as opposed to the other common definition, which is a set which is a superset of what we call the range).

## Subset[edit]

The subset relationship is equivalent to various statements involving membership, unions, intersections, and set differences.^{[5]}

### Partial order[edit]

The subset relationship has the three properties of a partial order. That is, it is reflexive, antisymmetric, and transitive.

## Union[edit]

The union of a set has as its elements everything which is an element of some set in the given set.

The union of two sets is just a special case of the union of a set.

An unordered pair is the union of singletons for each of its elements.

### Subsets and unions[edit]

## Power set[edit]

The power set of a set has as its elements all of the subsets of the given set.

## Separation[edit]

We define `{x ∈ A | φ}`

, the set of all elements in `A`

which also satisfy `φ`

. Although we write `{x ∈ A | φ}`

informally, for JHilbert it needs to be `(separate x A φ)`

.

The term `{x ∈ A | φ}`

is like a quantifier in the sense that it binds `x`

, and we can change the variable in a similar manner.

## Builders[edit]

Equals can be substituted for equals, in the context of set operations.

## Extensionality[edit]

Sets with the same elements are equal.

Here's a variant with explicit freeness hypotheses rather than distinct variable constraints.