diff --git a/CS1527/notes-2024-02-27.md b/CS1527/notes-2024-02-27.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/CS1527/notes-2024-02-27.md @@ -0,0 +1 @@ + diff --git a/MA1006/decls.tex b/MA1006/decls.tex index 86a52d7..de46f2f 100644 --- a/MA1006/decls.tex +++ b/MA1006/decls.tex @@ -9,6 +9,7 @@ \author{} \newcommand{\paren}[1]{\left(#1\right)} +\newcommand{\powerset}[1]{\mathbb{P}\paren{#1}} \renewcommand{\Re}[1]{\operatorname{\mathbb{R}e}\paren{#1}} \renewcommand{\Im}[1]{\operatorname{\mathbb{{I}}m}\paren{#1}} \newcommand{\C}{\mathbb{C}} diff --git a/MA1511/decls.tex b/MA1511/decls.tex index 86a52d7..de46f2f 100644 --- a/MA1511/decls.tex +++ b/MA1511/decls.tex @@ -9,6 +9,7 @@ \author{} \newcommand{\paren}[1]{\left(#1\right)} +\newcommand{\powerset}[1]{\mathbb{P}\paren{#1}} \renewcommand{\Re}[1]{\operatorname{\mathbb{R}e}\paren{#1}} \renewcommand{\Im}[1]{\operatorname{\mathbb{{I}}m}\paren{#1}} \newcommand{\C}{\mathbb{C}} diff --git a/MA1511/sets.tex b/MA1511/sets.tex index 3d2f467..54112e8 100644 --- a/MA1511/sets.tex +++ b/MA1511/sets.tex @@ -71,23 +71,23 @@ For sets $X$, $Y$: \end{description} For $f: X \to Y$, $A \subseteq A' \subseteq X$, $B \subseteq B' \subseteq Y$: \begin{align*} - f(A) \subseteq~& f(A') \\ - f^{-1}(B) \subseteq ~& f^{-1}(B') \\ - f^{-1}(f(A)) \supseteq ~& A \\ - f(f^{-1}(B)) \subseteq ~& B + f(A) \subseteq~ & f(A') \\ + f^{-1}(B) \subseteq ~ & f^{-1}(B') \\ + f^{-1}(f(A)) \supseteq ~ & A \\ + f(f^{-1}(B)) \subseteq ~ & B \end{align*} For set families $(A_i \subseteq X)_{i \in I}, (B_j \subseteq Y)_{j \in J}$: \begin{align*} - f(\cup_{i \in I} A_i) = ~& \cup_{i \in I}f(A_i) \\ - f(\cap_{i \in I} A_i) \subseteq ~& \cap_{i \in I}f(A_i) \\ - f^{-1}(\cup_{j \in J} B_j) = ~& \cup_{j \in J} f^{-1}(B_j) \\ - f^{-1}(\cap_{j \in J} B_j) = ~& \cap_{j \in J} f^{-1}(B_j) + f(\cup_{i \in I} A_i) = ~ & \cup_{i \in I}f(A_i) \\ + f(\cap_{i \in I} A_i) \subseteq ~ & \cap_{i \in I}f(A_i) \\ + f^{-1}(\cup_{j \in J} B_j) = ~ & \cup_{j \in J} f^{-1}(B_j) \\ + f^{-1}(\cap_{j \in J} B_j) = ~ & \cap_{j \in J} f^{-1}(B_j) \end{align*} \section*{Function Composition} For functions $f: X \to Y$, $g: Y \to Z$: \begin{align*} - & (g \circ f): X \to Z \\ - & (g\circ f)(x) = g(f(x)) & \forall x \in X \\ \\ + & (g \circ f): X \to Z \\ + & (g\circ f)(x) = g(f(x)) & \forall x \in X \\ \\ \end{align*} \section*{Surjection and Injection} For $f: X \to Y$, $f$ is @@ -95,6 +95,159 @@ For $f: X \to Y$, $f$ is \item[surjective] iff $f(X) = Y$, i.e. $\forall y \in Y.~ \exists x \in X.~ f(x) = y$ \\ Range is codomain, 'onto' \item[injective] iff $\forall x, x' \in X. ~ f(x) = f(x') \implies x = x'$ - \item[bijective] iff $f$ is injective and $f$ is surjective + \item[bijective] iff $f$ is injective and $f$ is surjective \\ + one-to-one \end{description} +Given $f: X \to Y$, $g: Y \to Z$: \\ +\quad If f and g are injective, so is $g\circ f$ \\ +\quad If f and g are surjective, so is $g \circ f$ \\ +\quad If $g \circ f$ is injective, so is $f$ \\ +\quad If $g \circ f$ is surjective, so is $g$ +\section*{Inverse Functions} +The inverse function $f^{-1}$ of $f: X \to Y$ exists iff $f$ is bijective, and is defined by \[f^{-1}(y) = x \text{ where } \exists! x \in X. f(x) = y \qquad \forall y \in Y\] +\begin{align*} + (f \circ f^{-1}) = \operatorname{Id} \\ + (f^{-1} \circ f) = \operatorname{Id} +\end{align*} +\section*{Power Sets} +Powerset of S: $\powerset{S}$ has $2^{\card{S}}$ elements is the set of all subsets of $S$ \\ +$Fun(X, \{0, 1\})$ is the set of functions $X \to \{0, 1\}$ \\ +$\Phi: Fun(X, \{0, 1\}) \to \powerset{X}$ \\ +$\Phi(f) = \{ x \in X | f(x) = 1 \}$ \\ +$\Phi$ is bijective. +\section*{Binary Operators} +A binary operator is $X^2 \to X$ \\ +Union is $\powerset{X}^2 \to \powerset{X}$ \\ +$\square$ is the unknown or indeterminate binop sigil \\ +Unital: $\forall x \in X. \exists u \in X. u \square x = x \square u = x$ +\section*{Construction of the Natural Numbers} +\begin{align*} + x^{+} & = x \cup \{x\} & \text{successor of $x$} +\end{align*} +A set $X$ is \emph{inductive} if $\varnothing \in X \land (a \in X \implies a^+ \in X)$ \\ +Axiom: There exists an inductive set. \\ +Definition: A natural number is a set that is an element of all inductive sets. \\ +Theorem: There exists a set whose elements are the natural numbers. \\ +\begin{align*} + & \text{Given an inductive set $A$} \\ + & \omega = \{ x \in A | x \text{ is a natural number}\} \\ + & \text{any natural number is in $A$ (since $A$ is inductive), and therefore in $\omega$} \\ + & \omega \text{ is the natural numbers} +\end{align*} +\\ +Define: +\begin{align*} + 0 & = \varnothing \\ + 1 & = 0^+ \\ + 2 & = 1^+ \\ + \ldots +\end{align*} +$\in$ is an ordering over $\omega$, as is $\subseteq$ \\ +$\omega$ is an inductive set. Proof: \\ +$\varnothing$ is a natural number. +$x \in \omega$ implies $x^+ \in \omega$, as $x$ is natural and is therefore in +every inductive set, and so $x^+$ is in every inductive set and is therefore a +natural number. +\subsection*{Principle of Induction} +If $A \subseteq \omega$ and $A$ is inductive, $A = \omega$. +Since $A$ is inductive, it contains every natural number, so $\omega \subseteq A$. \\ +Since $A \subseteq \omega \land \omega \subseteq A$, $A = \omega$ +\section*{Recursion on $\omega$} +\subsection*{Principle of Recursion} +For a set $X$, $x_0 \in X$, $h: X \to X$, there exists a unique function $f: \omega \to X$ where $f(0) = x_0$, $f(n^+) = h(f(n))$. +\section*{Relations} +Total order: $(X, \prec)$, requires $\forall x, y, z \in X$: \\ +\begin{align*} + & x \prec y \land y \prec z \implies x \prec z \\ + & x = y \oplus x \prec y \oplus y \prec x & \text{ (where $\oplus$ denotes XOR) } +\end{align*} +Lexicographic order $x <_L y$ on $\N\times\N = x_0 < y_0 \lor (x_0 = y_0 \land x_1 < y_1)$ \\ +For a non-empty subset $A$ of $X$ given a total order $(X, \prec)$, a minimum/least element $a_0 \in A$ +exists where $\forall a \in A.~a_0 \preceq a$. +\section*{Ordering on $\omega$} +$(\omega, \in)$ and $(\omega, \subset)$ are both total orderings on $\omega$, such that $\varnothing$ is the minimum and $\forall x \in \omega.~x < x^+$ +\section*{Strong Induction} +Every non-empty subset of $\N$ has a minimum. \\ \\ +Let $\phi(x)$ be a predicate over $\N$ where $\forall n\in \N.~ (\forall m \in \N.~ m < n \implies \phi(m)) \implies \phi(n)$. \\ +Then $\phi(0)$ holds, as $\neg\exists n \in \N.~n<0$, $\phi(1)$ holds as $\phi(0)$ holds, etc. +\begin{align*} + & \neg\exists x \in \N.~\neg\phi(x) \\ + & \text{Let } A \text{ be a subset of }N\text{ such that }\phi(n)\text{ is false }\forall n \in A \\ + & \text{If not, $\exists a_0 \in A$} \\ + & \forall n \in N.~n < a_0 \implies n \not\in A \implies \phi(n) \\ + & \text{Then $\phi(n)$ holds $\forall n < a_0$, so $\phi(a_0)$, then $a_0 \not\in A$, which is a contradiction, so $A = \varnothing$} +\end{align*} +\section*{Fibonacci} +Fibonacci Sequence: $F_n$ \\ +Roots of $x^2 - x - 1$ are $\phi = \frac{1 + \sqrt{5}}{2}$ and $\psi = \frac{1 - \sqrt{5}}{2}$ \\ +$F_n = \frac{\phi^{n+1} - \psi^{n+1}}{\sqrt{5}}$ \\ +For $n=0$: + +$F_0 = 1 = \frac{\frac{1 + \sqrt{5}}{2} - \frac{1-\sqrt{5}}{2}} = \frac{2\sqrt{5}}{2} = 1$ \\ + +For $n=1$: \\ + +$F_1 = 1 = \frac{\paren{\frac{1 + \sqrt{5}}{2}}^2 - \paren{\frac{1 - \sqrt{5}}{2}}^2}{\sqrt{5}} = \frac{\phi + 1 - \psi - 1}{\sqrt{5}}$ \\ + +For $n\geq 2$: +\begin{align*} + & F_n = F_{n-1} + F_{n-2} = \frac{\phi^n - \psi^n}{\sqrt{5}} + \frac{\phi^{n-1} - \psi^{n-1}}{\sqrt{5}} \\ + & = \frac{\phi^{n-1}\paren{\phi + 1} - \psi^{n-1}\paren{\psi + 1}}{\sqrt{5}} \\ + & = \frac{\phi^{n-1}\phi^2 - \psi^{n-1}\psi^2}{\sqrt{5}} \\ + & = \frac{\phi^{n+1} - \psi^{n+1}}{\sqrt{5}} & \text{as required} +\end{align*} + +\subsection*{Zeckendorff's Theorem} +Every natural number can be written as a sum of non-adjacent Fibonacci numbers in a unique way (excluding $F_0$). \\ +A finite subset $I$ of $\N^+$ is \emph{Zeckendorff} if it contains no adjacent elements ($\forall x \in I.~x^+ \not\in I$) \\ +Define $\mathcal{Z}$ as the set of all Zeckendorff sets, and $\sigma: \mathcal{Z} \to \N^+$ by $\sigma(I) = \sum_{i \in I}F_i$. +The theorem claims $\sigma$ is bijective. \\ \\ +For nonempty $I \in \mathcal{Z}$ with largest element $k$: +\begin{align*} + &\text{Let } J = I \setminus \{k\} \\ + &\sigma(I) = F_k + \sigma(J) \geq F_k \\ + &\text{If } J = \varnothing\text{, } \sigma(I) = F_k \leq F_{k + 1} \\ + &\text{Otherwise, we must show } \sigma(I) < F_{k + 1} \\ + &\equiv F_k + \sigma(J) < F_{k + 1} \\ + &\equiv \sigma(J) < F_{k + 1} - F_k = F_{k-1} \\ + &\text{But if $k' = \operatorname{max}(J)$, } \\ + &\sigma(J) < F_{k' + 1} \land k' < k - 2 \text{ (since $I$ is \emph{Zeckendorff})} \\ + & \sigma(J) < F_{k - 1} \text{ as required.} +\end{align*} + +Proof of theorem: $\forall n \in N.~ \sigma$ is bijective. +\begin{align*} + n = 0: \quad& I = \varnothing \\ + n > 0: \quad& \text{Let } F_k \leq n < F_{k + 1},~ m = n - F_k \\ + & m = \sigma(J) \text{ for some } J \\ + & \text{If } J = \varnothing, I = \{k\}. \\ + & \text{Otherwise, } k' = \operatorname{max}(J). \\ + & \text{If } k' \leq k - 2, I = J \cup \{k\} \\ +\end{align*} +\section*{Equivalence Relations} +Reflexive, Symmetric, Transitive \\ +Equivalence relations are usually called $\sim$ \\ +In a set $X$, +\[ [x] = \{ y \in X | x \sim y \} \] +\[ [x] = [y] \equiv x \sim y \] +Any two equivalence classes of $X$ are either disjoint or equal. \\ +\subsection*{Quotient Sets} +$X/\sim~ = \{[x] | x \in X \} \subset \powerset{X}$ \\ +A complete set of representatives is a subset $A$ of $X$ where $\forall x \in X. \exists! a \in A. a \in [x].$ \\ +I.E. a complete set of representatives contains exactly one element from each element of $X/\sim$ \\ +$f: A \to X/\sim$ defined by $f(a) = [a]$ +\\\\\\ +A function $f: X \to Y$ is \emph{compatible} iff $x \sim y \implies f(x) = f(y)~\forall x, y \in X$ \\ +For a \emph{compatible} function, $\Bar{f}: X/\sim~\to Y$ exists and is defined by $\Bar{f}([x]) = f(x)$ +\section*{Integers modulo $k$} +Fix some $k \in \N^+$ \\ +Define $\sim$ on $\Z$ by $n \sim m \iff n - m$ is a multiple of $k$ \\ +$\sim$ is an equivalence relation \\ +$[0, k)\cap\N$ is a complete set of representatives for $\sim$ \\ +$Z/k$ is the set of integers modulo $k$, $n \equiv m~(\operatorname{mod} k) \iff n \sim m$ \\ +$+$ and $\times$ on $\Z/k$: +\begin{align*} + [n] + [m] = [n + m] \\ + [n][m] = [nm] +\end{align*} \end{document}