# Introduction to Set Theory

Here’s a summary of things I learned about the Set Theory recently.

### Set

A set is a collection into a whole of definite, distinct objects of our intuition or of our thought. The objects are called the elements of the set.

#### Formal Notation

If `a`

is an element of the set `A`

, we would write it as:`a ∈ A`

`42 ∈ ℕ`

`apple ∈ fruit`

`chicken ∉ mammals`

### Principle of Extensionality — Set Equivalency

Two sets are equivalent if and only if they contain same objects. Order of elements and the repetition does not affect equivalency.

- If
`A = {a}`

and`B = {a}`

then`A = B`

- If
`A = {a, a}`

and`B = {a}`

then`A = B`

- If
`A = {a, b, b}`

and`B = {a, b}`

then`A = B`

- If
`A = {b, a}`

and`B = {a, b}`

then`A = B`

- If
`A = {a, b}`

and`B = {a}`

then`A ≠ B`

#### Formal Notation

`A = B ⇔ ∀x (x ∈ A ⇔ x ∈ B)`

Set `A`

is equivalent to set `B`

, if and only if all `x`

where `x`

is an element of set `A`

is also an element of set `B`

### Set Abstraction

Simple sets can be specified fully as shown in examples below.

`students = {ann, john, james}`

`sports = {footy, tennis, rugby}`

While this is sufficient for small sets, a need arises to specify large (or even infinite) sets. Set abstraction allows us to do this using a predicate.

`odd natural numbers = {n ∈ ℕ | odd(n)}`

`tropical fruits = {fruit ∈ all_fruits| tropical(f)}`

`Formal Notation`

`{x | P(x)}`

This is a set of all elements that satisfies(or has) the property `P`

.

*Originally published at **medium.com** on September 14, 2017.*