# Lecture 002

## Set Notation

Set(unofficial): a set is unordered collection of objects.

• P={prime_numbers} (let P be the set of prime numbers)

• usually use capital numbers to represent set

• elements: number of sets

• elements in set $x\in A$
• element not in set $x\notin A$

Roster Method: list of elements in the set (informal, typically written when sets are small and finite)

• example: A={0,1,2,3,3,3,3,1}

• example: B={0,1,2,3,...}(need explanation sentence)

Variable Proposition: a statement involving unquantified variables which takes a truth value for appropriate values of the variables.

• example: X>=8 (X is now undefined, but if it is defined, it will take a truth value)

• variable proposition is not a proposition

you can interpret that as a function that used to qualify the context (output is a boolean)

Set Builder Notation

• example: $\{x\in X | P(x)\}$ or $\{x\in X : P(x)\}$ (the set of $x\in X$ for which $P(x)$ holds)

Important Number Sets:

• $\mathbb{N}=\{0,1,2,3,...\}$: natural numbers (assume without proof)

1. there is no largest natural number
2. 0 is the smallest natural number
3. the sum of 2 naturals is a natural
4. the product of 2 naturals is a natural
• $\mathbb{Z}=\{...,-2,-1,0,1,2,...\}$: integers (assume without proof)

1. There is neither largest or smallest integer
2. Closed under addition, subtraction and multiplication
• $\mathbb{Z}^{+}=\{1,2,3,...\}$: positive integer (and you have TODO:z-)

Integer Divisibility: for $a, b \in \mathbb{Z}$, we say $a$ divides(be inversely divisible by) $b$ denoted $a|b$, if and only if there exist an integer $c\in\mathbb{Z}$ such that $b=ac$.

• 0|0 is correct. $0=0\times1$ (for instance) so the divisibility relation 0|0 holds true.

Even and Odd: $n\in\mathbb{Z}$ is even if $2|n$, and is odd if $2|(n-1)$.

• all integers are either even or odd by induction

• zero is even because it is divisible by 2

Rational Numbers: $\mathbb{Q}$

• $\mathbb{Q}=\{\frac{a}{b} | a\in\mathbb{Z} and b\in\mathbb{Z}^{+}\}$ or

• $\mathbb{Q}=\{\frac{a}{b} | a, b\in\mathbb{Z} and b\neq 0\}$

• assume without proof

1. The sum, difference, and product of rational number is still a rational number
2. A rational number divided by a nonzero rational number is still a rational number
3. There is neither a largest nor a smallest rational number.

Real Numbers: $\mathbb{R}$

• assume without proof
1. The sum, difference, and product of 2 real numbers is still a real number.
2. A real number divided by a nonzero real number is still a real number
3. There is neither a largest nor a smallest real number.

:warning: integer exponentiation is not within group because there are negative exponents

Empty Set: $\{\}$ or $\emptyset$

• :warning: {} has no element, therefore not an element of itself

For $n\in\mathbb{Z}$, [n] means "a set consisting of the first n natural number"

• $=\{1, 2, 3, 4\}$

• :warning: $=\{\}$

• [n] is always infinite even if $n\in \mathbb{Z}^+$

## Well-Defineness of Sets

$S = \{X|X\notin X\}$, then "Is $S\in S$"

• S is a set that contains sets

• certainly $\emptyset, \mathbb{Z} \in S$

• revised set definition: A set is any collection of objects from a special universal set. (and universal set is not a set, do not call it set of all set)

• ($A\in\{X|X\in X\} = \{A|A\in A\}$)

• ($A\in\{X|[whatever]\} = \{A|[whatever]\}$)

:question: (variable preposition $\{\}\in\{\{\}\}$ returns Yes, and $\{\}\in\{\}$ returns No, so {} is not the same as {{}}) :warning: $\in$ just mean the word in in python, and $\subseteq$ means contains in python.

### Subsets

Subset: A is subset of B ($A\subseteq$ B) if and only if every element of A is also an element of B. (not subset is $\nsubseteq$)

Equal: $A\subseteq B \text{ and } B\subseteq A$

Proper Subset($\subset$ or $\subsetneq$): $A\subseteq B$ and $A\neq B$

\emptyset \subset  \subset \mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}

Power set: Let $A$ be a set, $\mathcal{P}(A)$ is the set of all subset of $A$. (including A itself)

• $\emptyset, A \subseteq \mathcal{P}(A)$.

• $\mathcal{P}(A) = {\emptyset, {a}, {b}, A}$

• :warning: $\mathcal{P}(\emptyset) = \{\emptyset\}$

• :warning: $\mathcal{P}(\mathcal{P}(\emptyset)) = \{\emptyset, \{\emptyset\}\}$

• :warning: $\mathcal{P}(\mathcal{P}(\mathcal{P}(\emptyset))) = \{\emptyset, \{\emptyset\}, \{\{\emptyset\}\}, \{\emptyset, \{\emptyset\}\}\}$

• $P(P(P({})))={{}, P((P({})))}}$

:= is assignment symbol

$\mathcal{P}$ ($A\in\{X|[whatever]\} = \{A|[whatever]\}$)

:warning: natural numbers include 0, but  starts with 1.

TODO: How can we denote a pair of numbers as coordinates in set notation? (see piazza)

Table of Content