ece108: start relations

This commit is contained in:
eggy 2023-02-17 11:21:40 -05:00
parent 219377b4e6
commit b1cb20b7f7

View File

@ -622,4 +622,53 @@ A set is **finite** if it is empty or it is mappable to a subset of the natural
$$\exists n\in\mathbb N,\exists f\text{ is bijective}, f:S\to \mathbb N_n,|s|=n$$
### Uncountable sets
The cardinality of countable sets is relative to the cardinality of the set of **natural numbers**.
$$|\mathbb N|=\aleph_0$$
By Contor's theorem, the powerset of the natural numbers must have a larger cardinality than the set of natural numbers.
$$|X|=\aleph_0\implies|\mathcal P(X)|=2^{\aleph_0}>\aleph_0$$
The following can be taken for granted:
- $|\mathbb R|>|\mathbb N|$
- $|\mathcal P(\mathbb N)|>|\mathbb N|$
- $|\mathcal P(\mathbb N)|=|\mathbb R|$
## Relations
A **binary relation** $R$ from sets $A$ to $B$ must be a subset of the two. A relation from $A$ to $A$ can be written as $R\subseteq A^2$.
$$R\subseteq A\times B$$.
!!! example
- $\forall x,y\in A,B,x<y$ is a subset. $<$ is a binary relation.
For $R\subseteq X\times Y$:
- $\text{dom}(R)=\{x\in X|\exists y\in Y,xRy\}$
- $\text{cod}(R)=Y$
- $\text{rang}(R)=\{y\in Y|\exists x\in X,xRy\}$
- The **image** of $X_1\subseteq X$ under $R$: $R(X_1)=\{y\in Y|\exists x\in X_1xRy\}$
- The **pre-image** is: $R^{-1}(Y_1)=\{x\in X|\exists y\in Y_1,xRy\}$
Relations are trivially proven to be relations through subset analysis.
The **empty relation** $\empty$ is a relation on all sets.
The **identity relation** on all sets returns itself.
$$E=\{\left<a,a\right>|a\in A\}$$
The **universal relation** relates each element in the first set to every element to the second set.
$$U=A^2$$
The **restriction** of relation $R$ to set $B$ limits a previous relation on a superset $A$ such that $B\subseteq A$.
$$R\big|_B=R\cap B^2$$
Graphs are often used to represent relations. A node from $4\to3$ can be represented as $\left<3,4\right>$, much like an adjacency list.