aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarvin Borner2023-01-05 17:39:23 +0100
committerMarvin Borner2023-01-05 17:49:58 +0100
commitf344cd067cc5829a3e76fd4b7d6779f2502428ea (patch)
treed19141324c115200879ec592cde0e12119ff789b
Initial sync
-rw-r--r--README.md6
-rw-r--r--exams/info1/hauptklausur/main.pdfbin0 -> 72556 bytes
-rw-r--r--exams/info1/hauptklausur/main.tex513
-rw-r--r--exams/info1/hauptklausur/makefile9
-rw-r--r--exams/mathe1/hauptklausur/main.pdfbin0 -> 40854 bytes
-rw-r--r--exams/mathe1/hauptklausur/main.tex90
-rw-r--r--exams/mathe1/hauptklausur/makefile19
-rw-r--r--exams/mathe2/hauptklausur/definitions.tex152
-rw-r--r--exams/mathe2/hauptklausur/main.pdfbin0 -> 173399 bytes
-rw-r--r--exams/mathe2/hauptklausur/main.tex55
-rw-r--r--exams/mathe2/nachklausur/definitions.tex152
-rw-r--r--exams/mathe2/nachklausur/main.pdfbin0 -> 184472 bytes
-rw-r--r--exams/mathe2/nachklausur/main.tex61
-rw-r--r--notes/algo/header.tex68
-rw-r--r--notes/algo/main.md1228
-rw-r--r--notes/algo/main.pdfbin0 -> 388448 bytes
-rw-r--r--notes/algo/makefile23
-rw-r--r--notes/algo/title.tex23
-rw-r--r--notes/mathe1/main.md1815
-rw-r--r--notes/mathe1/main.pdfbin0 -> 476367 bytes
-rw-r--r--notes/mathe1/makefile12
-rw-r--r--notes/mathe2/exam.md367
-rw-r--r--notes/mathe2/examtitle.tex20
-rw-r--r--notes/mathe2/header.tex39
-rw-r--r--notes/mathe2/main.md2500
-rw-r--r--notes/mathe2/main.pdfbin0 -> 557171 bytes
-rw-r--r--notes/mathe2/makefile31
-rw-r--r--notes/mathe2/title.tex25
-rw-r--r--notes/mathe3/header.tex77
-rw-r--r--notes/mathe3/main.md1893
-rw-r--r--notes/mathe3/main.pdfbin0 -> 1493113 bytes
-rw-r--r--notes/mathe3/makefile23
-rw-r--r--notes/mathe3/title.tex25
-rwxr-xr-xsync.sh17
34 files changed, 9243 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..133d979
--- /dev/null
+++ b/README.md
@@ -0,0 +1,6 @@
+# Lecture notes
+
+This repository contains some of my lecture notes of my
+Kognitionswissenschaft (cognitive science) study in Tübingen.
+
+Thanks to everyone involved.
diff --git a/exams/info1/hauptklausur/main.pdf b/exams/info1/hauptklausur/main.pdf
new file mode 100644
index 0000000..1c4d424
--- /dev/null
+++ b/exams/info1/hauptklausur/main.pdf
Binary files differ
diff --git a/exams/info1/hauptklausur/main.tex b/exams/info1/hauptklausur/main.tex
new file mode 100644
index 0000000..3289eab
--- /dev/null
+++ b/exams/info1/hauptklausur/main.tex
@@ -0,0 +1,513 @@
+\documentclass[a4paper, 11pt]{article}
+
+% Packages
+\usepackage[a4paper, inner=2.5cm, outer=2.5cm, top=2.5cm, bottom=2.5cm, bindingoffset=0cm]{geometry}
+\usepackage{amsmath,amsthm,amssymb,amsfonts}
+\usepackage{graphicx}
+\usepackage[colorlinks=true, allcolors=blue]{hyperref}
+\usepackage{fontspec,xunicode,xltxtra}
+\usepackage{biblatex}
+\usepackage{csquotes}
+\usepackage{minted}
+\usepackage{enumitem}
+\usepackage{mdframed}
+
+% GERMAN
+\usepackage[ngerman=ngerman-x-latest]{hyphsubst}
+\usepackage[ngerman]{babel}
+
+\newcommand{\N}{\mathbb{N}}
+\newcommand{\R}{\mathbb{R}}
+\newcommand{\Z}{\mathbb{Z}}
+\newcommand{\C}{\mathbb{C}}
+
+\setlength\partopsep{-\topsep}
+\addtolength\partopsep{-\parskip}
+\addtolength\partopsep{0cm}
+
+\begin{document}
+
+\title{\vspace{-2.0cm}Hauptklausur zu Informatik 1\\Gedächtnisprotokoll}
+\author{Klaus Ostermann}
+\date{\today}
+
+\maketitle
+
+\begin{center}
+ Hilfsmittel: Stift\\
+ Zeit: 90min\\
+ \textbf{Keine Garantie auf korrekte Aufgaben.\\Die Reihenfolge der Aufgaben war je Klausur randomisiert.}
+\end{center}
+
+\section{Programmieraufgaben}
+
+\subsection*{Aufgabe 1}
+\textit{Beschreibung}: Ein Bauteil (\enquote{part}) besteht aus einem Namen (\enquote{name}), einem Herstellungspreis (\enquote{cost}) und Bestandteilen (\enquote{components}), die selbst wieder Bauteile sind und Bestandteile haben können. Die Gesamtkosten eines Bauteils sind der Herstellungspreis und die Summe der Preise der Bestandteile.
+
+\subsubsection*{Teil 1}
+Programmieren Sie eine Datendefinition für Bauteile (\enquote{part}) und geben Sie ein Beispiel mit zwei Bestandteilen mit Konstantendefinitionen an.
+
+\subsubsection*{Teil 2}
+Programmieren Sie eine Funktion \texttt{total-cost}, die ein Bauteil annimt und die Gesamtkosten berechnet.\\\textit{Tipp}: Sie können die Aufgabe entweder mit zwei rekursiven Funktionen oder mithilfe von higher-order-functions (\texttt{map}, \texttt{foldr}) lösen.
+
+\subsection*{Aufgabe 2}
+
+\subsubsection*{Teil 1}
+Programmieren Sie eine Funktion \texttt{contains-smaller-zero?} nach der Signatur mithilfe von Rekursion.
+\begin{minted}{racket}
+; (list-of Number) -> Boolean
+(check-expect (contains-smaller-zero? 1 2 3 -4) #true)
+(check-expect (contains-smaller-zero? 1 2 3 0) #false)
+\end{minted}
+
+\subsubsection*{Teil 2}
+Programmieren Sie eine higher-order Funktion \texttt{contains?} mithilfe von Rekursion und einem Prädikat mit der Signatur \texttt{(X -> Boolean)}.\\\textit{Tipp}: Orientieren Sie sich an Ihrer Funktion aus Teil 1.
+
+\subsubsection*{Teil 3}
+Programmieren Sie \texttt{contains-smaller-zero?} und \texttt{contains-empty-string?} mithilfe der \texttt{contains?} Funktion aus Teil 2, sodass die folgenden Tests erfüllt werden.
+\begin{minted}{racket}
+(check-expect (contains-empty-string? (list "a" "b" "c" "")) #true)
+(check-expect (contains-empty-string? (list "a" "b" "c" "d")) #false)
+\end{minted}
+
+\section{Multiple-Choice}
+Es gab 40 Fragen mit je 4 Antwortmöglichkeiten mit je einer korrekten Antwort.
+
+\subsection*{Frage 1}
+\textit{Was ist der Vorteil des Templates für Summentypen?}\\
+Das Template stellt sicher, dass man...
+\begin{enumerate}[label=$\square$]
+ \item alle Alternativen des Summentyps durch Funktionen erzeugen kann.
+ \item alle Alternativen des Summentyps im Funktionskörper behandelt.
+ \item alle Alternativen des Summentyps durch Tests abdeckt.
+ \item alle Alternativen des Summentyps durch Prädikate voneinander unterscheiden kann.
+\end{enumerate}
+
+\subsection*{Frage 2}
+\textit{Wozu reduziert der folgende Ausdruck in der BSL in einem Schritt?}
+\begin{minted}{racket}
+(cond
+ [#true (+2 2)]
+ [(> 1 0) (+ 1 1)])
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(+ 2 2)|
+ \item \mint{racket}|(cond [#true (+ 2 2)])|
+ \item \mint{racket}|(cond [#true 4] [(> 1 0) (+ 1 1)])|
+ \item \mint{racket}|4|
+\end{enumerate}
+
+\subsection*{Frage 3}
+\textit{Was ergibt die Auswertung des folgenden Ausdrucks?}
+\begin{minted}{racket}
+(quasiquote (+ 4 (unquote (+ 2 5)) 5))
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(list + 4 (list + 2 5))|
+ \item \mint{racket}|(list '+ 4 7 5)|
+ \item \mint{racket}|`(+ 4 ,(+ 2 5) 5)|
+ \item \mint{racket}|(list + 4 7 5)|
+\end{enumerate}
+
+\subsection*{Frage 4}
+\textit{Was ist eine wichtige Eigenschaft von Tests?}
+\begin{enumerate}[label=$\square$]
+ \item Wenn alle Tests wie erwartet ablaufen, ist das Programm fehlerfrei.
+ \item Tests können als Teil der Spezifikation einer Funktion verwendet werden.
+ \item Tests stellen sicher, dass eine Rekursion immer terminiert.
+ \item Mit Tests kann garantiert werden, dass eine Funktion im Programm immer mit den richtigen Typen aufgerufen wird.
+\end{enumerate}
+
+\begin{mdframed}
+ \noindent\textit{Gegeben sei folgendes Programm:}
+ \begin{minted}{racket}
+(define (f x)
+ (cond
+ [(empty? x) empty]
+ [(cons? x) (cons (first x) (g (rest x)))]))
+
+(define (g x)
+ (cond
+ [(empty? x) empty]
+ [(empty? (rest x)) empty]
+ [(cons? x) (f (rest (rest x)))]))
+\end{minted}
+
+ \subsection*{Frage 5}
+ \textit{Zu was wird folgender Ausdruck ausgewertet?}
+ \mint{racket}|(f (list #true 24 48 72 #false))|
+ \begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(list #true 24 48 72 #false)|
+ \item \mint{racket}|(list #true 72)|
+ \item \mint{racket}|(list (list #true) (list 48 #false))|
+ \item \mint{racket}|(list #true 48 #false)|
+ \end{enumerate}
+
+ \subsection*{Frage 6}
+ \textit{Was ist die Signatur von \texttt{f}?}
+ \begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(List-Of Number) -> (List-Of Number)|
+ \item \mint{racket}|Number -> Boolean|
+ \item \mint{racket}|[X] (List-Of X) -> (List-Of X)|
+ \end{enumerate}
+\end{mdframed}
+
+\subsection*{Frage 7}
+\textit{Was ist die Signatur der folgenden Funktion?}
+\begin{minted}{racket}
+(define (composition f g) (lambda (x) (g (f x))))
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|[X Y Z] (X -> Y) (Y -> Z) -> (X -> Z)|
+ \item \mint{racket}|[X Y Z] (Y -> Z) (X -> Y) -> (X -> Z)|
+ \item \mint{racket}|[X Y Z] (X -> Z) (Z -> Y) -> (Y -> Z)|
+\end{enumerate}
+
+\begin{mdframed}
+ \noindent\textit{Gegeben sei folgendes Programm:}
+ \begin{minted}{racket}
+(define-struct collision (left right top bottom))
+; Collision is a structure: (make-collision Boolean Boolean Boolean Boolean)
+\end{minted}
+
+ \subsection*{Frage 8}
+ \textit{Wie viele Werte umfasst der Teil des Datenuniversums, der von \texttt{collision} beschrieben wird?}
+ \begin{enumerate}[label=$\square$]
+ \item unendlich viele
+ \item 1
+ \item 4
+ \item 16
+ \end{enumerate}
+
+ \subsection*{Frage 9}
+ \textit{Was ist eine \texttt{collision}?}
+ \begin{enumerate}[label=$\square$]
+ \item rekursiver Datentyp
+ \item Summentyp
+ \item Produkttyp
+ \item Intervalltyp
+ \end{enumerate}
+
+ \subsection*{Frage 10}
+ \textit{Was ist eine gültige collision?}
+ \begin{enumerate}[label=$\square$]
+ \item \mint{racket}|<make-collision #t 42 #t "hello">|
+ \item \mint{racket}|<make-collision #t #f #t #f #t>|
+ \item \mint{racket}|<make-collision #t #t <make-collision #t #f>>|
+ \item \mint{racket}|<make-collision #t #t #t #f>|
+ \end{enumerate}
+
+ \subsection*{Frage 11}
+ \textit{Was beschreibt die erste Zeile des obigen Programms?}
+ \begin{minted}{racket}
+(define-struct collision (left right top bottom))
+\end{minted}
+ \begin{enumerate}[label=$\square$]
+ \item Strukturdefinition
+ \item Produkttyp
+ \item Strukturtyp
+ \item Keine der Antworten
+ \end{enumerate}
+\end{mdframed}
+
+\subsection*{Frage 12}
+\textit{Sie möchten ein Programm schreiben, das ein textbasiertes Rollenspiel implementiert. Dazu möchten Sie die Charakterklassen \enquote{Mage}, \enquote{Warrior} und \enquote{Amazon} einbeziehen. Welchen Datentyp wählen Sie dafür?}
+\begin{enumerate}[label=$\square$]
+ \item Summentyp
+ \item Produkttyp
+ \item Intervalltyp
+ \item Primitiver Datentyp
+\end{enumerate}
+
+\subsection*{Frage 13}
+\textit{Sie möchten einen Charakter in einem Computerspiel mit einem Namen, einem Level und Werten für Stärke, Intelligenz, Charisma und Geschicklichkeit in einem Programm repräsentieren. Welche Art Datentyp sollten Sie hierzu verwenden?}
+\begin{enumerate}[label=$\square$]
+ \item Summentyp
+ \item Produkttyp
+ \item Rekursiver Datentyp
+ \item Primitiver Datentyp
+\end{enumerate}
+
+\subsection*{Frage 14}
+\textit{Welches der folgenden Programme ist eine Umgebung?}
+\begin{enumerate}[label=$\square$]
+ \item \begin{minted}{racket}
+(define (f x) (+ x 1))
+(define y (f 2))
+\end{minted}
+ \item \begin{minted}{racket}
+(define (f x) (+ x 1))
+(define y x)
+\end{minted}
+ \item \begin{minted}{racket}
+(define (f x) (+ x 1))
+(define y 3)
+\end{minted}
+ \item \begin{minted}{racket}
+(define (f x) (+ x 1))
+(define y (+ 2 1))
+\end{minted}
+\end{enumerate}
+
+\subsection*{Frage 15}
+\textit{Zu was wird folgender Ausdruck ausgewertet?}
+\begin{minted}{racket}
+(+ 1 "1")
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item Fehler
+ \item \mint{racket}|11|
+ \item \mint{racket}|"11"|
+ \item \mint{racket}|2|
+\end{enumerate}
+
+\subsection*{Frage 16}
+\textit{Wann kommen die ersten Tests gemäß des Entwurfsrezepts?}
+\begin{enumerate}[label=$\square$]
+ \item Nach den Templates
+ \item Nach der Implementierung
+ \item Nach den Datenbeispielen
+ \item Nach dem Funktionskopf
+\end{enumerate}
+
+\subsection*{Frage 17}
+\textit{Was ergibt die Auswertung des folgenden Ausdrucks?}
+\begin{minted}{racket}
+(#true + 3)
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item Fehler: erwartet Zahl als erstes Argument
+ \item \texttt{\#true}
+ \item Fehler: erwartet Funktion nach öffnender Klammer
+ \item \texttt{4}
+\end{enumerate}
+
+\subsection*{Frage 18}
+\textit{Gegeben sei folgende kontextfreie Grammatik für E-Mail Adressen.}
+\begin{minted}{racket}
+<NAME> ::= maria | elke | doris | maier | <NAME>-<NAME>
+<TLD> ::= de | com | co.uk
+<URL> ::= amazon | google | tuebingen | <URL>.<URL>
+<EMAIL> ::= <NAME>@<URL>.<TLD>
+\end{minted}
+\textit{Was ist \textbf{keine} korrekte E-Mail Adresse im Sinne der gegebenen Grammatik?}
+\begin{enumerate}[label=$\square$]
+ \item elke@tuebingen.amazon.de
+ \item maria-maier@google.com
+ \item maier@google-tuebingen.com
+ \item doris-maria@google.co.uk
+\end{enumerate}
+
+\begin{mdframed}
+ \noindent\textit{Gegeben sei folgendes Programm:}
+ \begin{minted}{racket}
+(define (myfun x)
+ (cond
+ [(> 0 x) (+ x 1)]
+ [else #false]))
+\end{minted}
+
+ \subsection*{Frage 19}
+ \textit{Was ist die Signatur von myfun?}
+ \begin{enumerate}[label=$\square$]
+ \item \mint{racket}|Boolean -> Number|
+ \item \mint{racket}|MaybeNumber -> Number|
+ \item \mint{racket}|Number -> MaybeNumber|
+ \item \mint{racket}|Number -> Boolean|
+ \end{enumerate}
+
+ \subsection*{Frage 20}
+ \textit{Zu was wird folgender Ausdruck ausgewertet?}
+ \mint{racket}|(myfun (myfun 2))|
+ \begin{enumerate}[label=$\square$]
+ \item \mint{racket}|#false|
+ \item \mint{racket}|2|
+ \item \mint{racket}|4|
+ \item Fehler
+ \end{enumerate}
+\end{mdframed}
+
+\subsection*{Frage 21}
+\textit{Die aus der Vorlesung bekannte Funktion \texttt{unfold} hat folgende Signatur. Was macht die Funktion im dritten Argument?}
+\mint{racket}|[X Y] (Y -> Boolean) (Y -> Y) (Y -> X) Y -> (List-of X)|
+\begin{enumerate}[label=$\square$]
+ \item Sie erzeugt das nächste Listenelement.
+ \item Sie erzeugt mit dem aktuellen Zustand ein neues Listenelement.
+ \item Sie kann die Iteration terminieren.
+ \item Sie gibt an, ob die Liste beendet ist.
+\end{enumerate}
+
+\subsection*{Frage 22}
+\textit{Was ergibt die Auswertung des folgenden Programms?}
+\begin{minted}{racket}
+(local [(define x 1)]
+ (local [(define x 2)]
+ 3))
+(+ x x)
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item 2
+ \item 4
+ \item Fehler
+ \item 3
+\end{enumerate}
+
+\subsection*{Frage 23}
+\textit{Was ist syntaktischer Zucker?}
+\begin{enumerate}[label=$\square$]
+ \item Konzepte einer Sprache, die für die Programmausführung unwesentlich sind.
+ \item Konzepte einer Sprache, die nicht direkt einem Prozessorbefehl entsprechen.
+ \item Konzepte einer Sprache, die durch andere Konzepte ausgedrückt werden können.
+ \item Konzepte einer Sprache, die von einem Editor zusätzlich zum Programm angezeigt werden müssen.
+\end{enumerate}
+
+\begin{mdframed}
+ \noindent\textit{Gegeben sei folgendes Programm:}
+ \begin{minted}{racket}
+(define (my-animate f)
+ (big-bang 0
+ [to-draw f]
+ [on-tick ...]))
+\end{minted}
+
+ \subsection*{Frage 24}
+ \textit{Was ist die Signatur von \texttt{my-animate}?}
+ \begin{enumerate}[label=$\square$]
+ \item \mint{racket}|Number -> Number|
+ \item \mint{racket}|(Image -> Number) -> Image|
+ \item \mint{racket}|Image -> Number|
+ \item \mint{racket}|(Number -> Image) -> Number|
+ \end{enumerate}
+
+ \subsection*{Frage 25}
+ \textit{Wie muss ... gefüllt werden, damit \texttt{my-animate} der Funktionsweise von \texttt{animate} entspricht?}
+ \begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(lambda (x) (make-state (+ (state-tick x) 1)))|
+ \item \mint{racket}|(lambda (x) (x))|
+ \item \mint{racket}|(lambda (x) (+ x 1))|
+ \item \mint{racket}|(lambda (x y) (* x y))|
+ \end{enumerate}
+\end{mdframed}
+
+\subsection*{Frage 26}
+\textit{Wie kann das folgende Programm vereinfacht werden?}
+\begin{minted}{racket}
+(and b1 (or (not b2) (not #t)))
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(not (and b1 b2))|
+ \item \mint{racket}|(and b1 (not b2))|
+ \item \mint{racket}|(or b1 b2)|
+ \item \mint{racket}|(and b1 b2)|
+\end{enumerate}
+
+\subsection*{Frage 27}
+\textit{Welche Funktion ist eine Funktion erster Ordnung?}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(lambda (x) (lambda (y) y))|
+ \item \mint{racket}|(lambda (x) (lambda (y) (x y)))|
+ \item \mint{racket}|(lambda (x) ((lambda (y) y) x))|
+\end{enumerate}
+
+\subsection*{Frage 28}
+\textit{Das DRY-Prinzip besagt, dass ...}
+\begin{enumerate}[label=$\square$]
+ \item Rekursion, Schleifen und ähnliche Wiederholungen vermieden werden sollten.
+ \item die Tastatur beim Programmieren trocken bleiben muss.
+ \item unnötige Redundanz weitestgehend durch Abstraktion vermieden werden sollte.
+ \item Wiederholungen im Programm ein Programm verlangsamen können.
+\end{enumerate}
+
+\subsection*{Frage 29}
+\textit{Was sind magic numbers?}
+\begin{enumerate}[label=$\square$]
+ \item Ausdrücke, die zu einer Zahl ausgewertet werden.
+ \item Zahlen, die im Pogrammtext mehrmals auftreten.
+ \item Zahlen wie \texttt{42}, die eine besondere Bedeutung in der Science-Fiction besitzen.
+ \item Zahlenliterale, deren Bedeutung nicht offensichtlich ist.
+\end{enumerate}
+
+\subsection*{Frage 30}
+\textit{Was ergibt die Auswertung des folgenden Programms?}
+\begin{minted}{racket}
+(define X (+ 1 Y))
+(define Y 6)
+(* X Y)
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item 42
+ \item Fehler: Y wurde vor dessen Definition benutzt.
+ \item 6
+ \item 7
+\end{enumerate}
+
+\subsection*{Frage 31}
+\textit{Was ist korrekt bei generativ rekursiven Funktionen?}
+\begin{enumerate}[label=$\square$]
+ \item Es existiert entweder ein oder kein rekursiver Aufruf.
+ \item Der Algorithmus terminiert nie.
+ \item Man muss kreativer als bei struktureller Rekursion sein.
+ \item Der Algorithmus terminiert auf eine einfache Art und Weise.
+\end{enumerate}
+
+\subsection*{Frage 32}
+\textit{Was ist ein Wert der BSL?}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(and #true 3)|
+ \item \mint{racket}|(define (f x) (+ 3 x))|
+ \item \mint{racket}|#false|
+ \item \mint{racket}|(+ 1 3)|
+\end{enumerate}
+
+\subsection*{Frage 33}
+\textit{Laut der BSL gilt:} \textbf{(war noch bisschen mehr und anders..)}
+\begin{minted}{racket}
+<e> := (<name> <e>*)
+ | (cond {[<e> <e>]}+)
+ | <name>
+\end{minted}
+\textit{Was ist laut dieser Grammatik ein gültiger Ausdruck?}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(cond [(< 5 3)] [else #false])|
+ \item \mint{racket}|(cond [] [(< 4 2) #true])|
+\end{enumerate}
+
+\subsection*{Frage 34}
+\textit{Wenn \texttt{e1} zu \texttt{e2} reduziert werden kann, dann sagt KONG, dass ...}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(cond e1 ...) = (cond e2 ...)|
+ \item ...
+\end{enumerate}
+
+\subsection*{Frage 35}
+\textit{Was wird in ISL bei folgender Funktion der Umgebung hinzugefügt?}
+\begin{minted}{racket}
+(define f (lambda (x) (+ 2 1)))
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|(define f 3)|
+ \item \mint{racket}|(define f (lambda (x) (+ 2 1))|
+ \item \mint{racket}|(define f (lambda (x) 3))|
+ \item \mint{racket}|(define (f x) 3)|
+\end{enumerate}
+
+\subsection*{Frage 36}
+\textit{Was ist die Signatur folgender Funktion?}
+\begin{minted}{racket}
+(define (fun f xs) (foldr append empty (map f xs)))
+\end{minted}
+\begin{enumerate}[label=$\square$]
+ \item \mint{racket}|[X Y] (X -> Y) (List-Of Y) -> (List-Of X)|
+ \item \mint{racket}|[X] (Number -> X) (List-Of Number) -> (List-Of X)|
+ \item \mint{racket}|[X Y] (X -> Y) (List-Of X) -> (List-Of Y)|
+\end{enumerate}
+
+\noindent\rule[0.5ex]{\linewidth}{1pt}
+
+\begin{center}
+ Der Rest ist mir/uns leider entfallen.\\
+ Grundsätzlich war die Klausur sehr ähnlich zu vorigen Klausuren.\\
+ GeTeXt von Marvin Borner.
+\end{center}
+
+\end{document}
diff --git a/exams/info1/hauptklausur/makefile b/exams/info1/hauptklausur/makefile
new file mode 100644
index 0000000..0c39a1b
--- /dev/null
+++ b/exams/info1/hauptklausur/makefile
@@ -0,0 +1,9 @@
+CC = xelatex
+BIB = biber
+VIEW = zathura
+
+all:
+ @$(CC) -shell-escape main
+
+run: all
+ @$(VIEW) main.pdf
diff --git a/exams/mathe1/hauptklausur/main.pdf b/exams/mathe1/hauptklausur/main.pdf
new file mode 100644
index 0000000..388d027
--- /dev/null
+++ b/exams/mathe1/hauptklausur/main.pdf
Binary files differ
diff --git a/exams/mathe1/hauptklausur/main.tex b/exams/mathe1/hauptklausur/main.tex
new file mode 100644
index 0000000..660bd85
--- /dev/null
+++ b/exams/mathe1/hauptklausur/main.tex
@@ -0,0 +1,90 @@
+\documentclass[a4paper, 11pt]{article}
+
+% Packages
+\usepackage[a4paper, inner=2.5cm, outer=2.5cm, top=2.5cm, bottom=2.5cm, bindingoffset=0cm]{geometry}
+\usepackage{amsmath,amsthm,amssymb,amsfonts}
+\usepackage{graphicx}
+\usepackage[colorlinks=true, allcolors=blue]{hyperref}
+\usepackage{fontspec,xunicode,xltxtra}
+\usepackage{biblatex}
+
+% GERMAN
+\usepackage[ngerman=ngerman-x-latest]{hyphsubst}
+\usepackage[ngerman]{babel}
+
+\usepackage{enumitem}
+
+% Figures
+\graphicspath{{figures/}}
+
+\newcommand{\N}{\mathbb{N}}
+\newcommand{\R}{\mathbb{R}}
+\newcommand{\Z}{\mathbb{Z}}
+\newcommand{\C}{\mathbb{C}}
+
+\begin{document}
+
+\title{\vspace{-2.0cm}Hauptklausur zu Mathematik 1 für Informatik}
+\author{Peter Ochs, Oskar Adolfson}
+\date{\today}
+
+\maketitle
+
+\begin{center}
+ Hilfsmittel: Stift, einseitig beschriftetes DIN A4 Blatt.\\
+ Zeit: 120min\\
+ \textbf{Keine Garantie auf korrekte Aufgaben/Punktezahlen.}
+\end{center}
+
+\section*{Aufgabe 1 [3+2+5=10]}
+Sei $z\in\C$.
+\begin{enumerate}[label=(\alph*)]
+ \item Berechnen Sie $z^8$ für $z=-1+i$ in der Form $z = a+ib$.
+ \item Schreiben Sie $\frac{5}{i-2}$ in der Form $z = a+ib$.
+ \item Berechnen Sie $z$ für $z^6=-64$.
+\end{enumerate}
+
+\section*{Aufgabe 2 [10]}
+Es gelte $f(x) = \frac{sin(x)}{\sqrt{x}}$. Zeigen Sie, dass für alle $x\in(0,\infty)$ gilt $$f''(x)+\frac{1}{x} \cdot f'(x) + \left(1-\frac{1}{4x^2}\right) \cdot f(x) = 0.$$
+
+\section*{Aufgabe 3 [2+3+2+3=10]}
+Für die Folge $(a_n)_{n\in\N}$ gelte $a_0 = 1$ und $a_{n+1} = \sqrt{1+a_n}$.
+\begin{enumerate}[label=(\alph*)]
+ \item Zeigen Sie, dass $(a_n)_{n\in\N}$ monoton ist.
+ \item Zeigen Sie, dass $(a_n)_{n\in\N}$ beschränkt ist.
+ \item Zeigen Sie, dass $(a_n)_{n\in\N}$ konvergiert.
+ \item Bestimmen Sie den Grenzwert von $(a_n)_{n\in\N}$.
+\end{enumerate}
+
+\section*{Aufgabe 4 [3+4+3=10]}
+$g$ sei eine Folge von Funktionen mit $g_n = \frac{nx}{1+|nx|}$.
+\begin{enumerate}[label=(\alph*)]
+ \item Zeigen Sie, dass $g_n$ für alle $n\in\N$ stetig ist.
+ \item Bestimmen Sie die Grenzfunktion von $g_n$.
+ \item Zeigen Sie, dass die Folge nicht gleichmäßig konvergiert.
+\end{enumerate}
+
+\section*{Aufgabe 5 [3+4+3=10]}
+Die Funktion $f$ in $\R$ sei zweifach stetig differenzierbar mit $f(0) = f'(0) = 0$ und $\forall x\in\R: f''(x) \ge 0$.
+\begin{enumerate}[label=(\alph*)]
+ \item Zeigen Sie, dass $\forall x\in\R: f(x) \ge 0$.
+ \item Zeigen Sie, dass ein $c\in\R$ mit $c>1$ existiert, sodass für alle $k\in\R, k \ge 1$ gilt $$0 \le f\left(\frac{1}{k}\right) \le \frac{c}{k^2}.$$
+ \item Zeigen Sie, dass die Reihe $\sum_{k=1}^\infty f\left(\frac{1}{k}\right)$ konvergiert.
+\end{enumerate}
+
+\section*{Aufgabe 6 [6+4=10]}
+Eine Funktion $f$ heißt konvex, wenn gilt $$f(\lambda x + (1 - \lambda) y) \le \lambda f(x) + (1-\lambda)f(y)\quad\forall x,y\in\R,\lambda\in[0,1].$$
+Eine Funktion $f$ heißt \textit{strikt} konvex, wenn gilt $$f(\lambda x + (1 - \lambda) y) < \lambda f(x) + (1-\lambda)f(y)\quad\forall x,y\in\R,x \ne y,\lambda\in[0,1].$$
+\begin{enumerate}[label=(\alph*)]
+ \item Zeigen Sie, dass für eine konvexe Funktion $f$ jedes lokale Minimum in $f$ auch das globale Minimum in $f$ ist.
+ \item Zeigen Sie, dass für eine strikt konvexe Funktion $f$ sogar nur ein globales Minimum existiert.
+\end{enumerate}
+
+\noindent\rule[0.5ex]{\linewidth}{1pt}
+
+\begin{center}
+ Einschätzung: Schwierig.\\
+ GeTeXt von Marvin Borner.
+\end{center}
+
+\end{document}
diff --git a/exams/mathe1/hauptklausur/makefile b/exams/mathe1/hauptklausur/makefile
new file mode 100644
index 0000000..4c73ad2
--- /dev/null
+++ b/exams/mathe1/hauptklausur/makefile
@@ -0,0 +1,19 @@
+CC = xelatex
+BIB = biber
+VIEW = zathura
+
+all:
+ @mkdir -p build/
+ @$(CC) --output-directory=build/ main
+
+full: clean
+ @mkdir -p build/
+ @$(CC) --output-directory=build/ main
+ @$(BIB) --input-directory=build/ main
+ @$(CC) --output-directory=build/ main
+
+clean:
+ @$(RM) -rf build
+
+run: clean all
+ @$(VIEW) build/main.pdf
diff --git a/exams/mathe2/hauptklausur/definitions.tex b/exams/mathe2/hauptklausur/definitions.tex
new file mode 100644
index 0000000..1f9cca4
--- /dev/null
+++ b/exams/mathe2/hauptklausur/definitions.tex
@@ -0,0 +1,152 @@
+%%%% START OF PREAMBLE
+% Copyright (c) 2021 Frederik, Franz, Marvin
+% Copyright (c) 2022 Linus, Benny, Marvin
+\usepackage[a4paper, inner=1cm, outer=1cm, top=2cm, bottom=2cm, bindingoffset=0cm]{geometry}
+\usepackage{amsmath,amsthm,amssymb,amsfonts}
+\usepackage{mathrsfs}
+\usepackage{braket}
+\usepackage{enumitem}
+\usepackage{csquotes}
+\usepackage{colortbl}
+\usepackage{environ}
+\usepackage{graphicx,tikz,xcolor,color,float,titlesec}
+\usepackage{pgfplots}
+\usepackage{fancyhdr}
+\usepackage{gauss}
+\usepackage{polynom}
+\usepackage{bm}
+\usepackage[ngerman=ngerman-x-latest]{hyphsubst}
+\usepackage[ngerman]{babel}
+\usetikzlibrary{matrix,shapes,trees}
+\usepgfplotslibrary{fillbetween}
+\pgfplotsset{compat=1.18}
+\setlength\parindent{0pt}
+\definecolor{ochsblau}{RGB}{26,122,219}
+\definecolor{ochsgelb}{RGB}{245,209,168}
+\definecolor{ochsorange}{RGB}{243,92,43}
+\renewcommand{\headrulewidth}{2pt}
+\let\oldheadrule\headrule
+\renewcommand{\headrule}{\color{ochsgelb}\oldheadrule}
+\newcommand\bracketify[1]{\lbrack#1\rbrack}
+\titleformat{\section}{\normalfont\large\bfseries\color{ochsblau}}{Aufgabe \thesection.\ }{0em}{\bracketify}
+%%%% END OF PREAMBLE
+
+%\usepackage{background}
+%\backgroundsetup{
+% position=current page.east,
+% angle=-90,
+% nodeanchor=east,
+% vshift=-5mm,
+% hshift=1cm,
+% opacity=1,
+% scale=3,
+% contents=Entwurf
+%}
+
+\newcommand\namesnstuff{
+ \pagestyle{fancy}
+ \fancyhf{}
+ \fancyhead[L,LO]{\textcolor{ochsblau}{\textbf{Name:}}}
+ \fancyhead[C,CO]{\textcolor{ochsblau}{\textbf{MFI2 - SS22}}}
+ \fancyhead[R,RO]{\textcolor{ochsblau}{\textbf{Hauptklausur}}}
+ \fancyfoot[C,CO]{\thepage}
+ \setlength{\headheight}{13.6pt}
+
+ \vspace{-2.0cm}
+ \noindent\includegraphics[width=0.2\textwidth]{../ochs_logo.png}
+ \begin{minipage}[b]{0.6\textwidth}
+ \centering
+ \textcolor{ochsblau}{\textbf{\Large Mathematik 2 für Informatik}}\\
+ \vspace{3mm}
+ Peter Ochs, Tobias Nordgauer\\
+ \vspace{3mm}
+ Sommersemester 2022
+ \end{minipage}
+ \noindent\includegraphics[width=0.2\textwidth]{../uni_logo.png}\\
+ \begin{center}\textcolor{ochsblau}{\textbf{Hauptklausur Gedächtnisprotokoll}}\end{center}
+}
+
+\newcommand\refiff[1]{\stackrel{\text{#1}}{\iff}}
+\newcommand\refimp[1]{\stackrel{\text{#1}}{\implies}}
+\newcommand\refeq[1]{\stackrel{\text{#1}}{=}}
+\newcommand\refless[1]{\stackrel{\text{#1}}{<}}
+\newcommand\refleads[1]{\stackrel{\text{#1}}{\leadsto}}
+
+\newcommand\NR{\textbf{Nebenrechnung: }}
+\newcommand\proposition{\textbf{Behauptung: }}
+\newcommand\toprove{\textbf{Zu zeigen: }}
+\newcommand\task{\textbf{Aufgabe: }}
+\newcommand\defi{\textbf{Definition: }}
+
+% denglish ftw
+\newcommand\da{\text{ da }}
+\newcommand\with{\text{ mit }}
+\newcommand\und{\text{ und }}
+\newcommand\oder{\text{ oder }}
+\newcommand\for{\text{ für }}
+\newcommand\when{\text{ wenn }}
+\newcommand\sei{\text{ sei }}
+
+\newcommand\Real{\mathrm{Re}} % Realteil
+\newcommand\Imag{\mathrm{Im}} % Imaginärteil
+
+\newcommand\N{\mathbb{N}}
+\newcommand\R{\mathbb{R}}
+\newcommand\Z{\mathbb{Z}}
+\newcommand\C{\mathbb{C}}
+\newcommand\Q{\mathbb{Q}}
+\renewcommand\P{\mathbb{P}}
+\renewcommand\O{\mathcal{O}}
+\newcommand\pot{\mathcal{P}}
+
+\newcommand\rank{\mathrm{rank}}
+\newcommand\lin{\mathrm{Lin}}
+\renewcommand\det{\mathrm{det}}
+\renewcommand\dim{\mathrm{dim}}
+
+\renewcommand\u{\boldsymbol{u}}
+\renewcommand\v{\boldsymbol{v}}
+\newcommand\w{\boldsymbol{w}}
+
+% for vertical line in gmatrix
+\usepackage{etoolbox}
+\makeatletter
+\patchcmd\g@matrix
+ {\vbox\bgroup}
+ {\vbox\bgroup\normalbaselines}
+ {}{}
+\makeatother
+\newcommand{\gvline}{%
+ \hspace{-\arraycolsep}%
+ \strut\vrule
+ \hspace{-\arraycolsep}%
+}
+
+% lol
+\makeatletter
+\renewenvironment{proof}[1][\proofname] {\par\pushQED{\qed}\normalfont\topsep6\p@\@plus6\p@\relax\trivlist\item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces}{\popQED\endtrivlist\@endpefalse}
+\makeatother
+\def\qedsymbol{\sc q.e.d.} % hmm?
+
+\newenvironment{induktion}{\renewcommand*{\proofname}{Beweis durch vollständige Induktion}\begin{proof}$ $\newline}{\end{proof}}
+\newcommand\IA[1]{\textbf{Induktionsanfang ($#1$):}}
+\newcommand\IV[1]{\textbf{Induktionsvoraussetzung:} Die Behauptung gelte für ein beliebiges aber festes $#1$.\\}
+\newcommand\IS[1]{\textbf{Induktionsschritt ($#1$):}}
+
+\newenvironment{gegenbeweis}{\renewcommand*{\proofname}{Beweis durch Gegenbeweis}\begin{proof}}{\end{proof}}
+\newenvironment{gegenbeispiel}{\renewcommand*{\proofname}{Beweis durch Gegenbeispiel}\begin{proof}}{\end{proof}}
+
+\NewEnviron{splitty}{\begin{displaymath}\begin{split}\BODY\end{split}\end{displaymath}}
+\newcolumntype{C}{>{$}c<{$}} % math-mode column
+
+\DeclareMathOperator{\ggT}{ggT}
+
+\newlist{abc}{enumerate}{10}
+\setlist[abc]{label=(\alph*)}
+
+\newlist{num}{enumerate}{10}
+\setlist[num]{label=\arabic*.}
+
+\newlist{rom}{enumerate}{10}
+\setlist[rom]{label=(\roman*)}
+
diff --git a/exams/mathe2/hauptklausur/main.pdf b/exams/mathe2/hauptklausur/main.pdf
new file mode 100644
index 0000000..196e85b
--- /dev/null
+++ b/exams/mathe2/hauptklausur/main.pdf
Binary files differ
diff --git a/exams/mathe2/hauptklausur/main.tex b/exams/mathe2/hauptklausur/main.tex
new file mode 100644
index 0000000..b70fc02
--- /dev/null
+++ b/exams/mathe2/hauptklausur/main.tex
@@ -0,0 +1,55 @@
+\documentclass[a4paper, 11pt]{article}
+\input{../definitions}
+\begin{document}
+\namesnstuff
+
+\textbf{Bedingungen: 120min Zeit, einseitig beschriebenes Cheat-Sheet}
+
+\section{10 Punkte}
+\begin{abc}
+ \item Bestimmen Sie $\ggT(1071, 462)$.
+ \item Bestimmen Sie $r,s\in\Z$, sodass $r\cdot462+s\cdot1071=\ggT(1071, 462)$.
+\end{abc}
+
+\section{10 Punkte}
+Bestimmen Sie alle Lösungen $x=(x_1,x_2,x_3,x_4)^\top\in(\Z/7\Z)^4$ des folgenden linearen Gleichungssystems über $\Z/7\Z$ und geben Sie die Lösungsmenge an: $$\begin{pmatrix}1&2&0&5\\3&1&5&2\\5&0&3&6\end{pmatrix}\begin{pmatrix}x_1\\x_2\\x_3\\x_4\end{pmatrix}=\begin{pmatrix}1\\4\\0\end{pmatrix}$$
+(Beachten Sie, dass alle Zahlen als Restklassen in $\Z/7\Z$ zu verstehen sind.)
+
+\section{4 + 4 + 2 = 10 Punkte}
+Sei $A=\begin{pmatrix}3&-2&-2\\0&1&0\\1&-1&0\end{pmatrix}\in\Q^{3\times3}$ gegeben.
+\begin{abc}
+ \item Bestimmen Sie alle Eigenwerte von $A$ und die zugehörigen Eigenräume.
+ \item Entscheiden Sie, ob $A$ diagonalisierbar ist und geben Sie gegebenenfalls ein $S$ und $D$ an, so dass $S^{-1}AS=D$ eine Diagonalmatrix ist.
+ \item Entscheiden Sie, ob $A$ invertierbar ist und geben Sie gegebenenfalls $A^{-1}$ an.
+\end{abc}
+
+\section{3 + 4 + 3 = 10 Punkte}
+Sei $V=\{a+b\sqrt{2}\mid a,b\in\Q\}$.
+\begin{abc}
+ \item Zeigen Sei, dass $V$ ein $\Q$-Untervektorraum von $\R$ ist.
+ \item Bestimmen Sie eine Basis $\mathcal{B}$ von $V$ als $\Q$-Vektorraum und folgern Sie die Dimension von $V$.
+ \item Betrachten Sie nun den Vektorraum $U=\Q[X]_{\le 2}$ und die Basis $\mathcal{A}=(1,X,X^2)$ (dass $\mathcal{A}$ eine Basis von $U$ ist, muss nicht gezeigt werden). Sei außerdem $\varphi: U\to V,\ p(X)\mapsto p(\sqrt{2})$, eine Abbildung, die $\sqrt{2}$ anstelle von $X$ in ein Polynom einsetzt. Diese Abbildung ist linear und wohldefiniert (muss nicht gezeigt werden). Bestimmen Sie die Darstellungsmatrix $M_\mathcal{A}^\mathcal{B}(\varphi)$ von $\varphi$ bezüglich der Basen $\mathcal{A}$ und $\mathcal{B}$.
+\end{abc}
+
+\section{3 + 4 + 3 = 10 Punkte}
+Sei $(V,\braket{\cdot,\cdot})$ ein Prä-Hilbert-Raum mit induzierter Norm $||v||=\sqrt{\braket{v,v}}$. Zeigen Sie, dass für alle $u,v\in V$ gilt:
+\begin{abc}
+ \item $||u+v||^2+||u-v||^2=2(||u||^2+||v||^2)$
+ \item $||u+v||=||u-v||\iff\braket{u,v}=0$
+ \item Ist eine der Bedingungen in (b) erfüllt, so gilt $P_{\lin(V)}(u+v)=v$ für die Projektion von $u+v$ auf die lineare Hülle von $v$.
+\end{abc}
+
+\section{2 + 2 + 2 + 2 + 2 = 10 Punkte}
+Entscheiden Sie über folgende Aussagen, ob sie wahr oder falsch sind. Begründen Sie ihre Antwort.
+\begin{abc}
+ \item Jedes Element in $\Z/25\Z$ hat ein multiplikatives Inverses.
+ \item Das Polynom $X^4+2$ hat in $\Z/18\Z$ eine Nullstelle.
+ \item Die Signatur von $(1,2,3,4)\in S_5$ ist $1$.
+ \item Es gibt eine lineare Abbildung $\varphi: \R^4\to\R^3$, die injektiv ist.
+ \item Die Matrix $\begin{pmatrix}1&1\\0&1\end{pmatrix}$ ist in $\C$ diagonalisierbar.
+\end{abc}
+\par\hrulefill\par
+\begin{center}
+ \textbf{Danke für die Hilfe an alle Beteiligten.\\Keine Garantie auf Korrektheit.\\\LaTeX\ von Marvin Borner.}
+\end{center}
+\end{document}
diff --git a/exams/mathe2/nachklausur/definitions.tex b/exams/mathe2/nachklausur/definitions.tex
new file mode 100644
index 0000000..7f2cc63
--- /dev/null
+++ b/exams/mathe2/nachklausur/definitions.tex
@@ -0,0 +1,152 @@
+%%%% START OF PREAMBLE
+% Copyright (c) 2021 Frederik, Franz, Marvin
+% Copyright (c) 2022 Linus, Benny, Marvin
+\usepackage[a4paper, inner=1cm, outer=1cm, top=2cm, bottom=2cm, bindingoffset=0cm]{geometry}
+\usepackage{amsmath,amsthm,amssymb,amsfonts}
+\usepackage{mathrsfs}
+\usepackage{braket}
+\usepackage{enumitem}
+\usepackage{csquotes}
+\usepackage{colortbl}
+\usepackage{environ}
+\usepackage{graphicx,tikz,xcolor,color,float,titlesec}
+\usepackage{pgfplots}
+\usepackage{fancyhdr}
+\usepackage{gauss}
+\usepackage{polynom}
+\usepackage{bm}
+\usepackage[ngerman=ngerman-x-latest]{hyphsubst}
+\usepackage[ngerman]{babel}
+\usetikzlibrary{matrix,shapes,trees}
+\usepgfplotslibrary{fillbetween}
+\pgfplotsset{compat=1.18}
+\setlength\parindent{0pt}
+\definecolor{ochsblau}{RGB}{26,122,219}
+\definecolor{ochsgelb}{RGB}{245,209,168}
+\definecolor{ochsorange}{RGB}{243,92,43}
+\renewcommand{\headrulewidth}{2pt}
+\let\oldheadrule\headrule
+\renewcommand{\headrule}{\color{ochsgelb}\oldheadrule}
+\newcommand\bracketify[1]{\lbrack#1\rbrack}
+\titleformat{\section}{\normalfont\large\bfseries\color{ochsblau}}{Aufgabe \thesection.\ }{0em}{\bracketify}
+%%%% END OF PREAMBLE
+
+%\usepackage{background}
+%\backgroundsetup{
+% position=current page.east,
+% angle=-90,
+% nodeanchor=east,
+% vshift=-5mm,
+% hshift=1cm,
+% opacity=1,
+% scale=3,
+% contents=Entwurf
+%}
+
+\newcommand\namesnstuff{
+ \pagestyle{fancy}
+ \fancyhf{}
+ \fancyhead[L,LO]{\textcolor{ochsblau}{\textbf{Name:}}}
+ \fancyhead[C,CO]{\textcolor{ochsblau}{\textbf{MFI2 - SS22}}}
+ \fancyhead[R,RO]{\textcolor{ochsblau}{\textbf{Nachklausur}}}
+ \fancyfoot[C,CO]{\thepage}
+ \setlength{\headheight}{13.6pt}
+
+ \vspace{-2.0cm}
+ \noindent\includegraphics[width=0.2\textwidth]{../ochs_logo.png}
+ \begin{minipage}[b]{0.6\textwidth}
+ \centering
+ \textcolor{ochsblau}{\textbf{\Large Mathematik 2 für Informatik}}\\
+ \vspace{3mm}
+ Peter Ochs, Tobias Nordgauer\\
+ \vspace{3mm}
+ Sommersemester 2022
+ \end{minipage}
+ \noindent\includegraphics[width=0.2\textwidth]{../uni_logo.png}\\
+ \begin{center}\textcolor{ochsblau}{\textbf{Nachklausur Gedächtnisprotokoll}}\end{center}
+}
+
+\newcommand\refiff[1]{\stackrel{\text{#1}}{\iff}}
+\newcommand\refimp[1]{\stackrel{\text{#1}}{\implies}}
+\newcommand\refeq[1]{\stackrel{\text{#1}}{=}}
+\newcommand\refless[1]{\stackrel{\text{#1}}{<}}
+\newcommand\refleads[1]{\stackrel{\text{#1}}{\leadsto}}
+
+\newcommand\NR{\textbf{Nebenrechnung: }}
+\newcommand\proposition{\textbf{Behauptung: }}
+\newcommand\toprove{\textbf{Zu zeigen: }}
+\newcommand\task{\textbf{Aufgabe: }}
+\newcommand\defi{\textbf{Definition: }}
+
+% denglish ftw
+\newcommand\da{\text{ da }}
+\newcommand\with{\text{ mit }}
+\newcommand\und{\text{ und }}
+\newcommand\oder{\text{ oder }}
+\newcommand\for{\text{ für }}
+\newcommand\when{\text{ wenn }}
+\newcommand\sei{\text{ sei }}
+
+\newcommand\Real{\mathrm{Re}} % Realteil
+\newcommand\Imag{\mathrm{Im}} % Imaginärteil
+
+\newcommand\N{\mathbb{N}}
+\newcommand\R{\mathbb{R}}
+\newcommand\Z{\mathbb{Z}}
+\newcommand\C{\mathbb{C}}
+\newcommand\Q{\mathbb{Q}}
+\renewcommand\P{\mathbb{P}}
+\renewcommand\O{\mathcal{O}}
+\newcommand\pot{\mathcal{P}}
+
+\newcommand\rank{\mathrm{rank}}
+\newcommand\lin{\mathrm{Lin}}
+\renewcommand\det{\mathrm{det}}
+\renewcommand\dim{\mathrm{dim}}
+
+\renewcommand\u{\boldsymbol{u}}
+\renewcommand\v{\boldsymbol{v}}
+\newcommand\w{\boldsymbol{w}}
+
+% for vertical line in gmatrix
+\usepackage{etoolbox}
+\makeatletter
+\patchcmd\g@matrix
+ {\vbox\bgroup}
+ {\vbox\bgroup\normalbaselines}
+ {}{}
+\makeatother
+\newcommand{\gvline}{%
+ \hspace{-\arraycolsep}%
+ \strut\vrule
+ \hspace{-\arraycolsep}%
+}
+
+% lol
+\makeatletter
+\renewenvironment{proof}[1][\proofname] {\par\pushQED{\qed}\normalfont\topsep6\p@\@plus6\p@\relax\trivlist\item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces}{\popQED\endtrivlist\@endpefalse}
+\makeatother
+\def\qedsymbol{\sc q.e.d.} % hmm?
+
+\newenvironment{induktion}{\renewcommand*{\proofname}{Beweis durch vollständige Induktion}\begin{proof}$ $\newline}{\end{proof}}
+\newcommand\IA[1]{\textbf{Induktionsanfang ($#1$):}}
+\newcommand\IV[1]{\textbf{Induktionsvoraussetzung:} Die Behauptung gelte für ein beliebiges aber festes $#1$.\\}
+\newcommand\IS[1]{\textbf{Induktionsschritt ($#1$):}}
+
+\newenvironment{gegenbeweis}{\renewcommand*{\proofname}{Beweis durch Gegenbeweis}\begin{proof}}{\end{proof}}
+\newenvironment{gegenbeispiel}{\renewcommand*{\proofname}{Beweis durch Gegenbeispiel}\begin{proof}}{\end{proof}}
+
+\NewEnviron{splitty}{\begin{displaymath}\begin{split}\BODY\end{split}\end{displaymath}}
+\newcolumntype{C}{>{$}c<{$}} % math-mode column
+
+\DeclareMathOperator{\ggT}{ggT}
+
+\newlist{abc}{enumerate}{10}
+\setlist[abc]{label=(\alph*)}
+
+\newlist{num}{enumerate}{10}
+\setlist[num]{label=\arabic*.}
+
+\newlist{rom}{enumerate}{10}
+\setlist[rom]{label=(\roman*)}
+
diff --git a/exams/mathe2/nachklausur/main.pdf b/exams/mathe2/nachklausur/main.pdf
new file mode 100644
index 0000000..d3cac97
--- /dev/null
+++ b/exams/mathe2/nachklausur/main.pdf
Binary files differ
diff --git a/exams/mathe2/nachklausur/main.tex b/exams/mathe2/nachklausur/main.tex
new file mode 100644
index 0000000..0f2cd6b
--- /dev/null
+++ b/exams/mathe2/nachklausur/main.tex
@@ -0,0 +1,61 @@
+\documentclass[a4paper, 11pt]{article}
+\input{../definitions}
+\begin{document}
+\namesnstuff
+
+\textbf{Bedingungen: 120min Zeit, einseitig beschriebenes Cheat-Sheet}
+
+\section{10 Punkte}
+Finden Sie mithilfe des Chinesischen Restsatzes alle $x\in\Z$, sodass
+\begin{align*}
+ x&\equiv2\pmod{3}\\
+ x&\equiv3\pmod{4}\\
+ x&\equiv5\pmod{7}
+\end{align*}
+gilt.
+
+\section{10 Punkte}
+Betrachten Sie die Matrix $$A=\begin{pmatrix}1&7&0&-1\\0&1&14&6\\-1&-2&1&-1\\4&-7&0&2\end{pmatrix}\in(\Z/7\Z)^{4\times4}$$
+Bestimmen Sie, falls existent, die Inverse von $A$. Geben Sie die Einträge von $A^{-1}$ mit den kanonischen Repräsentaten $\{0,1,2,3,4,5,6\}$ aus $\Z/7\Z$ an.
+
+\textit{Beachten Sie:} Wie üblich sind die Zahlen als Restklassen zu lesen.
+
+\section{4 + 3 + 3 = 10 Punkte}
+Betrachten Sie die Matrix $$A=\begin{pmatrix}5&3&-3\\0&-1&0\\6&3&-4\end{pmatrix}\in\R^{3\times3}.$$
+\begin{abc}
+ \item Bestimmen Sie alle Eigenwerte von $A$ und die zugehörigen Eigenräume.
+ \item Entscheiden Sie über Diagonalisierbarkeit von $A$ und geben Sie gegebenenfalls eine Diagonalmatrix $D$ und eine invertierbare Matrix $S$ an, sodass $S^{-1}AS = D$.
+ \item Bestimmen Sie $A^n$ für $n=10$.
+\end{abc}
+
+\section{3 + 4 + 3 = 10 Punkte}
+Betrachten Sie für $I := \begin{pmatrix}0&1\\-1&0\end{pmatrix}$ und $E_2 := \begin{pmatrix}1&0\\0&1\end{pmatrix}\in\R^{2\times2}$ die Menge $$V := \{\lambda\cdot E_2 + \mu \cdot I\mid\lambda,\mu\in\R\}$$
+\begin{abc}
+ \item Zeigen Sie: $V$ ist ein $\R$-Untervektorraum von $\R^{2\times2}$.
+ \item Bestimmen Sie eine Basis $\mathcal{B}$ von $V$ als $\R$-Vektorraum und folgern Sie die Dimension von $V$.
+ \item Betrachten Sie nun den Vektorraum $U:=\R[X]_{\le 3}$ der Polynome mit Koeffizienten aus $\R$ vom Grad $\le3$ und die Basis $\mathcal{A}:=(X^0,X,X^2,X^3)$ (dass $\mathcal{A}$ eine Basis von $U$ ist, muss nicht gezeigt werden). Sei außerdem $$\varphi: U\to V,\quad p(X)\mapsto p(I)$$ die Abbildung, die $I$ in ein Polynom aus $U$ anstelle der Unbekannten $X$ einsetzt (dabei ist $I^0$ definiert als die Einheitsmatrix $E_2$). Diese Abbildung ist linear und wohldefiniert (muss nicht gezeigt werden). Bestimmen Sie die Darstellungsmatrix $M_\mathcal{A}^\mathcal{B}(\varphi)$ von $\varphi$ bezüglich der Basen $\mathcal{A}$ und $\mathcal{B}$.
+\end{abc}
+
+\section{3 + 3 + 4 = 10 Punkte}
+Sei $\varphi: V\to V$ ein Isomorphismus zwischen zwei $K$-Vektorräumen.
+\begin{abc}
+ \item Zeigen Sie: $0$ ist kein Eigenwert von $\varphi$.
+ \item Zeigen Sie: Ist $\lambda$ Eigenwert von $\varphi$, so ist $\lambda^{-1}$ Eigenwert von $\varphi^{-1}$.
+ \item Sei nun $(V,\braket{\cdot,\cdot})$ ein reeler Prä-Hilbertraum und $\phi: V\to V$ eine orthogonale Abbildung, d.h. es gilt für alle $v,w\in V$:
+ $$\braket{\phi(v), \phi(w)} = \braket{v,w}$$ Zeigen Sie: Die einzigen möglichen Eigenwerte von $\phi$ sind $\pm1$.
+\end{abc}
+
+\section{2 + 2 + 2 + 2 + 2 = 10 Punkte}
+Entscheiden Sie über folgende Aussagen, ob sie wahr oder falsch sind. Begründen Sie ihre Antwort.
+\begin{abc}
+ \item Für zwei Polynome $p,q\in\Z/20\Z[X]$ gilt stets: $\mathrm{grad}(pq)=\mathrm{grad}(p)+\mathrm{grad}(q)$.
+ \item $X^2+4$ hat in $\Z/13\Z$ genau 2 Nullstellen.
+ \item Es gibt ganze Zahlen $r,s\in\Z$, sodass $3=r\cdot42+s\cdot99$
+ \item Jede lineare Abbildung $\varphi: \R^3\to\R^3$ ist ein Isomorphismus.
+ \item Jede Gruppe, deren Ordnung eine Primzahl ist, ist zyklisch.
+\end{abc}
+\par\hrulefill\par
+\begin{center}
+ \textbf{Danke für die Hilfe an alle Beteiligten.\\Keine Garantie auf Korrektheit.\\\LaTeX\ von Marvin Borner.}
+\end{center}
+\end{document}
diff --git a/notes/algo/header.tex b/notes/algo/header.tex
new file mode 100644
index 0000000..3709c26
--- /dev/null
+++ b/notes/algo/header.tex
@@ -0,0 +1,68 @@
+\usepackage{braket}
+\usepackage{polynom}
+\usepackage{amsthm}
+\usepackage{csquotes}
+\usepackage{svg}
+\usepackage{environ}
+\usepackage{mathtools}
+\usepackage{tikz,pgfplots}
+\usepackage{titleps}
+\usepackage{tcolorbox}
+\usepackage{enumitem}
+\usepackage{listings}
+\usepackage{soul}
+\usepackage{forest}
+
+\pgfplotsset{width=10cm,compat=1.15}
+\usepgfplotslibrary{external}
+\usetikzlibrary{calc,trees,positioning,arrows,arrows.meta,fit,shapes,chains,shapes.multipart}
+%\tikzexternalize
+\setcounter{MaxMatrixCols}{20}
+\graphicspath{{assets}}
+
+\newpagestyle{main}{\sethead{\toptitlemarks\thesection\quad\sectiontitle}{}{\thepage}\setheadrule{.4pt}}
+\pagestyle{main}
+
+\newtcolorbox{proof-box}{title=Proof,colback=green!5!white,arc=0pt,outer arc=0pt,colframe=green!60!black}
+\newtcolorbox{bsp-box}{title=Example,colback=orange!5!white,arc=0pt,outer arc=0pt,colframe=orange!60!black}
+\newtcolorbox{visu-box}{title=Visualisation,colback=cyan!5!white,arc=0pt,outer arc=0pt,colframe=cyan!60!black}
+\newtcolorbox{bem-box}{title=Note,colback=gray!5!white,arc=0pt,outer arc=0pt,colframe=gray!60!black}
+\newtcolorbox{prob-box}{title=Problem,colback=gray!5!white,arc=0pt,outer arc=0pt,colframe=gray!60!black}
+\NewEnviron{splitty}{\begin{displaymath}\begin{split}\BODY\end{split}\end{displaymath}}
+
+\newcommand\toprove{\textbf{Zu zeigen: }}
+
+\newcommand\N{\mathbb{N}}
+\newcommand\R{\mathbb{R}}
+\newcommand\Z{\mathbb{Z}}
+\newcommand\Q{\mathbb{Q}}
+\newcommand\C{\mathbb{C}}
+\renewcommand\P{\mathbb{P}}
+\renewcommand\O{\mathcal{O}}
+\newcommand\pot{\mathcal{P}}
+\newcommand{\cupdot}{\mathbin{\mathaccent\cdot\cup}}
+\newcommand{\bigcupdot}{\dot{\bigcup}}
+
+\DeclareMathOperator{\ggT}{ggT}
+\DeclareMathOperator{\kgV}{kgV}
+
+\newlist{abc}{enumerate}{10}
+\setlist[abc]{label=(\alph*)}
+
+\newlist{num}{enumerate}{10}
+\setlist[num]{label=\arabic*.}
+
+\newlist{rom}{enumerate}{10}
+\setlist[rom]{label=(\roman*)}
+
+\makeatletter
+\renewenvironment{proof}[1][\proofname] {\par\pushQED{\qed}\normalfont\topsep6\p@\@plus6\p@\relax\trivlist\item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces}{\popQED\endtrivlist\@endpefalse}
+\makeatother
+\def\qedsymbol{\sc q.e.d.} % hmm?
+
+\lstset{
+ basicstyle=\ttfamily,
+ escapeinside={(*@}{@*)},
+ numbers=left,
+ mathescape
+}
diff --git a/notes/algo/main.md b/notes/algo/main.md
new file mode 100644
index 0000000..88b3e3c
--- /dev/null
+++ b/notes/algo/main.md
@@ -0,0 +1,1228 @@
+---
+author: Marvin Borner
+date: "`\\today`{=tex}"
+lang: en-US
+pandoc-latex-environment:
+ bem-box:
+ - bem
+ bsp-box:
+ - bsp
+ prob-box:
+ - prob
+ proof-box:
+ - proof
+ visu-box:
+ - visu
+toc-title: Content
+---
+
+```{=tex}
+\newpage
+\renewcommand\O{\mathcal{O}} % IDK WHY
+```
+# Tricks
+
+## Logarithms
+
+$$\log_a(x)=\frac{\log_b(x)}{\log_b(a)}$$
+
+# Big-O-Notation
+
+- $f\in\O(g)$: $f$ is of order at most $g$:
+ $$0\ge\limsup_{n\to\infty}\frac{f(n)}{g(n)}<\infty$$
+- $f\in\Omega(g)$: $f$ is of order at least $g$:
+ $$0<\liminf_{n\to\infty}\frac{f(n)}{g(n)}\le\infty\iff g\in\O(f)$$
+- $f\in o(g)$: $f$ is of order strictly smaller than $g$:
+ $$0\ge\limsup_{n\to\infty}\frac{f(n)}{g(n)}=0$$
+- $f\in\omega(g)$: $f$ is of order strictly larger than $g$:
+ $$\liminf_{n\to\infty}\frac{f(n)}{g(n)}=\infty\iff g\in o(f)$$
+- $f\in\Theta(g)$: $f$ has exactly the same order as $g$:
+ $$0<\liminf_{n\to\infty}\frac{f(n)}{g(n)}\le\limsup_{n\to\infty}\frac{f(n)}{g(n)}<\infty\iff f\in\O(g)\land f\in\Omega(g)$$
+
+## Naming
+
+- linear $\implies\Theta(n)$
+- sublinear $\implies o(n)$
+- superlinear $\implies\omega(n)$
+- polynomial $\implies\Theta(n^a)$
+- exponential $\implies\Theta(2^n)$
+
+## Rules
+
+- $f\in\O(g_1 + g_2)\land g_1\in\O(g_2)\implies f\in\O(g_2)$
+- $f_1\in\O(g_1)\land f_2\in\O(g_2)\implies f_1+f_2\in\O(g_1+g_2)$
+- $f\in g_1\O(g_2)\implies f\in\O(g_1g_2)$
+- $f\in\O(g_1),g_1\in\O(g_2)\implies f\in\O(g_2)$
+
+# Divide and conquer
+
+::: prob
+Given two integers $x$ and $y$, compute their product $x\cdot y$.
+:::
+
+We know that $x=2^{n/2}x_l+x_r$ and $y=2^{n/2}y_l+y_r$.
+
+We use the following equality:
+$$(x_ly_r+x_ry_l)=(x_l+x_r)(y_l+y_r)-x_ly_l-x_ry_r$$ leading to
+`\begin{align*} x\cdot y&=2^nx_ly_l+2^{n/2}(x_ly_r+x_ry_l)+x_ry_r\\ &=2^nx_ly_l+2^{n/2}((x_l+x_r)(y_l+y_r)-x_ly_l-x_ry_r)+x_ry_r\\ &=2^{n/2}x_ly_l+(1-2^{n/2})x_ry_r+2^{n/2}(x_l+x_r)(y_ly_r). \end{align*}`{=tex}
+Therefore we get the same result with 3 instead of 4 multiplications.
+
+**If we apply this principle once:** Running time of $(3/4)n^2$ instead
+of $n^2$.
+
+**If we apply this principle recursively:** Running time of
+$\O(n^{\log_23})\approx\O(n^{1.59})$ instead of $n^2$ (calculated using
+the height of a recursion tree).
+
+## Recursion tree
+
+::: visu
+```{=tex}
+\begin{center}\begin{forest}
+ [,circle,draw
+ [,circle,draw [\vdots] [\vdots] [\vdots] [\vdots]]
+ [,circle,draw [\vdots] [\vdots] [\vdots] [\vdots]]
+ [,circle,draw [\vdots] [\vdots] [\vdots] [\vdots]]
+ [,circle,draw [\vdots] [\vdots] [\vdots] [\vdots]]
+ ]
+\end{forest}\end{center}
+```
+:::
+
+- Level $k$ has $a^k$ problems of size $\frac{n}{b^k}$
+- Total height of tree: $\lceil\log_bn\rceil$
+- Number of problems at the bottom of the tree is
+ $a^{\log_bn}=n^{\log_ba}$
+- Time spent at the bottom is $\Theta(n^{\log_ba})$
+
+## Master theorem
+
+If $T(n)=aT(\lceil n/b\rceil)+\O(n^d)$ for constants $a>0$, $b>1$ and
+$d\ge0$, then
+$$T(n)=\begin{cases}\O(n^d)&d>\log_ba\\\O(n^d\log_n)&d=log_ba\\\O(n^{log_ba})&d<\log_ba\end{cases}$$
+
+::: bsp
+Previous example of clever integer multiplication:
+$$T(n)=3T(n/2)+\O(n)\implies T(n)=\O(n^{\log_23})$$
+:::
+
+# Arrays and lists
+
+## Array
+
+- needs to be allocated in advance
+- read/write happens in constant time (using memory address)
+
+## Doubly linked list
+
+::: visu
+```{=tex}
+\begin{center}\begin{tikzpicture}
+ [
+ double link/.style n args=2{
+ on chain,
+ rectangle split,
+ rectangle split horizontal,
+ rectangle split parts=2,
+ draw,
+ anchor=center,
+ text height=1.5ex,
+ node contents={#1\nodepart{two}#2},
+ },
+ start chain=going right,
+ ]
+ \node [on chain] {NIL};
+ \node [join={by <-}, double link={a}{b}];
+ \node [join={by <->}, double link={c}{d}];
+ \node (a) [join={by <->}, double link={e}{f}];
+ \node (b) [on chain, right=2.5pt of a.east] {$\cdots$};
+ \node [double link={y}{z}, right=2.5pt of b.east];
+ \node [join={by ->}, on chain] {NIL};
+\end{tikzpicture}\end{center}
+```
+:::
+
+NIL can be replaced by a sentinel element, basically linking the list to
+form a loop.
+
+### Basic operations
+
+- **Insert**: If the current pointer is at $e$, inserting $x$ after
+ $e$ is possible in $\O(1)$.
+- **Delete**: If the current pointer is at $e$, deleting $x$ before
+ $e$ is possible in $\O(1)$.
+- **Find element with key**: We need to walk through the whole list
+ $\implies\O(n)$
+- **Delete a whole sublist**: If you know the first and last element
+ of the sublist: $\O(1)$
+- **Insert a list after element**: Obviously also $\O(1)$
+
+## Singly linked list
+
+::: visu
+```{=tex}
+\begin{center}\begin{tikzpicture}
+ [
+ link/.style n args=2{
+ on chain,
+ rectangle split,
+ rectangle split horizontal,
+ rectangle split parts=2,
+ draw,
+ anchor=center,
+ text height=1.5ex,
+ node contents={#1\nodepart{two}#2},
+ },
+ start chain=going right,
+ ]
+ \node [on chain] {head};
+ \node [join={by ->}, link={a}{b}];
+ \node [join={by ->}, link={c}{d}];
+ \node (a) [join={by ->}, link={e}{f}];
+ \node (b) [on chain, right=2.5pt of a.east] {$\cdots$};
+ \node [link={y}{z}, right=2.5pt of b.east];
+ \node [join={by ->}, on chain] {NIL};
+\end{tikzpicture}\end{center}
+```
+:::
+
+- needs less storage
+- no constant time deletion $\implies$ not good
+
+# Trees
+
+::: visu
+```{=tex}
+\begin{center}\begin{forest}
+ [root,circle,draw
+ [a,circle,draw [b,circle,draw] [,circle,draw [,circle,draw]]]
+ [,circle,draw [,phantom] [,phantom]]
+ [,circle,draw [,circle,draw] [,circle,draw]]]
+\end{forest}\end{center}
+```
+- (a) is the parent/predecessor of (b)
+
+- (b) is a child of (a)
+:::
+
+- *Height of a vertex*: length of the shortest path from the vertex to
+ the root
+- *Height of the tree*: maximum vertex height in the tree
+
+## Binary tree
+
+- each vertex has at most 2 children
+- *complete* if all layers except the last one are filled
+- *full* if the last level is filled completely
+
+::: visu
+```{=tex}
+\begin{minipage}{0.5\textwidth}\begin{center}
+\textbf{Complete}\bigskip\\
+\begin{forest}
+ [,circle,draw
+ [,circle,draw
+ [,circle,draw [,circle,draw] [,circle,draw]]
+ [,circle,draw [,circle,draw]]]
+ [,circle,draw [,circle,draw] [,circle,draw]]]
+\end{forest}\end{center}\end{minipage}%
+\begin{minipage}{0.5\textwidth}\begin{center}
+\textbf{Full}\bigskip\\
+\begin{forest}
+ [,circle,draw
+ [,circle,draw
+ [,circle,draw]
+ [,circle,draw]]
+ [,circle,draw [,circle,draw] [,circle,draw]]]
+\end{forest}\end{center}\end{minipage}
+```
+:::
+
+### Height of binary tree
+
+- Full binary tree with $n$ vertices: $\log_2(n+1)-1\in\Theta(\log n)$
+- Complete binary tree with $n$ vertices:
+ $\lceil\log_2(n+1)-1\rceil\in\Theta(\log n)$
+
+### Representation
+
+- Complete binary tree: Array with entries layer by layer
+- Arbitrary binary tree: Each vertex contains the key value and
+ pointers to left, right, and parent vertices
+ - Elegant: Each vertex has three pointers: A pointer to its
+ parent, leftmost child, and right sibling
+
+# Stack and Queue
+
+## Stack
+
+- Analogy: Stack of books to read
+- `Push(x)` inserts the new element $x$ to the stack
+- `Pop()` removes the next element from the stack (LIFO)
+
+### Implementation
+
+- Array with a pointer to the current element, `Push` and `Pop` in
+ $\O(1)$
+- Doubly linked list with pointer to the end of the list
+- Singly linked list and insert elements at the beginning of the list
+
+## Queue
+
+- Analogy: waiting line of customers
+- `Enqueue(x)` insertes the new element $x$ to the end of the queue
+- `Dequeue()` removes the next element from the queue (FIFO)
+
+### Implementation
+
+- Array with two pointers, one to the head and one to the tail
+ $\implies$ `Enqueue`/`Dequeue` in $\O(1)$
+- Linked lists
+
+# Heaps and priority queues
+
+## Heaps
+
+- Data structure that stores elements as vertices in a tree
+- Each element has a key value assigned to it
+- Max-heap property: all vertices in the tree satisfy
+ $$\mathrm{key}(\mathrm{parent}(v))\ge\mathrm{key}(v)$$
+
+::: visu
+```{=tex}
+\begin{center}\begin{forest}
+ [7,circle,draw
+ [5,circle,draw [1,circle,draw] [3,circle,draw [1,circle,draw] [2,circle,draw] [3,circle,draw]]]
+ [1,circle,draw [,phantom] [,phantom]]
+ [2,circle,draw [1,circle,draw] [0,circle,draw]]]
+\end{forest}\end{center}
+```
+:::
+
+- Binary heap:
+ - Each vertex has at most two children
+ - Layers must be finished before starting a new one (left to right
+ insertion)
+ - Advantage:
+ - Control over height/width of tree
+ - easy storage in array without any pointers
+
+### Usage
+
+- Compromise between a completely unsorted and completely sorted array
+- Easier to maintain/build than a sorted array
+- Useful for many other data structures (e.g. priority queue)
+
+### `Heapify`
+
+The `Heapify` operation can repair a heap with a violated heap property
+($\mathrm{key}(i)<\mathrm{key}(\mathrm{child}(i))$ for some vertex $i$
+and at least one child).
+
+::: visu
+```{=tex}
+\begin{center}\begin{forest}
+ [2,circle,draw
+ [7,circle,draw,tikz={\node [draw,black!60!green,fit to=tree] {};}
+ [4,circle,draw [3,circle,draw] [3,circle,draw]]
+ [1,circle,draw]]
+ [,phantom,circle,draw]
+ [,phantom,circle,draw]
+ [6,circle,draw,tikz={\node [draw,black!60!green,fit to=tree] {}; \draw[<-,black!60!green] (.east)--++(2em,0pt) node[anchor=west,align=center]{Not violated!};}
+ [5,circle,draw [2,circle,draw]]]] {
+ \draw[<-,red] (.east)--++(2em,0pt) node[anchor=west,align=center]{Violated!};
+ }
+\end{forest}\end{center}
+```
+:::
+
+**Procedure**: "Let key($i$) float down"
+
+- Swap $i$ with the larger of its children
+- Recursively call `heapify` on this child
+- Stop when heap condition is no longer violated
+
+::: visu
+```{=tex}
+\begin{minipage}{0.33\textwidth}\begin{center}\textbf{1.}\\\begin{forest}
+ [2,circle,draw
+ [7,circle,draw
+ [4,circle,draw [3,circle,draw] [3,circle,draw]]
+ [1,circle,draw]] {\draw[<->] () .. controls +(north west:0.6cm) and +(west:1cm) .. (!u);}
+ [,phantom,circle,draw]
+ [,phantom,circle,draw]
+ [6,circle,draw
+ [5,circle,draw [2,circle,draw]]]]
+\end{forest}\end{center}\end{minipage}%
+\begin{minipage}{0.33\textwidth}\begin{center}\textbf{2.}\\\begin{forest}
+ [7,circle,draw
+ [2,circle,draw
+ [4,circle,draw [3,circle,draw] [3,circle,draw]] {\draw[<->] () .. controls +(north west:0.6cm) and +(west:1cm) .. (!u);}
+ [1,circle,draw]]
+ [,phantom,circle,draw]
+ [,phantom,circle,draw]
+ [6,circle,draw
+ [5,circle,draw [2,circle,draw]]]]
+\end{forest}\end{center}\end{minipage}%
+\begin{minipage}{0.33\textwidth}\begin{center}\textbf{3.}\\\begin{forest}
+ [7,circle,draw
+ [4,circle,draw
+ [2,circle,draw
+ [3,circle,draw] {\draw[<->] () .. controls +(north west:0.6cm) and +(west:1cm) .. (!u);}
+ [3,circle,draw]]
+ [1,circle,draw]]
+ [,phantom,circle,draw]
+ [,phantom,circle,draw]
+ [6,circle,draw
+ [5,circle,draw [2,circle,draw]]]]
+\end{forest}\end{center}\end{minipage}%
+```
+:::
+
+**Worst case running time**:
+
+- Number of swapping operations is at most the height of the tree
+- Height of tree is at most $h=\lceil\log(n)\rceil=\O(\log n)$
+- Swapping is in $\O(1) \implies$ worst case running time is
+ $\O(\log n)$
+
+### `DecreaseKey`
+
+The `DecreseKey` operation *decreases* the key value of a particular
+element in a correct heap.
+
+**Procedure**:
+
+- Decrease the value of the key at index $i$ to new value $b$
+- Call `heapify` at $i$ to let it bubble down
+
+**Running time**: $\O(\log n)$
+
+### `IncreaseKey`
+
+The `IncreseKey` operation *increases* the key value of a particular
+element in a correct heap.
+
+**Procedure**:
+
+- Increase the value of the key at index $i$ to new value $b$
+- Walk upwards to the root, exchaning the key values of a vertex and
+ its parent if the heap property is violated
+
+**Running time**: $\O(\log n)$
+
+::: visu
+`IncreaseKey` from 4 to 15:
+
+```{=tex}
+\vspace{.5cm}
+\begin{minipage}{0.33\textwidth}\begin{center}\textbf{1.}\\\begin{forest}
+ [16,circle,draw
+ [14,circle,draw
+ [8,circle,draw
+ [2,circle,draw]
+ [4,circle,draw,red!60!black]]
+ [7,circle,draw
+ [1,circle,draw]]]
+ [10,circle,draw
+ [9,circle,draw]
+ [3,circle,draw]]]
+\end{forest}\end{center}\end{minipage}%
+\begin{minipage}{0.33\textwidth}\begin{center}\textbf{2.}\\\begin{forest}
+ [16,circle,draw
+ [14,circle,draw
+ [8,circle,draw
+ [2,circle,draw]
+ [15,circle,draw,red!60!black]]
+ [7,circle,draw
+ [1,circle,draw]]]
+ [10,circle,draw
+ [9,circle,draw]
+ [3,circle,draw]]]
+\end{forest}\end{center}\end{minipage}%
+\begin{minipage}{0.33\textwidth}\begin{center}\textbf{3.}\\\begin{forest}
+ [16,circle,draw
+ [14,circle,draw
+ [8,circle,draw
+ [2,circle,draw]
+ [15,circle,draw,red!60!black] {\draw[<->] () .. controls +(north east:0.6cm) and +(east:1cm) .. (!u);}]
+ [7,circle,draw
+ [1,circle,draw]]]
+ [10,circle,draw
+ [9,circle,draw]
+ [3,circle,draw]]]
+\end{forest}\end{center}\end{minipage}\bigskip\\
+\begin{minipage}{0.5\textwidth}\begin{center}\textbf{4.}\\\begin{forest}
+ [16,circle,draw
+ [14,circle,draw
+ [15,circle,draw,red!60!black
+ [2,circle,draw]
+ [8,circle,draw]] {\draw[<->] () .. controls +(north west:0.6cm) and +(west:1cm) .. (!u);}
+ [7,circle,draw
+ [1,circle,draw]]]
+ [10,circle,draw
+ [9,circle,draw]
+ [3,circle,draw]]]
+\end{forest}\end{center}\end{minipage}%
+\begin{minipage}{0.5\textwidth}\begin{center}\textbf{5.}\\\begin{forest}
+ [16,circle,draw
+ [15,circle,draw,red!60!black
+ [14,circle,draw
+ [2,circle,draw]
+ [8,circle,draw]]
+ [7,circle,draw
+ [1,circle,draw]]]
+ [10,circle,draw
+ [9,circle,draw]
+ [3,circle,draw]]]
+\end{forest}\end{center}\end{minipage}%
+```
+:::
+
+### `ExtractMax`
+
+The `ExtractMax` operation *removes* the largest element in a correct
+heap.
+
+**Procedure**:
+
+- Extract the root element (the largest element)
+- Replace the root element by the last leaf in the tree and remove
+ that leaf
+- Call `heapify(root)`
+
+**Running time**: $\O(\log n)$
+
+### `InsertElement`
+
+The `InsertElement` operation *inserts* a new element in a correct heap.
+
+**Procedure**:
+
+- Insert it at the next free position as a leaf, asiign it the key
+ $-\infty$
+- Call `IncreaseKey` to set the key to the given value
+
+**Running time**: $\O(\log n)$
+
+### `BuildMaxHeap`
+
+The `BuildMaxHeap` operation makes a heap out of an unsorted array A of
+$n$ elements.
+
+**Procedure**:
+
+- Write all elements in the tree in any order
+- Then, starting from the leafs, call `heapify` on each vertex
+
+**Running time**: $\O(n)$
+
+# Priority queue
+
+Maintains a set of prioritized elements. The `Dequeue` operation returns
+the element with the largest priority value. `Enqueue` and `IncreaseKey`
+work as normal.
+
+## Implementation
+
+Typically using a heap:
+
+- Building the heap is $\O(n)$
+- Enqueue: heap `InsertElement`, $\O(\log n)$
+- Dequeue: heap `ExtractMax`, $\O(\log n)$
+- `IncreaseKey`, `DecreaseKey`: $\O(\log n)$
+
+"Fibonacci heaps" can achieve `DecreaseKey` in $\O(1)$.
+
+# Hashing
+
+**Idea**:
+
+- Store data that is assigned to particular key values
+- Give a "nickname" to each of the key values
+- Choose the space of nicknames reasonably small
+- Have a way to compute "nicknames" from the keys themselves
+- Store the information in an array (size = #nicknames)
+
+**Formally**:
+
+- **Universe $U$**: All possible keys, actually used key values are
+ much less ($m < |U|$)
+- **Hash function**: $h: U\to\{1,...,m\}$
+- **Hash values**: $h(k)$ (slot)
+- **Collision**: $h(k_1)=h(k_2),\ k_1\ne k_2$
+
+## Simple hash function
+
+If we want to hash $m$ elements in universe $\N$: $$h(k)=k\pmod{m}$$
+
+For $n$ slots generally choose $m$ using a prime number $m_p>n$
+
+## Hashing with chaining
+
+Method to cope with collisions:
+
+Each hash table entry points to a linked list containing all elements
+with this particular hash key - collisions make the list longer.
+
+We might need to traverse this list to retrieve a particular element.
+
+## Hashing with open addressing
+
+(**Linear probing**)
+
+All empty slots get marked as empty
+
+**Inserting a new key into $h(k)$:**
+
+- If unused, insert at $h(k)$
+- If used, try insert at $h(k)+1$
+
+**Retrieving elements**: Walk from $h(k)$
+
+- If we find the key: Yay
+- If we hit the empty marker: Nay
+
+**Removing elements:**
+
+- Another special symbol marker..
+- Or move entries up that would be affected by the "hole" in the array
+
+# Graph algorithms
+
+## Graphs
+
+A graph $G=(V,E)$ consists of a set of vertices $V$ and a set of edges
+$E\subset V\times V$.
+
+- edges can be **directed** $(u,v)$ or **undirected** $\{u,v\}$
+- $u$ is **adjacent** to $v$ if there exists an edge between $u$ and
+ $v$: $u\sim v$ or $u\to v$
+- edges can be **weighted**: $w(u,v)$
+- undirected **degree of a vertex**:
+ $$d_v:=d(v):=\sum_{v\sim u}w_{vu}$$
+- directed **in-/out-degree of a vertex**:
+ $$d_in=\sum_{\{u: u\to v\}}w(u,v)$$
+ $$d_out=\sum_{\{u: v\to u\}}w(v,y)$$
+- number of vertices: $n=|V|$
+- number of edges: $m=|E|$
+- **simple** path if each vertex occurs at most once
+- **cycle** path if it end in the vertex where it started from and
+ uses each edge at most once
+- **strongly connected** directed graph if for all $u,v\in V,\ u\ne v$
+ exists a directed path from $u$ to $v$ and a directed path from $v$
+ to $u$
+- **acyclic** graph if it does not contain any cycles (**DAG** if
+ directed)
+- **bipartite** graph if its vertex set can be decomposed into two
+ disjoint subsets such that all edges are only between them
+
+### Representation
+
+- Unordered edge list: For each edge, encode start and end point
+- Adjacency matrix:
+ - $n\times n$ matrix that contains entries $a_{ij}=1$ if there is
+ a directed edge from vertex $i$ to vertex $j$
+ - if weighted, $a_{ij}=w{ij}$
+ - **implementation** using $n$ arrays of length $n$
+ - adjacency test in $\O(1)$
+ - space usage $n^2$
+- Adjacency list:
+ - for each vertex, store a list of all outgoing edges
+ - if the edges are weighted, store the weight additionally in the
+ list
+ - sometimes store both incoming and outgoing edges
+ - **implementation** using an array with list pointers or using a
+ list for each vertex that encodes outgoing edges
+
+**Typical choice**:
+
+- *dense* graphs: adjacency matrices tend to be easier.
+- *sparse* graphs: adjacency lists
+
+## Depth first search
+
+**Idea**: Starting at a arbitrary vertex, jump to one of its neighbors,
+then one of his neighbors etc., never visiting a vertex twice. At the
+end of the chain we backtrack and walk along another chain.
+
+**Running time**
+
+- graph: $\O(|V|+|E|)$
+- adjacency matrix: $\O(|V|^2)$
+
+**Algorithm**:
+
+```{=tex}
+\begin{lstlisting}
+function DFS(G)
+ for all $u\in V$
+ u.color = white # not visited yet
+ for all $u\in V$
+ if u.color == white
+ DFS-Visit(G, u)
+
+function DFS-Visit(G, u)
+ u.color = grey # in process
+ for all $v\in\mathrm{Adj}(u)$
+ if v.color == white
+ v.pre = u # just for analysis
+ DFS-Visit(G, v)
+ u.color = black # done!
+\end{lstlisting}
+```
+## Strongly connected components
+
+**Component graph $G^{SCC}$** of a directed graph:
+
+- vertices of $G^{SCC}$ correspond to the components of $G$
+- edge between vertices $A$ and $B$ in $G^{GCC}$ if vertices $u$ and
+ $v$ in connected components represented by $A$ and $B$ such that
+ there is an edge from $u$ to $v$
+- $G^{SCC}$ is a DAG for any directed graph $G$
+- **sink** component if the vertex in $G^{SCC}$ does not have an
+ out-edge
+- **source** component if the vertex in $G^{SCC}$ does not have an
+ in-edge
+
+## DFS in sink components
+
+With sink component $B$:
+
+- `DFS` on $G$ in vertex $u\in B$: `DFS-Visit` tree covers the whole
+ component $B$
+- `DFS` on $G$ in vertex $u$ non-sink: `DFS-Visit` tree covers more
+ than this component
+
+$\implies$ use DFS to discover SCCs
+
+## Finding sources
+
+- **discovery time $d(u)$**: time when DFS first visits $u$
+- **finishing time $f(u)$**: time when DFS is done with $u$
+
+Also: $d(A)=\min_{u\in A}d(u)$ and $f(A)=\max_{u\in A}f(u)$.
+
+Let $A$ and $B$ be two SCCs of $G$ and assume that $B$ is a descendent
+of $A$ in $G^{SCC}$. Then $f(B)<f(A)$ always.
+
+Assume we run DFS on $G$ (with any starting vertex) and record the
+finishing times of all vertices. Then the vertex with the largest
+finishing time is in a source component.
+
+## Converting sources to sinks
+
+Reversing the graph: we consider the graph $G^t$ which has the same
+vertices as $G$ but all edges with reversed directions. Note that $G^t$
+has the same SCCs as $G$.
+
+We can then use the source-finding algorithm to find sinks by first
+reversing the graph.
+
+## Finding SCCs
+
+- run DFS on $G$ with any arbitrary starting vertex. The vertex $u^*$
+ with the largest $f(u)$ is in a source of $G^{SCC}$
+- the vertex $u^*$ is in a sink of $(G^t)^{SCC}$
+- start a second DFS on $u*$ in $G^t$. The tree discovered by
+ $\mathrm{DFS}(G^t,u^*)$ is the first SCC
+- continue with DFS on the remaining vertices $V=v*$ with the highest
+ $f(u)$
+- etc.
+
+**Running time**:
+
+- DFS twice: $\O(|V|+|E|)$
+- reverse: $\O(|E|)$
+- order the vertices by $f(u)$: $\O(|V|)$
+- $\implies \O(|V|+|E|)$
+
+## Cycle detection
+
+A directed graph has a cycle iff its DFS reveals a back edge (to a
+previously visited vertex).
+
+## Topological sort
+
+A **topological sort** of a directed graph is a linear ordering of its
+vertices such that whenever there exists a directed edge from vertex $u$
+to vertex $v$, $u$ comes before $v$ in the ordering.
+
+Every DAG has a topological sort.
+
+**Procedure**:
+
+- run DFS with an arbitrary starting vertex
+- if the DFS reveals a back edge, topological sort doesn't exist
+- otherwise, sort the vertices by decreasing finishing times
+
+## Breadth first search
+
+DFS has inefficiency problems with some specific graph structures.
+
+BFS explores the local neighborhood first.
+
+DFS uses a stack, BFS uses a queue.
+
+**Algorithm**:
+
+```{=tex}
+\begin{lstlisting}
+function BFS(G)
+ for all $u\in V$
+ u.color = white # not visited yet
+ for all $s\in V$
+ if s.color == white
+ BFS-Visit(G, s)
+
+function BFS-Visit(G, s)
+ u.color = grey # in process
+ Q = [s] # queue containing s
+ while Q $\ne\emptyset$
+ u = dequeue(Q)
+ for all $v\in\mathrm{Adj}(u)$
+ if v.color == white
+ v.color = grey
+ enqueue(Q, v)
+ u.color = black
+\end{lstlisting}
+```
+**Running time**:
+
+- $\O(|E|+|V|)$ in adjacency list
+- $\O(|V|^2)$ in adjacency matrix
+
+## Shortest path problem (unweighted)
+
+$$d(u,v)=\min\{l(\pi)\mid\pi\text{ path between $u$ and $v$}\}$$
+
+Simple **algorithm** using BFS:
+
+```{=tex}
+\begin{lstlisting}
+function BFS(G)
+ for all $u\in V\setminus\{s\}$
+ u.color = white # not visited yet
+ (*@\hl{u.dist = $\infty$}@*)
+ (*@\hl{s.dist = 0}@*)
+ s.color = grey # in process
+ Q = [s] # queue containing s
+ while Q $\ne\emptyset$
+ u = dequeue(Q)
+ for all $v\in\mathrm{Adj}(u)$
+ if v.color == white
+ v.color = grey
+ (*@\hl{v.dist = u.dist + 1}@*)
+ enqueue(Q, v)
+ u.color = black
+\end{lstlisting}
+```
+Other **algorithm** using BFS, easily provable:
+
+```{=tex}
+\begin{lstlisting}
+function BFS(s)
+ d = [$\infty$, ...,$\infty$]
+ parent = [$bot$, ..., $bot$]
+ d[s] = s
+ Q = {s}
+ Q' = {s}
+ for l = 0 to $\infty$ while $Q\ne\emptyset$ do
+ for each $u\in Q$ do
+ for each $(u,v)\in E$ do
+ if parent(v) = $\bot$ then
+ Q' = Q' $\cup\{v\}$
+ d[v] = l + 1
+ parent[v] = u
+ (Q,Q') = (Q',$\emptyset$)
+ return (d, parent)
+\end{lstlisting}
+```
+## Testing whether a graph is bipartite
+
+**Algorithm**:
+
+- assume the graph is connected or run on each component
+- start BFS with arbitrary vertex, color start red
+- neighbors of a red vertex become blue
+- neighbors of a blue vertex become red
+- bipartite iff there's no color conflict
+
+## Shortest path problems
+
+- **Single Source Shortest Paths**: Shortest path distance of one
+ particular vertex $s$ to all other vertices
+- **All Pairs Shortest Paths**: Shortest path distance between all
+ pairs of points
+- **Point to Point Shortest Paths**: Shortest path distance between a
+ particular start vertex $s$ and a particular target vertex $t$
+
+### Storing paths efficiently
+
+Keep track of the predecessors in the shortest paths with the help of a
+**predecessor matrix** $\Pi=(\pi_{ij})_{i,j=1,...,n}$:
+
+- If $i=j$ or there is no path from $i$ to $j$, set
+ $\pi_{ij}=\mathrm{NIL}$
+- Else set $\pi_{ij}$ as the predecessor of $j$ on a shortest path
+ from $i$ to $j$
+
+**Space requirement**:
+
+- SSSP: $\O(|V|)$
+- APSP: $\O(|V|^2)$
+
+## Relaxation
+
+- for each vertex, keep an attribute $v.dist$ that is the current
+ estimate of the shortest path distance to the source vertex s
+- initially set to $\infty$ for all vertices except start
+- step: figure out whether there is a shorter path from $s$ to $v$ by
+ using an edge $(u,v)$ and thus extending the shortest path of $s$ to
+ $u$
+
+**Formally**:
+
+```{=tex}
+\begin{lstlisting}
+function Relax(u,v)
+ if v.dist > u.dist + w(u, v)
+ v.dist = u.dist + w(u,v)
+ v.$\pi$ = u
+\end{lstlisting}
+```
+**Also useful**:
+
+```{=tex}
+\begin{lstlisting}
+function InitializeSingleSource(G,s)
+ for all $v\in V$
+ v.dist = $\infty$ # current distance estimate
+ v.$\pi$ = NIL
+ s.dist = 0
+\end{lstlisting}
+```
+## Bellman-Ford algorithm
+
+SSSP algorithm for general weighted graphs (including negative edges).
+
+```{=tex}
+\begin{lstlisting}
+function BellmanFord(G,s)
+ InitializeSingleSource(G,s)
+ for i = 1, ..., |V| - 1
+ for all edges $(u,v)\in E$
+ Relax(u,v)
+ for all edges $(u,v)\in E$
+ if v.dist > u.dist + w(u,v)
+ return false # cycle detected
+ return true
+\end{lstlisting}
+```
+**Running time**: $\O(|V|\cdot|E|)$
+
+::: bem
+Originally designed for directed graphs. Edges need to be relaxed in
+both directions in an undirected graph. Negative weights in an
+undirected graph result in an undefined shortest path.
+:::
+
+## Decentralized Bellman-Ford
+
+**Idea**: "push-based" version of the algorithm: Whenever a value
+`v.dist` changes, the vertex `v` communicates this to its neighbors.
+
+**Synchronous algorithm**:
+
+```{=tex}
+\begin{lstlisting}
+function SynchronousBellmanFord(G,w,s)
+ InitializeSingleSource(G,s)
+ for i = 1, ..., |V| - 1
+ for all $u\in V$
+ if u.dist has been updated in previous iteration
+ for all edges $(u,v)\in E$
+ v.dist = min{v.dist, u.dist + w(u, v)}
+ if no v.dist changed
+ terminate algorithm
+\end{lstlisting}
+```
+**Asynchronous algorithm** for static graphs with non-negative weights:
+
+```{=tex}
+\begin{lstlisting}
+function AsynchronousBellmanFord(G,w,s)
+ InitializeSingleSource(G,s)
+ set $s$ as active, other nodes as inactive
+ while an active node exists:
+ u = active node
+ for all edges $(u,v)\in E$
+ v.dist = min{v.dist, u.dist + w(u, v)}
+ if last operation changed v.dist
+ set v active
+ set u inactive
+\end{lstlisting}
+```
+## Dijkstra's algorithm
+
+Works on any weighted, (un)directed graph in which all edge weights
+$w(u,v)$ are non-negative.
+
+**Greedy** algorithm: At each point in time it does the "locally best"
+action resulting in the "globally optimal" solution.
+
+### Naive algorithm
+
+**Idea**:
+
+- maintain a set $S$ of vertices for which we already know the
+ shortest path distances from $s$
+- look at neighbors $u$ of $S$ and assign a guess for the shortest
+ path by using a path through $S$ and adding one edge
+
+```{=tex}
+\begin{lstlisting}
+function Dijkstra(G,s)
+ InitializeSingleSource(G,s)
+ S = {s}
+ while S $\ne$ V
+ U = {u $\notin$ S $\mid$ u neighbor of vertex $\in$ S}
+ for all u $\in$ U
+ for all pre(u) $\in$ S that are predecessors of u
+ d'(u, pre(u)) = pre(u).dist + w(pre(u), u)
+ d* = min{d'(u,pre(u)) $\mid$ u $\in$ U, pre(U) $\in$ S}
+ u* = argmin{d'(u,pre(u)) $\mid$ u $\in$ U, pre(U) $\in$ S}
+ u*.dist = d*
+ S = S $\cup$ {u*}
+\end{lstlisting}
+```
+**Running time**: $\O(|V|\cdot|E|)$
+
+### Using min-priority queues
+
+**Algorithm**:
+
+```{=tex}
+\begin{lstlisting}
+function Dijkstra(G,w,s)
+ InitializeSingleSource(G,s)
+ Q = (V, V.dist)
+ while Q $\ne\emptyset$
+ u = Extract(Q)
+ for all v adjacent to u
+ Relax(u,v) and update keys in Q
+\end{lstlisting}
+```
+It follows that $Q=V\setminus S$.
+
+**Running time**: $\O((|V|+|E|)\log|V|)$
+
+## All pairs shortest paths
+
+**Naive approach**:
+
+- run Bellman-Ford or Dijkstra with all possible start vertices
+- running time of $\approx\O(|V|^2\cdot|E|)$
+- doesn't reuse already calculated results
+
+**Better**: Floyd-Warshall
+
+## Floyd-Warshall algorithm
+
+**Idea**:
+
+- assume all vertices are numbered from $1$ to $n$.
+- fix two vertices $s$ and $t$
+- consider all paths from $s$ to $t$ that only use vertices $1,...,k$
+ as intermediate vertices. Let $\pi_k(s,t)$ be a shortest path *from
+ this set* and denotee its length by $d_k(s,t)$
+- recursive relation between $\pi_k$ and $\pi_{k-1}$ to construct the
+ solution bottom-up
+
+**Algorithm**:
+
+```{=tex}
+\begin{lstlisting}
+function FloydWarshall(W)
+ n = number of vertices
+ $D^{(0)}$ = W
+ for k = 1,...,n
+ let $D^{(k)}$ be a new n $\times$ n matrix
+ for s = 1,...,n
+ for t = 1,...,n
+ $d_k$(s,t) = min{$d_{k-1}$(s,t), $d_{k-1}$(s,k) + $d_{k-1}$(k,t)}
+ return $D^{(n)}$
+\end{lstlisting}
+```
+**Running time**: $\O(|V|^3)\implies$ not that much better than naive
+approach but easier to implement
+
+::: bem
+Negative-weight cycles can be detected by looking at the values of the
+diagonal of the distance matrix. If it contains negative entries, the
+graph contains a negative cycle.
+:::
+
+## Point to Point Shortest Paths
+
+Given a graph $G$ and two vertices $s$ and $t$ we want to compute the
+shortest path between $s$ and $t$ only.
+
+**Idea**:
+
+- run `Dijkstra(G,s)` and stop the algorithm when we reached $t$
+- has the same worst case running time as Dijkstra
+ - often faster in practice
+
+## Bidirectional Dijkstra
+
+**Idea**:
+
+- instead of starting Dijkstra at $s$ and waitung until we hit $t$, we
+ start copies of the Dijkstra algorithm from $s$ as well as $t$
+- alternate between the two algorithms, stop when they meet
+
+**Algorithm**:
+
+- $\mu=\infty$ (best path length currently known)
+- alternately run steps of `Dijkstra(G,s)` and `Dijkstra(G',t)`
+ - when an edge $(v,w)$ is scanned by the forward search and $w$
+ has already been visited by the backward search:
+ - found a path between $s$ and $t$: $s...v\ w...t$
+ - length of path is $l=d(s,v)+w(v,w)+d(w,t)$
+ - if $\mu>l$, set $\mu=l$
+ - analogously for the backward search
+- terminate when the search in one direction selects a vertex $v$ that
+ has already been selected in other direction
+- return $\mu$
+
+::: bem
+It is not always true that if the algorithm stops at $v$, that then the
+shortest path between $s$ and $t$ has to go through $v$.
+:::
+
+## Generic labeling method
+
+A convenient generalization of Dijkstra and Bellman-Ford:
+
+- for each vertex, maintain a status variable
+ $S(v)\in\{\text{unreached}, \text{labelchanged}, \text{settled}\}$
+- repeatedly relax edges
+- repeat until nothing changes
+
+```{=tex}
+\begin{lstlisting}
+function GenericLabelingMethod(G,s)
+ for all v $\in$ V
+ v.dist = $\infty$
+ v.parent = NIL
+ v.status = unreached
+ s.dist = 0
+ s.status = labelchanged
+ while a vertex exists with status labelchanged
+ pick such vertex v
+ for all neighbors u of v
+ Relax(v,u)
+ if relaxation changed value u.dist
+ u.status = labelchanged
+ v.status = settled
+\end{lstlisting}
+```
+## A\* search
+
+**Idea**:
+
+- assume that we know a lower bound $\pi(v)$ on the distance $d(v,t)$
+ for all vertices $v$: $$\forall v: \pi(v)\le d(v,t)$$
+- run the *Generic Labeling Method* with start in $s$
+- while Dijkstra selects by $d(s,u)+w(u,v)$, A\* selects by
+ $d(s,u)+w(u,v)+\pi(v)$
+
+**Algorithm**:
+
+```{=tex}
+\begin{lstlisting}
+function AstarSearch(G,s,t)
+ for all v $\in$ V
+ v.dist = $\infty$
+ v.status = unreached
+ s.dist = 0
+ s.status = labelchanged
+ while a vertex exists with status labelchanged
+ select u = argmin(u.dist + $\pi$(u))
+ if u == t
+ terminate, found correct distance
+ for all neighbors v of u
+ Relax(u,v)
+ if relaxation changed value v.dist
+ v.status = labelchanged
+ u.status = settled
+\end{lstlisting}
+```
+**Running time**: If the lower bounds are feasible, A\*-search has the
+same running time as Dijkstra. Can often work fast but in rare cases
+very slow.
+
+## Union-find data structure
+
+TODO.
+
+## Operation O1
+
+TODO.
+
+## Minimal spanning trees
+
+**Idea**:
+
+Given an undirected graph $G=(V,E)$ with real-valued edge values
+$(w_e)_{e\in E}$ find a tree $T=(V',A)$ with $V=V',A\subset E$ that
+minimizes $$\mathrm{weight}(T)=\sum_{e\in A}w_e.$$ Minimal spanning
+trees are not unique and most graphs have many minimal spanning trees.
+
+### Safe edges
+
+Given a subset $A$ of the edges of an MST, a new edge
+$e\in E\setminus A$ is called **safe** with respect to $A$ if there
+exists a MST with edge set $A\cup\{e\}$.
+
+- start with MST $T=(V,E')$
+- take some of its edges $A\subset E'$
+- new edge $e$ is *safe* if $A\cup\{e\}$ can be completed to an MST
+ $T'$
+
+### Cut property to find safe edges
+
+A cut $(S,V\setminus S)$ is a partition of the vertex set of a graph in
+two disjoint subsets.
+
+TODO.
+
+### Kruskal's algorithm
+
+**Idea**:
+
+- start with an empty tree
+- repeatedly add the lightest remaining edge that does not produce a
+ cycle
+- stop when the resulting tree connects the whole graph
+
+**Naive algorithm** using cut property:
+
+```{=tex}
+\begin{lstlisting}
+function KruskalNaiveMST(V,E,W)
+ sort all edges according to their weight
+ A = {}
+ for all e $\in$ E, in increasing order of weight
+ if A $\cup$ {e} does not contain a cycle
+ A = A $\cup$ {e}
+ if |A| = n - 1
+ return A
+\end{lstlisting}
+```
+**Running time**:
+
+- sorting $\O(|E|\log|E|)$
+- check for cycle: $\O(|E|\cdot?)$
+- total: $\O(|E|\log|E|+|E|\cdot?)$
diff --git a/notes/algo/main.pdf b/notes/algo/main.pdf
new file mode 100644
index 0000000..857e3e3
--- /dev/null
+++ b/notes/algo/main.pdf
Binary files differ
diff --git a/notes/algo/makefile b/notes/algo/makefile
new file mode 100644
index 0000000..58570c7
--- /dev/null
+++ b/notes/algo/makefile
@@ -0,0 +1,23 @@
+VIEW = zathura
+
+all:
+ @mkdir -p build/
+ @pandoc main.md --filter pandoc-latex-environment --toc -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o $(CURDIR)/build/main.tex --pdf-engine-opt=-shell-escape -H header.tex -B title.tex >/dev/null
+ @(pdflatex -shell-escape -halt-on-error -output-directory $(CURDIR)/build/ $(CURDIR)/build/main.tex | grep '^!.*' -A200 --color=always ||true) &
+ @progress 3 pdflatex
+ @cp build/main.pdf . &>/dev/null
+ @echo done.
+
+part:
+ @mkdir -p build/
+ @pandoc part.md --filter pandoc-latex-environment -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o $(CURDIR)/build/main.tex --pdf-engine-opt=-shell-escape -H header.tex >/dev/null
+ @(pdflatex -shell-escape -halt-on-error -output-directory $(CURDIR)/build/ $(CURDIR)/build/main.tex | grep '^!.*' -A200 --color=always ||true) &
+ @progress 1 pdflatex
+ @echo done.
+
+clean:
+ @$(RM) -rf build
+
+run: all
+ @clear
+ @$(VIEW) build/main.pdf
diff --git a/notes/algo/title.tex b/notes/algo/title.tex
new file mode 100644
index 0000000..1b73738
--- /dev/null
+++ b/notes/algo/title.tex
@@ -0,0 +1,23 @@
+\begin{titlepage}
+ \begin{center}
+ \vspace*{1cm}
+
+ {\huge\textbf{Theoretische Informatik 1\bigskip\\Algorithmen und Datenstrukturen}}
+
+ \vspace{0.5cm}
+ {\Large Inofficial lecture notes}\\
+ \textbf{Marvin Borner}
+
+ % \vfill
+ % \includegraphics[width=0.4\textwidth]{zeller_logo}\\
+ \vfill
+
+ Vorlesung gehalten von\\
+ \textbf{Ulrike von Luxburg}
+
+ \vspace{0.8cm}
+
+ \includegraphics[width=0.4\textwidth]{uni_logo}\\
+ Wintersemester 2022/23
+ \end{center}
+\end{titlepage}
diff --git a/notes/mathe1/main.md b/notes/mathe1/main.md
new file mode 100644
index 0000000..343dbb5
--- /dev/null
+++ b/notes/mathe1/main.md
@@ -0,0 +1,1815 @@
+---
+title: \vspace{-2.0cm}Mathematik für Informatik 1
+date: \today
+toc-title: Inhalt
+author: Marvin Borner
+header-includes:
+ - \usepackage{csquotes}
+ - \usepackage{svg}
+ - \usepackage{environ}
+ - \usepackage{tikz,pgfplots}
+ - \usepackage{titleps}
+ - \usetikzlibrary{calc,trees,positioning,arrows,fit,shapes}
+ - \newpagestyle{main}{\sethead{\toptitlemarks\thesection\quad\sectiontitle}{}{\thepage}\setheadrule{.4pt}}
+ - \pagestyle{main}
+ - \newcommand\N{\mathbb{N}}
+ - \newcommand\R{\mathbb{R}}
+ - \newcommand\Z{\mathbb{Z}}
+ - \newcommand\Q{\mathbb{Q}}
+ - \newcommand\C{\mathbb{C}}
+ - \renewcommand\P{\mathbb{P}}
+ - \newcommand{\cupdot}{\mathbin{\mathaccent\cdot\cup}}
+ - \newcommand{\bigcupdot}{\dot{\bigcup}}
+---
+
+# Logik
+
+---
+
+- Aussagen werden einem Wahrheitswert zugeordnet: **w** für _wahr_ und **f** für _falsch_
+- Eine Aussage, der der Wahrheitswert **w** schlicht durch Festlegung zugewiesen wurde, heißt **Axiom**
+
+---
+
+## Negation
+
+- Notation: $\neg X$
+- Gesprochen: \enquote{nicht X}
+
+| $X$ | $\neg X$ |
+| :---: | :------: |
+| **w** | **f** |
+| **f** | **w** |
+
+- $\neg (\forall x : P) \iff \exists x : (\neg P)$
+- $\neg (\exists x : P) \iff \forall x : (\neg P)$
+
+## Konjunktion
+
+- Notation: $X \land Y$
+- Gesprochen: \enquote{X und Y}
+
+| $X$ | $Y$ | $X \land Y$ |
+| :---: | :---: | :---------: |
+| **w** | **w** | **w** |
+| **w** | **f** | **f** |
+| **f** | **w** | **f** |
+| **f** | **f** | **f** |
+
+## Disjunktion
+
+- Notation: $X \lor Y$
+- Gesprochen: \enquote{X oder Y}
+
+| $X$ | $Y$ | $X \lor Y$ |
+| :---: | :---: | :--------: |
+| **w** | **w** | **w** |
+| **w** | **f** | **w** |
+| **f** | **w** | **w** |
+| **f** | **f** | **f** |
+
+## Nand
+
+- Notation: $X \uparrow Y$
+- Gesprochen: \enquote{nicht (X und Y)}
+
+| $X$ | $Y$ | $X \uparrow Y$ |
+| :---: | :---: | :------------: |
+| **w** | **w** | **f** |
+| **w** | **f** | **w** |
+| **f** | **w** | **w** |
+| **f** | **f** | **w** |
+
+## Äquivalenz
+
+- Notation: $X \iff Y$
+- Gesprochen: \enquote{X genau dann wenn Y}
+
+| $X$ | $Y$ | $X \iff Y$ |
+| :---: | :---: | :--------: |
+| **w** | **w** | **w** |
+| **w** | **f** | **f** |
+| **f** | **w** | **f** |
+| **f** | **f** | **w** |
+
+- Alternative: $(X \implies Y) \land (Y \implies X)$
+
+## Implikation
+
+- Notation: $X \implies Y$
+- Gesprochen: \enquote{Aus X folgt Y}
+
+| $X$ | $Y$ | $X \implies Y$ |
+| :---: | :---: | :------------: |
+| **w** | **w** | **w** |
+| **w** | **f** | **f** |
+| **f** | **w** | **w** |
+| **f** | **f** | **w** |
+
+- Alternative: $(\neg X) \lor Y$
+- Der Wahrheitswert der Implikation $X \implies Y$ bewertet nur die Korrektheit des Schließens, nicht jedoch die Wahrheit der Aussagen $X$ und $Y$
+
+## Kontraposition
+
+- Definition: $X \implies Y \iff \neg Y \implies \neg X$
+
+| $X$ | $Y$ | $\neg Y$ | $\neg Y$ | $X \implies Y$ | $\neg Y \implies \neg x$ |
+| :---: | :---: | :------: | :------: | :------------: | :----------------------: |
+| **w** | **w** | **f** | **f** | **w** | **w** |
+| **w** | **f** | **f** | **w** | **f** | **f** |
+| **f** | **w** | **w** | **f** | **w** | **w** |
+| **f** | **f** | **w** | **w** | **w** | **w** |
+
+## Quantoren
+
+- $\forall$: \enquote{für alle}
+- $\exists$: \enquote{es existiert ein}
+- $\exists!$: \enquote{es existiert genau ein}
+- $\nexists$: \enquote{es existiert kein}
+
+## Gesetze
+
+- Assoziativgesetze
+ - $(X \lor Y) \lor Z \iff X \lor (X \lor Z)$
+ - $(X \land Y) \land Z \iff X \land (X \land Z)$
+- Kommutativgesetze
+ - $X \lor Y \iff Y \lor X$
+ - $X \land Y \iff Y \land X$
+- Distributivgesetze
+ - $X \land (Y \lor Z) \iff (X \land Y) \lor (X \land Z)$
+ - $X \lor (Y \land Z) \iff (X \lor Y) \land (X \lor Z)$
+- De Morgansche Regeln
+ - $\neg (X \lor Y) \iff \neg X \land \neg Y$
+ - $\neg (X \land Y) \iff \neg X \lor \neg Y$
+
+# Mengen
+
+---
+
+Eine _Menge_ ist eine Zusammenfassung von bestimmten, wohlunterschiedenen Objekten unserer Anschauung oder unseres Denkens zu einem Ganzen. Die in einer Menge zusammengefassten Objekte heißen _Elemente_ der Menge.
+
+---
+
+## Notation
+
+- Mengen angeben durch Auflisten der Elemente: $\{ 1,2,5,3,4,0 \}$
+- Mengen angeben durch Vorschreiben einer Eigenschaft: $\{ x\ \vert\ x \text{ ist eine natürliche Zahl kleiner als } 6 \}$
+- $x \in M$ heißt \enquote{x ist Element von M}
+- $x \notin M$ heißt \enquote{x ist nicht Element von M}
+- $\{ \}$ und $\emptyset$ bezeichnen die _leere Menge_
+
+## Inklusionsrelationen
+
+- $M \subset N \iff (x \in M \implies x \in N)$
+- $M = N \iff (M \subset N \land N \subset M)$
+- $M \neq N \iff \neg (M = N) \iff ((\exists x \in M : x \notin N) \lor (\exists x \in N : x \notin M))$
+
+## Zahlenbereiche
+
+$$ \P \subsetneq \N \subsetneq \Z \subsetneq \Q \subsetneq \R \subsetneq \C $$
+
+- **Natürliche Zahlen**: $\N = \{ 0,1,2,3,4,5,... \}$
+- **Positive natürliche Zahlen**: $\N_{>0} = \{ 1,2,3,4,5,... \}$
+- **Ganze Zahlen**: $\Z = \{ ...,-3,-2,-1,0,1,2,3,... \}$
+- **Rationale Zahlen**: $\Q = \{ \frac{p}{q}\ \vert\ p,q \in Z, q \neq 0 \}$
+- **Komplexe Zahlen**: $\C = 42$ TODO
+- **Primzahlen**: Menge der natürlichen Zahlen $p$, die genau zwei positive Teiler, nämlich $1$ und $p$, haben
+
+## Operationen von Mengen
+
+- $M \cap N = \{ x \mid x \in M \land x \in N \}$ heißt der _Durchschnitt_ von $M$ und $N$
+- $M \cup N = \{ x \mid x \in M \lor x \in N \}$ heißt die _Vereinigung_ von $M$ und $N$
+- $M \setminus N = \{ x \mid x \in M \land x \notin N \}$ heißt die _Differenzmenge_ von $M$ und $N$
+- $M \times N = \{ (x, y) \mid x \in M \land y \in N \}$ heißt das _kartesische Produkt_ von $M$ und $N$. Dabei ist $(x, y)$ ein _geordnetes Paar_, und für zwei geordnete Paare $(x, y), (u, v) \in M \times N$ gilt: $$(x, y) = (u, v) \iff (x = u \land y = v)$$
+- $M$ und $N$ heißen genau dann _disjunkt_, wenn $M \cap N = \emptyset$, d.h. wenn sie kein Element gemeinsam besitzen
+- $P = M \cupdot N \iff (P = M \cup N \land M \cap N = \emptyset)$ beschreibt die _disjunkte Vereinigung_
+- $\bigcap_{i \in I} M_i = \{ x \mid \forall i \in I : x \in M_i \}$ heißt der _Durchschnitt_ der $M_i$
+- $\bigcup_{i \in I} M_i = \{ x \mid \exists i \in I : x \in M_i \}$ heißt die _Vereinigung_ der $M_i$
+- $P = \bigcupdot_{i \in I} M_i \iff (P = \bigcup_{i \in I} M_i \land M_i \cap M_j = \emptyset\ \forall i,j \in I$ mit $i \neq j)$
+
+Beispiel mit den Mengen $I = \{ 1, 2, 3 \}$, $M_1 = \{ a, 1, c \}$, $M_2 = \{ b, 1, e \}$ und $M_3 = \{ d, 1, f \}$:
+$$\bigcap_{i \in I} = \{ 1 \} \text { und } \bigcup_{i \in I} = \{ 1, a, b, c, d, e, f \}$$
+
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=gray!30}]
+\newcommand\intersection{0.8}
+
+% Set M
+\node[set,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Intersection
+\begin{scope}
+\clip (0,0) circle(1cm);
+\clip (\intersection,0) circle(1cm);
+\fill[orange!50](0,0) circle(1cm);
+\end{scope}
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \cap N$};
+
+\end{tikzpicture}
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=orange!50}]
+\newcommand\intersection{0.8}
+
+% Set M
+\node[set,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \cup N$};
+
+\end{tikzpicture}
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=gray!30}]
+\newcommand\intersection{0.8}
+
+% Set M
+\node[set,fill=orange!50,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Intersection
+\begin{scope}
+\clip (0,0) circle(1cm);
+\clip (\intersection,0) circle(1cm);
+\fill[gray!30](0,0) circle(1cm);
+\end{scope}
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \setminus N$};
+
+\end{tikzpicture}
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=orange!50}]
+\newcommand\intersection{2.1}
+
+% Set M
+\node[set,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \setminus N$};
+
+\end{tikzpicture}
+
+## Spezielle Mengen
+
+### Komplementärmenge
+
+Für eine Teilmenge $M$ einer Menge $N$ ist $\overline{M} = N \setminus M$.
+
+\begin{center}\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 4cm, fill=gray!30}]
+
+% Set N
+\node[set,fill=orange!50,label={45:$N$}] (N) at (0,0) {};
+
+% Set M
+\node[set,minimum size=2cm,label={135:$M$}] (M) at (0,0) {};
+
+% Circles outline
+\draw (0,0) circle(2cm);
+\draw (0,0) circle(1cm);
+
+% Set intersection label
+\node at (0,-2.5) {$\overline{M} = N \setminus N$};
+
+\end{tikzpicture}\end{center}
+
+### Potenzmenge
+
+Für eine Menge $M$ ist die Potenzmenge $\mathcal{P}(M) = \{ A\ \vert\ A \subset M \}$.
+
+\begin{center}\begin{tikzpicture}
+\node (max) at (0,4) {$\{ x,y,z \}$};
+\node (a) at (-2,2) {$\{ x,y \}$};
+\node (b) at (0,2) {$\{ x,z \}$};
+\node (c) at (2,2) {$\{ y,z \}$};
+\node (d) at (-2,0) {$\{ x \}$};
+\node (e) at (0,0) {$\{ y \}$};
+\node (f) at (2,0) {$\{ z \}$};
+\node (min) at (0,-2) {$\emptyset$};
+\draw (min) -- (d) -- (a) -- (max) -- (b) -- (f)
+(e) -- (min) -- (f) -- (c) -- (max)
+(d) -- (b);
+\draw[preaction={draw=white, -,line width=4pt}] (a) -- (e) -- (c);
+\end{tikzpicture}\end{center}
+
+Außerdem gilt mit der endlichen Menge $M$: $|\mathcal{P}(M)| = 2^{|M|}$
+
+## Gesetze
+
+- Assoziativgesetze
+ - $(M \cup N) \cup P = M \cup (N \cup P)$
+ - $(M \cap N) \cap P = M \cap (N \cap P)$
+- Kommutativgesetze
+ - $M \cup N = N \cup M$
+ - $M \cap N = N \cap M$
+- Distributivgesetze
+ - $M \cap (N \cup P) = (M \cap N) \cup (M \cap P)$
+ - $M \cup (N \cap P) = (M \cup N) \cap (M \cup P)$
+- Identitätsgesetze
+ - $M \cup \emptyset = M$
+ - $M \subset N \implies M \cap N = M$
+- Komplementgesetze
+ - $M \subset N \implies M \cup (N \setminus M) = N$
+ - $M \subset N \implies M \cap (N \setminus M) = \emptyset$
+- De Morgansche Regeln
+ - $M \setminus \bigcup_{i \in I} M_i = \bigcap_{i \in I} M \setminus M_i$
+ - $M \setminus \bigcap_{i \in I} M_i = \bigcup_{i \in I} M \setminus M_i$
+
+# Abbildungen
+
+---
+
+Es seien $M$ und $N$ zwei Mengen. Eine **Abbildung** oder **Funktion** $f$ von $M$ nach $N$ ist eine _eindeutige Zuordnung_, die $jedem$ Element $x \in M$ _genau ein_ Element $f(x) \in N$ zuweist. Man verwendet den Begriff _Funktion_ nur dann, wenn $N = \R$ ist.
+
+---
+
+Man nennt $M$ den **Definitionsbereich** von $f$ und $N$ den **Ziel-** oder **Wertebereich**.
+
+_Notation_: $$f: M \to N,\ x \mapsto f(x)$$
+Für zwei Abbildungen $f: M \to N$ und $g: X \to Y$ gilt: $$f = g \iff (M = X \land N = Y \land \forall x \in M : f(x) = g(x))$$
+
+## Legitime Abbildungen
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b2);
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b1);
+\end{tikzpicture}\end{center}
+
+## Illegitime Abbildungen
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,fill=red,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,fill=red,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\end{tikzpicture}\end{center}
+
+## Rechenregeln
+
+Mit den Abbildungen/Funktionen $f: U\to\R$, $g: V\to\R$ und $c\in\R$ gilt:
+\begin{gather*}
+c \cdot f: U\to\R \to \R: x \mapsto c \cdot f(x) \\
+f + g: U \cap V \to \R: x \mapsto f(x) + g(x) \\
+f - g: U \cap V \to \R: x \mapsto f(x) - g(x) \\
+f \cdot g: U \cap V \to \R: x \mapsto f(x) \cdot g(x) \\
+\end{gather*}
+Falls außerdem $\forall x \in U \cap V: g(x) \neq 0$:
+$$\frac{f}{g}: U \cap V \to \R: x \mapsto \frac{f(x)}{g(x)}$$
+
+## Selektionen
+
+### Einschränkung
+
+Mit der Abbildung $f: M \to N$ und $A \subset M$, ist $$f_{\vert A}: A \to N,\ x \mapsto f(x)$$ die **Einschränkung** von $f$ auf $A$. Beispiel mit $A = \{ b,c \}$:
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b1);
+
+\node at (1,-1) {$f$};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$ $] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b1);
+
+\node at (1,-1) {$f_{\vert A}$};
+\end{tikzpicture}\end{center}
+
+### Identität
+
+Mit der Menge $M$ ist die Abbildung $$\text{id}_M : M \to M,\ x \mapsto x$$ die **Identität** auf $M$. Beispiel mit $M = \{ 1,2,3 \}$:
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$1$] (a1) at (0,3) {};
+\node[ele,label=left:$2$] (a2) at (0,2) {};
+\node[ele,label=left:$3$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+
+\node at (1,0) {$\text{id}_M$};
+\end{tikzpicture}\end{center}
+
+### Graph
+
+Mit der Abbildung $f: M \to N$ ist $$\text{Graph}(f) = \{ (x, f(x))\ \vert\ x \in M \} \subset M \times N$$ der **Graph** von $f$. Beispielhafte Visualisierung der Abbildung $f: \R\to\R,\ x \mapsto x^2$:
+
+<!-- prettier-ignore -->
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines = center]
+\addplot[domain=-5:5,color=red]{x*x};
+\end{axis}
+\end{tikzpicture}\end{center}
+
+- Für zwei Abbildungen $f: M \to N$ und $g: P \to N$ gilt: $$f = g \iff \text{Graph}(f) = \text{Graph}(g)$$
+- Ist $\Gamma \subset M \times N$ so, dass $$\forall x \in M\ \exists!\ y \in N: (x,y) \in \Gamma,$$ dann gibt es eine Abbildung $f: M \to N$ mit $\Gamma = \text{Graph}(f)$
+
+### Bild
+
+Mit der Abbildung $f: M \to N$ und $A \subset M$ ist $$f(A) = \{ f(x)\ \vert\ x \in A \} \subset N$$ das **Bild** von $A$ _unter_ $f$. Beispiel mit $f: \R\to\R,\ x \mapsto x^2$ und $A = \{ -2,-1,0,1,2 \} \subset M$: $$f(A) = \{ 0,1,4 \}$$
+$\text{im}(f) = f(M) \subset N$ heißt das **Bild** von $f$. Umgangssprachlich bezeichnet das die Menge des getroffenen Zielbereichs. Mit vorigem Beispiel: $\text{im}(f) = \{ x\in\R\ \vert\ x \geq 0 \}$.
+
+### Urbild
+
+Mit der Abbildung $f: M \to N$ und $B \subset N$ ist $$f^{-1}(B) = \{ x \in M\ \vert\ f(x) \in B \} \subset M$$ das **Urbild** von $B$ unter $f$. Beispiel mit $f: \R\to\R,\ x \mapsto x^2$ und $B = \{ 0, 1, 4 \} \subset N$: $$f^{-1}(B) = \{ -2,-1,0,1,2 \}$$
+Ist $y \in N$ und $x \in M$ mit $f(x) = y$, so nennt man $x$ **ein Urbild** von $y$ unter $f$.
+
+## Nachfolgerfunktion
+
+Die Abbildung $$\text{nf}: \N\to\N,\ x \mapsto x + 1$$ nennt man **Nachfolgerfunktion**. Es gilt $$\text{im}(\text{nf}) = \N \setminus \{ 0 \}$$ und $$\forall y \in \text{im}(f: \text{nf}^{-1}(\{ y \}) = \{ y - 1 \}$$
+
+## Eindeutigkeiten
+
+### Injektivität (linkseindeutig)
+
+Mit Abbildung $f: M \to N$:
+
+$$f \text{ ist injektiv} \iff \forall x,x' \in M: f(x) = f(x') \implies x = x'$$
+oder
+$$f \text{ ist injektiv} \iff \text{jedes } y \in N \text{ hat höchstens ein Urbild}$$
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+
+\node at (1,-1) {injektiv};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,fill=red,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+
+\node at (1,-1) {nicht injektiv};
+\end{tikzpicture}\end{center}
+
+### Surjektivität (rechtstotal)
+
+Mit Abbildung $f: M \to N$:
+
+$$f \text{ ist surjektiv} \iff \forall y \in N\ \exists x \in M: f(x) = y$$
+oder
+$$f \text{ ist surjektiv} \iff \text{im}(f) = N$$
+oder
+$$f \text{ ist surjektiv} \iff \text{jedes } y \in N \text{ hat mindestens ein Urbild}$$
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b3);
+
+\node at (1,-1) {surjektiv};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,fill=red,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b3);
+
+\node at (1,-1) {nicht surjektiv};
+\end{tikzpicture}\end{center}
+
+### Bijektivität (eineindeutig)
+
+Mit Abbildung $f: M \to N$:
+
+$$f \text{ ist bijektiv} \iff f \text{ ist injektiv und surjektiv}$$
+oder
+$$f \text{ ist bijektiv} \iff g: N \to M \text{ existiert}: (g \circ f = \text{id}_M) \land (f \circ g = \text{id}_N)$$
+oder
+$$f \text{ ist bijektiv} \iff \text{jedes } y \in N \text{ hat genau ein Urbild}$$
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b1);
+
+\node at (1,-1) {bijektiv};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,fill=red,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,fill=red,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b4);
+
+\node at (1,-1) {nicht bijektiv};
+\end{tikzpicture}\end{center}
+
+## Komposition
+
+Mit den Abbildungen $f: M \to N$ und $g: N \to P$, ist $$g \circ f: M \to P,\ x \mapsto g(f(x))$$ die **Komposition** oder **Verkettung** von $f$ und $g$. Beispiel:
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[ele,label=right:$\alpha$] (c1) at (4,3) {};
+\node[ele,label=right:$\beta$] (c2) at (4,2) {};
+\node[ele,label=right:$\gamma$] (c3) at (4,1) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\node[draw,fit= (c1) (c2) (c3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (b1) ++(13pt,0) -- (c2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (b2) ++(18pt,0) -- (c1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (b3) ++(12pt,0) -- (c3);
+
+\node at (1,0) {$f: M \to N$};
+\node at (3,0) {$g: N \to P$};
+
+\draw[->,thick] (2,-1) -- (2, -2);
+\end{tikzpicture}\end{center}
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$\alpha$] (c1) at (4,3) {};
+\node[ele,label=right:$\beta$] (c2) at (4,2) {};
+\node[ele,label=right:$\gamma$] (c3) at (4,1) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (c1) (c2) (c3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (c2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (c2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (c1);
+
+\node at (2,0) {$g \circ f: M \to P$};
+\end{tikzpicture}\end{center}
+
+### Assoziativität
+
+Mit den Abbildungen $f: M \to N$, $g: N \to P$ und $h: P \to Q$ gilt: $$(h \circ g) \circ f = h \circ (g \circ f),$$ weshalb man auch kurz $h \circ g \circ f$ schreibt.
+
+### Eindeutigkeiten unter Komposition
+
+Mit den Abbildungen $f: M \to N$ und $g: N \to P$ gilt:
+
+- Sind $f$ und $g$ injektiv, so ist $g \circ f$ injektiv.
+- Sind $f$ und $g$ surjektiv, so ist $g \circ f$ surjektiv.
+- Sind $f$ und $g$ bijektiv, so ist $g \circ f$ bijektiv.
+
+# Vollständige Induktion
+
+---
+
+Sei $\mathcal{A}(n)$ eine Aussageform mit zulässigen Werten $n\in\N$. Falls $\mathcal{A}(0)$ wahr ist und $\mathcal{A}(n) \implies \mathcal{A}(n+1)$ wahr ist, so ist $\mathcal{A}(n)$ wahr für alle $n\in\N$.
+
+---
+
+- \enquote{$\mathcal{A}(0)$ wahr} nennt man den _Induktionsanfang_
+- \enquote{$\mathcal{A}(n)$ wird als wahr vorausgesetzt} nennt man die _Induktionsvoraussetzung_
+- \enquote{$\mathcal{A}(n) \implies \mathcal{A}(n + 1)$} nennt man den _Induktionsschluss_
+
+# Mächtigkeit von Mengen
+
+---
+
+- Eine Menge $M$ ist **endlich**, wenn sie nur endlich viele Elemente enthält. In diesem Fall bezeichnet man mit $\#M = |M|$ die Anzahl an Elementen in $M$ und nennt die Zahl die **Mächtigkeit** von $M$. Enthält $M$ unendlich viele ELemente, so nennt man $M$ **unendlich** und setzt $\#M = |M| = \infty$.
+- Zwei Mengen $M$ und $N$ heißen **gleichmächtig**, wenn es eine bijektive Abbildung $f: M \to N$ gibt.
+- Eine Menge heißt **abzählbar unendlich**, wenn sie gleichmächtig zu $\N$ ist.
+- Eine Menge heißt **überabzählbar**, wenn sie weder endlich noch abzählbar unendlich ist.
+- Für $m,n\in\Z$ bezeichnet man mit $$\{ m,...,n \} = \{ k\in\Z\ \vert\ m \leq k \leq n \}$$ die Menge der ganzen Zahlen zwischen $m$ und $n$.
+
+---
+
+## Eigenschaften endlicher Mengen
+
+- Ist eine Menge endlich und enthält genau $n$ Elemente, so kann man die Elemente in $M$ mit $x_1,x_2,x_3,...,x_n$ abzählen und man erhält eine bijektive Abbildung $$f: \{ 1,...,n \} \to M: i \mapsto x_i.$$ Umgekehrt erlaubt eine solche Abbildung, die Elemente von $M$ abzuzählen und man erhält $|M| = n$. Damit sieht man, dass eine Menge genau dann endlich von Mächtigkeit $n$ ist, wenn es eine Bijektion von $\{ 1,...n \}$ nach $M$ gibt.
+- Ist die Menge $M$ endlich und $A \subset M$, so ist auch $A$ endlich und $|A| \leq |M|$.
+- Ist $M = A \cupdot B$ eine endliche Menge, so gilt $|M| = |A| + |B|$.
+
+**Zusammenhang zwischen Mächtigkeit und Abbildung**:
+
+Mit den nicht-leeren endlichen Mengen $M$ und $N$ gilt:
+
+- $|M| \leq |N| \iff$ eine injektive Abbildung $f: M \to N$ existiert
+- $|M| \geq |N| \iff$ eine surjektive Abbildung $f: M \to N$ existiert
+- $|M| = |N| \iff$ eine bijektive Abbildung $f: M \to N$ existiert
+
+## Schubfachprinzip
+
+Aus dem Zusammenhang zwischen Mächtigkeit und Abbildung folgt $$f: M \to N \text{ ist eine Abbildung und } |M| > |N| \implies f \text{ ist nicht injektiv}.$$ Diese Kontraposition nennt man auch das **Schubfachprinzip**. Umgangssprachlich heißt das: Wenn man $m > n$ Gegenstände auf $n$ Schubfächer verteilen möchte, dann muss man in mindestens ein Schubfach zwei legen.
+
+Beispiel des Versuchs einer Konstruktion einer injektiven Abbildung trotz $|M| > |N|$ mit $M = \{ 1,2,3,4 \}$ und $N = \{ a,b,c \}$:
+
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$1$] (a1) at (0,3) {};
+\node[ele,label=left:$2$] (a2) at (0,2) {};
+\node[ele,label=left:$3$] (a3) at (0,1) {};
+\node[ele,fill=red,label=left:$4$] (a4) at (0,0) {};
+
+\node[ele,label=right:$a$] (b1) at (2,3) {};
+\node[ele,label=right:$b$] (b2) at (2,2) {};
+\node[ele,label=right:$c$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+
+\node at (1,-1) {Injektivität nicht möglich};
+\end{tikzpicture}\end{center}
+
+## Abzählbarkeit von Zahlenbereichen
+
+- Die Menge $\Q$ der rationalen Zahlen ist abzählbar unendlich, da man mithilfe des Cantorschen Diagonalverfahrens eine bijektive Abbildung von $\N$ nach $\Q$ konstruieren kann:
+
+\begin{center}\begin{tikzpicture}[node distance=1cm, arrow/.style={thick,-stealth}]
+\node (a0) at (-1,5) {$0$};
+\node (a1) at (0,5) {$1$};
+\node (a2) at (1,5) {$\frac{1}{2}$};
+\node (a3) at (2,5) {$\frac{1}{3}$};
+\node (a4) at (3,5) {$\frac{1}{4}$};
+\node (a5) at (4,5) {$\frac{1}{5}$};
+\node (a6) at (5,5) {...};
+
+\node (b1) at (0,4) {$-1$};
+\node (b2) at (1,4) {$-\frac{1}{2}$};
+\node (b3) at (2,4) {$-\frac{1}{3}$};
+\node (b4) at (3,4) {$-\frac{1}{4}$};
+\node (b5) at (4,4) {$-\frac{1}{5}$};
+\node (b6) at (5,4) {...};
+
+\node (c1) at (0,3) {$2$};
+\node (c2) at (1,3) {$\frac{2}{2}$};
+\node (c3) at (2,3) {$\frac{2}{3}$};
+\node (c4) at (3,3) {$\frac{2}{4}$};
+\node (c5) at (4,3) {$\frac{2}{5}$};
+\node (c6) at (5,3) {...};
+
+\node (d1) at (0,2) {$-2$};
+\node (d2) at (1,2) {$-\frac{2}{2}$};
+\node (d3) at (2,2) {$-\frac{2}{3}$};
+\node (d4) at (3,2) {$-\frac{2}{4}$};
+\node (d5) at (4,2) {$-\frac{2}{5}$};
+\node (d6) at (5,2) {...};
+
+\node (e1) at (0,1) {$\vdots$};
+\node (e2) at (1,1) {$\vdots$};
+\node (e3) at (2,1) {$\vdots$};
+\node (e4) at (3,1) {$\vdots$};
+\node (e5) at (4,1) {$\vdots$};
+
+\draw [arrow] (a0) -- (a1);
+\draw [arrow] (a1) -- (b1);
+\draw [arrow] (b1) -- (a2);
+\draw [arrow] (a2) -- (a3);
+\draw [arrow] (a3) -- (b2);
+\draw [arrow] (b2) -- (c1);
+\draw [arrow] (c1) -- (d1);
+\draw [arrow] (d1) -- (c2);
+\draw [arrow] (c2) -- (b3);
+\draw [arrow] (b3) -- (a4);
+\draw [arrow] (a4) -- (a5);
+\draw [arrow] (a5) -- (b4);
+\draw [arrow] (b4) -- (c3);
+\draw [arrow] (c3) -- (d2);
+
+\end{tikzpicture}\end{center}
+
+- Die Menge $\R$ der reelen Zahlen ist überabzählbar.
+
+# Äquivalenzrelationen
+
+---
+
+Mit den Mengen $M$ und $N$, ist jede Teilmenge $R \subset M \times N$ eine **Relation** zwischen $M$ und $N$. Für $x \in M$ und $y \in N$ schreibt man auch $xRy$ statt $(x,y) \in R$, wenn $x$ in Relation zu $y$ bezüglich $R$ steht.
+
+---
+
+Für die Äquivalenzrelation $R$ auf die Menge $M$ gilt die Notation: $$x \sim y \iff (x,y) \in R.$$
+
+## Axiome
+
+1. _Reflexivität_: $x \sim x$
+1. _Symmetrie_: $x \sim y \implies y \sim x$
+1. _Transitivität_: $x \sim y \land y \sim z \implies x \sim z$
+
+Beispiel einer abstrakten Alltagssituation: In einer Schule werden SchülerInnen klassisch in Schulklassen unterteilt. Übertragen sind die Axiome dann für die Schüler Alfred, Ben und Christoph:
+
+1. Alfred gehört zu einer Schulklasse.
+1. Wenn Alfred in derselben Schulklasse ist wie Ben, dann ist Ben auch in derselben Schulklasse wie Alfred.
+1. Wenn Alfred in derselben Schulklasse ist wie Ben und wenn zugleich Ben in derselben Schulklasse ist wie Christoph, dann ist auch Alfred in derselben Schulklasse wie Christoph.
+
+In diesem Fall ist dann die Relation \enquote{SchülerIn $x$ ist in derselben Schulklasse wie SchülerIn $y$} die _Äquivalenzrelation_, die SchülerInnen derselben Schulklasse _äquivalent_ und die Schulklassen die _Äquivalenzklassen_.
+
+\begin{center}\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
+% Generated using mathcha.io
+\draw [fill={rgb, 255:red, 216; green, 216; blue, 216 } ,fill opacity=0.38 ] (10.08,222.25) .. controls (10.08,106.27) and (152.23,12.25) .. (327.58,12.25) .. controls (502.93,12.25) and (645.08,106.27) .. (645.08,222.25) .. controls (645.08,338.23) and (502.93,432.25) .. (327.58,432.25) .. controls (152.23,432.25) and (10.08,338.23) .. (10.08,222.25) -- cycle ;
+\draw [color={rgb, 255:red, 255; green, 0; blue, 0 } ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=0.07 ] (45,224.63) .. controls (45,156.9) and (106.8,102) .. (183.04,102) .. controls (259.28,102) and (321.08,156.9) .. (321.08,224.63) .. controls (321.08,292.35) and (259.28,347.25) .. (183.04,347.25) .. controls (106.8,347.25) and (45,292.35) .. (45,224.63) -- cycle ;
+\draw [color={rgb, 255:red, 0; green, 56; blue, 255 } ,draw opacity=1 ][fill={rgb, 255:red, 0; green, 36; blue, 255 } ,fill opacity=0.09 ] (294,112.13) .. controls (294,66.77) and (334.54,30) .. (384.54,30) .. controls (434.55,30) and (475.08,66.77) .. (475.08,112.13) .. controls (475.08,157.48) and (434.55,194.25) .. (384.54,194.25) .. controls (334.54,194.25) and (294,157.48) .. (294,112.13) -- cycle ;
+\draw [color={rgb, 255:red, 0; green, 255; blue, 18 } ,draw opacity=1 ][fill={rgb, 255:red, 0; green, 255; blue, 64 } ,fill opacity=0.15 ] (319,292.13) .. controls (319,238.48) and (380.8,195) .. (457.04,195) .. controls (533.28,195) and (595.08,238.48) .. (595.08,292.13) .. controls (595.08,345.77) and (533.28,389.25) .. (457.04,389.25) .. controls (380.8,389.25) and (319,345.77) .. (319,292.13) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (132.45,169.89) -- (152.06,172.25) -- (149.92,191.88) -- (145.56,186.38) -- (123.81,203.66) -- (128.18,209.15) -- (108.57,206.8) -- (110.71,187.17) -- (115.08,192.66) -- (136.82,175.39) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (171.25,236.85) -- (182.75,256.14) -- (161.41,263.16) -- (163.87,256.58) -- (131.04,244.31) -- (128.58,250.88) -- (117.08,231.59) -- (138.41,224.58) -- (135.95,231.15) -- (168.79,243.43) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (225.02,221) -- (219.54,243.94) -- (199.19,232.02) -- (205.65,229.26) -- (190.78,194.41) -- (184.32,197.16) -- (189.8,174.23) -- (210.15,186.14) -- (203.69,188.9) -- (218.56,223.75) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (141.42,125.91) .. controls (144.77,122.76) and (157.93,131.32) .. (170.82,145.04) -- (164.76,150.74) .. controls (151.87,137.03) and (138.7,128.46) .. (135.35,131.61) ;\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (135.35,131.61) .. controls (132.69,134.11) and (137.01,143.23) .. (145.35,153.75) -- (143.33,155.65) -- (155.66,159.29) -- (153.44,146.15) -- (151.42,148.05) .. controls (143.08,137.53) and (138.76,128.4) .. (141.42,125.91)(135.35,131.61) -- (141.42,125.91) ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (280,228.97) .. controls (283.26,232.22) and (275.13,245.66) .. (261.84,258.99) -- (255.94,253.11) .. controls (269.23,239.78) and (277.36,226.34) .. (274.11,223.09) ;\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (274.11,223.09) .. controls (271.52,220.52) and (262.54,225.14) .. (252.3,233.82) -- (250.34,231.86) -- (247.1,244.3) -- (260.17,241.65) -- (258.2,239.69) .. controls (268.44,231.01) and (277.42,226.4) .. (280,228.97)(274.11,223.09) -- (280,228.97) ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (71.28,251.71) .. controls (67.32,249.24) and (69.89,233.12) .. (77.02,215.69) -- (84.19,220.16) .. controls (77.06,237.58) and (74.49,253.71) .. (78.45,256.17) ;\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (78.45,256.17) .. controls (81.59,258.13) and (87.9,250.9) .. (93.93,239.12) -- (96.32,240.61) -- (94.94,226.86) -- (84.38,233.17) -- (86.76,234.66) .. controls (80.73,246.43) and (74.42,253.66) .. (71.28,251.71)(78.45,256.17) -- (71.28,251.71) ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (417.45,243.89) -- (437.06,246.25) -- (434.92,265.88) -- (430.56,260.38) -- (408.81,277.66) -- (413.18,283.15) -- (393.57,280.8) -- (395.71,261.17) -- (400.08,266.66) -- (421.82,249.39) -- cycle ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (458.25,313.85) -- (469.75,333.14) -- (448.41,340.16) -- (450.87,333.58) -- (418.04,321.31) -- (415.58,327.88) -- (404.08,308.59) -- (425.41,301.58) -- (422.95,308.15) -- (455.79,320.43) -- cycle ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (513.48,300.42) -- (508.49,324.5) -- (487.65,311.44) -- (494.11,308.69) -- (478.26,271.55) -- (471.81,274.31) -- (476.8,250.23) -- (497.64,263.28) -- (491.18,266.04) -- (507.03,303.18) -- cycle ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (428.42,203.91) .. controls (431.77,200.76) and (444.93,209.32) .. (457.82,223.04) -- (451.76,228.74) .. controls (438.87,215.03) and (425.7,206.46) .. (422.35,209.61) ;\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (422.35,209.61) .. controls (419.69,212.11) and (424.01,221.23) .. (432.35,231.75) -- (430.33,233.65) -- (442.66,237.29) -- (440.44,224.15) -- (438.42,226.05) .. controls (430.08,215.53) and (425.76,206.4) .. (428.42,203.91)(422.35,209.61) -- (428.42,203.91) ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (558,304.97) .. controls (561.26,308.22) and (553.13,321.66) .. (539.84,334.99) -- (533.94,329.11) .. controls (547.23,315.78) and (555.36,302.34) .. (552.11,299.09) ;\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (552.11,299.09) .. controls (549.52,296.52) and (540.54,301.14) .. (530.3,309.82) -- (528.34,307.86) -- (525.1,320.3) -- (538.17,317.65) -- (536.2,315.69) .. controls (546.44,307.01) and (555.42,302.4) .. (558,304.97)(552.11,299.09) -- (558,304.97) ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (357.28,329.71) .. controls (353.32,327.24) and (355.89,311.12) .. (363.02,293.69) -- (370.19,298.16) .. controls (363.06,315.58) and (360.49,331.71) .. (364.45,334.17) ;\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (364.45,334.17) .. controls (367.59,336.13) and (373.9,328.9) .. (379.93,317.12) -- (382.32,318.61) -- (380.94,304.86) -- (370.38,311.17) -- (372.76,312.66) .. controls (366.73,324.43) and (360.42,331.66) .. (357.28,329.71)(364.45,334.17) -- (357.28,329.71) ;
+\draw [fill={rgb, 255:red, 0; green, 19; blue, 255 } ,fill opacity=1 ] (347.56,81.47) .. controls (351.45,77.84) and (365.02,86.04) .. (377.87,99.8) -- (370.81,106.39) .. controls (357.97,92.63) and (344.4,84.42) .. (340.5,88.06) ;\draw [fill={rgb, 255:red, 0; green, 19; blue, 255 } ,fill opacity=1 ] (340.5,88.06) .. controls (337.55,90.82) and (341,99.59) .. (348.44,109.67) -- (346.09,111.86) -- (360.23,116.27) -- (357.85,100.89) -- (355.5,103.08) .. controls (348.06,93) and (344.6,84.23) .. (347.56,81.47)(340.5,88.06) -- (347.56,81.47) ;
+
+\draw (153,153) node [anchor=north west][inner sep=0.75pt] [align=left] {Alfred};
+\draw (84,207) node [anchor=north west][inner sep=0.75pt] [align=left] {Ben};
+\draw (187,245) node [anchor=north west][inner sep=0.75pt] [align=left] {Christoph};
+\draw (440,230) node [anchor=north west][inner sep=0.75pt] [align=left] {Anne};
+\draw (371,284) node [anchor=north west][inner sep=0.75pt] [align=left] {Freddi};
+\draw (474,322) node [anchor=north west][inner sep=0.75pt] [align=left] {Dominik};
+\draw (360,105) node [anchor=north west][inner sep=0.75pt] [align=left] {Phillip};
+\draw (150,52) node [anchor=north west][inner sep=0.75pt] [align=left] {\textbf{\underline{Alle SchülerInnen}}};
+\draw (232,158) node [anchor=north west][inner sep=0.75pt] [font=\normalsize,color={rgb, 255:red, 0; green, 0; blue, 0 } ,opacity=1 ] [align=left] {\textbf{\underline{Klasse 1}}};
+\draw (350,40) node [anchor=north west][inner sep=0.75pt] [align=left] {\textbf{\underline{Klasse 2}}};
+\draw (511.17,240) node [anchor=north west][inner sep=0.75pt] [align=left] {\textbf{\underline{Klasse 3}}};
+\end{tikzpicture}\end{center}
+
+## Äquivalenzklassen
+
+Mit der Menge $M$ und der Äquivalenzrelation $\sim$ auf $M$, heißt für $x \in M$ die Menge $$[x] = \{ y \in M\ \vert\ y \sim x \}$$ die **Äquivalenzklasse** von $x$. Jedes $y \in [x]$ heißt ein **Repräsentant** der Klasse $[x]$.
+
+Mit dem vorigen Beispiel gilt: $$[\text{Alfred}] = \{ \text{Alfred, Ben, Christoph} \}.$$
+
+---
+
+Mit $$M/{\sim} = \{ [x]\ \vert\ x \in M \}$$ bezeichnet man die Menge der **Äquivalenzklassen modulo der Äquivalenzrelation** $\sim$.
+
+Mit dem vorigen Beispiel gilt: $$M/{\sim} = \{ [\text{Alfred}], [\text{Ben}], [\text{Christoph}], [\text{Philipp}], [\text{Anne}], [\text{Dominik}], [\text{Freddi}] \}.$$
+
+## Disjunkte Zerlegung
+
+Ist $(M_i)_{i \in I}$ eine disjunkte Zerlegung der Menge $M$ und die Relation auf $M$ $$x \sim y \iff \exists i \in I : x,y \in M_i,$$ dann ist $\sim$ eine Äquivalenzrelation auf $M$.
+
+---
+
+Ist $\sim$ eine Äquivalenzrelation auf der Menge $M$, dann bilden die Äquivalenzklassen eine disjunkte Zerlegung von $M$, d.h. jedes $x \in M$ liegt in genau einer Äquivalenzklasse. Insbesondere gilt für Äquivalenzklassen $[x]$ und $[y]$ entweder $[x] = [y]$ oder $[x] \cap [y] = \emptyset$.
+
+---
+
+Voriges Beispiel der Schulklassen ist hilfreich um zu sehen, dass kein Repräsentant in zwei Äquivalenzklassen gleichzeitig sein kann und damit eine disjunkte Zerlegung der SchülerInnen vorliegen muss.
+
+## Kongruenz modulo $n$
+
+Mit $n\in\Z_{>0}$ und $a,b\in\Z$ wird die Äquivalenzrelation $\equiv$ definiert: $$a \equiv b \pmod{n} \iff n\ \vert\ a - b$$
+Das heißt, die Reste der ganzzahligen Division von $a$ mit $n$, sowie von $b$ mit $n$, müssen gleich sein. Zwei äquivalente Zahlen $a$ und $b$ werden dann auch **kongruent modulo $n$** genannt.
+
+---
+
+Beispiel mit $5 \equiv 11 \pmod{3}$:
+
+Die Aussage ist wahr, da $\frac{5}{3} = 1 \text{ Rest } 2$ und $\frac{11}{3} = 3 \text{ Rest } 2$ die gleichen Reste besitzen bzw. auch $3\ \vert\ (11 - 5) = 3\ \vert\ 6$ wahr ist.
+
+---
+
+TODO: Beispiele (ggf. S.55?)
+
+Man bezeichnet die Äquivalenzklasse von $a\in\Z$ mit $$[a] = \{ b\in\Z\ \vert\ a \equiv b \pmod{n} \}$$
+Die Menge der Äquivalenzklassen ist $$\Z/n\Z = \{ [a]\ \vert\ a\in\Z \}$$ und es gilt $|\Z/n\Z| = n$.
+
+# Gruppen
+
+---
+
+Eine **Gruppe** ist ein Paar $(G,*)$ bestehend aus einer _nicht-leeren_ Menge $G$ und einer zweistelligen Operation \enquote{$*$}, d.h. einer Abbildung $$*: G \times G \to G: (g,h) \mapsto g * h,$$ sodass folgende _Gruppenaxiome_ gelten:
+
+1. _Assoziativgesetz_: $(g * h) * k = g * (h * k)\ \forall g,h,k \in G$
+2. _Existenz eines Neutralen_: $\exists e \in G: \forall g \in G: e * g = g$
+3. _Existenz von Inversen_: $\forall g \in G: \exists g^{-1} \in G: g^{-1} * g = e$
+
+Eine Gruppe $(G,*)$ heißt **abelsch** oder **kummutativ**, wenn $(G,*)$ zudem noch dem folgenden Axiom genügt:
+
+4. _Kommutativgesetz_: $g * h = h * g\ \forall g,h \in G$
+
+---
+
+## Eigenschaften
+
+- Aufgrund der Axiome erhält man folgende Eigenschaften für eine Gruppe $(G,*)$:
+
+ - Das neutrale Element $e \in G$ ist eindeutig bestimmt und hat die Eigenschaft $$e * g = g * e = g\ \forall g \in G$$
+ - Mit $g \in G$ ist das inverse Element $g^{-1}$ zu $g$ eindeutig bestimmt und hat die Eigenschaft $$g^{-1} * g = g * g^{-1} = e$$
+ - Für $g,h \in G$ gelten $(g^{-1})^{-1} = g$ und $(g * h)^{-1} = h^{-1} * g^{-1}$
+
+- Häufig wird \enquote{$*$} die _Gruppenmultiplikation_ genannt.
+
+- Ist $(G,*)$ eine Gruppe mit endlich vielen Elementen $n\in\N$, so bezeichnet man mit $\#G = |G| = n$ die **Ordnung** der Gruppe.
+
+## Kürzungsregeln
+
+Für die Gruppe $(G,*)$ gilt mit $g,a,b \in G$:
+
+- $g * a = g * b \implies a = b$
+- $a * g = b * g \implies a = b$
+
+## Multiplikative Gruppe
+
+Wird die Gruppenoperation als Multiplikation und mit \enquote{$\cdot$} bezeichnet, so schreibt man
+
+- für das Neutrale Element $1_G$ bzw. 1
+- für das Inverse zu $g$ $g^{-1}$ oder $\frac{1}{g}$
+- häufig das Multiplikationszeichen nicht, wenn die Bedeutung klar ersichtlich ist (z.B. $gh$ statt $g \cdot h$)
+- für das Produkt von $g1,...,g_n \in G$ $$\prod_{i=1}^n g_i = g_1 \cdot g_2 \cdot ... \cdot g_n$$
+
+Außerdem gelten normale multiplikative Potenzgesetze. Allerdings gilt $$(g \cdot h)^n = g^n \cdot h^n$$ **nicht** in nicht-abelschen Gruppen, da z.B. mit $n = 4$ Kommutativität notwendig ist:
+\begin{displaymath}
+\begin{split}
+(g \cdot h)^n &= g^n \cdot h^n \\
+\implies (g \cdot h)^4 &= g^4 \cdot h^4 \\
+\implies (g \cdot h) \cdot (g \cdot h) \cdot (g \cdot h) \cdot (g \cdot h) &= (g \cdot g \cdot g \cdot g) \cdot (h \cdot h \cdot h \cdot h) \\
+\implies g \cdot h \cdot g \cdot h \cdot g \cdot h \cdot g \cdot h &= g \cdot g \cdot g \cdot g \cdot h \cdot h \cdot h \cdot h
+\end{split}
+\end{displaymath}
+
+## Additive Gruppe
+
+Wird die Gruppenoperation als Addition und mit \enquote{$+$} bezeichnet, so schreibt man
+
+- für das Neutrale Element meist $0_G$ bzw. 0
+- für das Inverse zu $g$ meist $-g$ und meist $g - h$ statt $g + (-h)$
+- für die Summe von $g1,...,g_n \in G$ $$\sum_{i=1}^n g_i = g_1 + g_2 + ... + g_n$$
+
+Außerdem gelten normale additive Rechenregeln. Insbesondere muss man bei Rechnungen aufpassen, die je nach Variablen unterschiedliche Operationen mit gleichem Symbol nutzen. Beispiel mit $g,h \in G$ und $m,n \in \Z$:
+
+- $\underbrace{(m + n)}_{\text{Add. in } \Z}g = \underbrace{mg + ng}_{\text{Add. in } G}$
+- $n \cdot \underbrace{(m + n)}_{\text{Add. in } G} = \underbrace{ng + nh}_{\text{Add. in } G}$
+- $0_\Z \cdot g = 0_G$
+- $n \cdot 0_G = 0_G$
+
+# Körper
+
+---
+
+Ein **Körper** ist ein Tripel $(K,+,\cdot)$ bestehend aus einer Menge $K$ zusammen mit zwei zweistelligen Operationen
+$$+: K \times K \to K: (x,y) \mapsto x + y, \quad (\textit{\enquote{Addition}})$$
+und
+$$\cdot: K \times K \to K: (x,y) \mapsto x \cdot y, \quad (\textit{\enquote{Multiplikation}})$$
+sodass folgende Axiome erfüllt sind:
+
+1. $(K,+)$ ist eine abelsche Gruppe mit neutralem Element $0$.
+2. $(K \setminus \{ 0 \}, \cdot)$ ist eine abelsche Gruppe mit neutralem Element $1$.
+3. _Distributivgesetz_: $x \cdot (y + z) = x \cdot y + x \cdot z$ für $x,y,z \in K$.
+
+Ist eine Teilmenge $L \subset K$ eines Körpers mit den _gleichen_ Operationen wieder selbst ein Körper, so nennen wir $L$ einen **Teilkörper** von $K$.
+
+---
+
+Beispiele:
+
+- Die rationalen Zahlen $(\Q,+,\cdot)$ und die reelen Zahlen $(\R,+,\cdot)$ mit der üblichen Addition und Multiplikation sind Körper. $\Q$ ist ein Teilkörper von $\R$.
+- Die ganzen Zahlen $(\Z,+,\cdot)$ sind kein Körper, da z.B. der Zahl $2$ ein multiplikatives Inverses fehlt (weil nur $2 \cdot \frac{1}{2} = e = 1$).
+- Der kleinstmögliche und zudem endliche Körper ist $\mathbb{F}_2 = \{ 0,1 \}$ und wird durch folgende Additions- und Multiplikationstafeln definiert:
+
+\begin{center}\begin{tabular}{ c || c | c }
+$+$ & $0$ & $1$ \\ \hline\hline
+$0$ & $0$ & $1$ \\ \hline
+$1$ & $1$ & $0$
+\end{tabular}
+\quad
+\begin{tabular}{ c || c | c }
+$\cdot$ & $0$ & $1$ \\ \hline\hline
+$0$ & $0$ & $0$ \\ \hline
+$1$ & $0$ & $1$
+\end{tabular}\end{center}
+
+## Rechenregeln
+
+Mit Körper $K$, $x,y,z \in K$ und $u,v \in K \setminus \{ 0 \}$ gilt:
+
+- $-(-x) = x$
+- $x + y = z \iff x = z - y$
+- $-(x + y) = -x -y$
+- $0 \cdot x = x \cdot 0 = 0$
+- $(-x) \cdot y = x \cdot (-y) = -(x \cdot y)$
+- $(-x) \cdot (-y) = x \cdot y$
+- $x \cdot (y - z) = x \cdot y - x \cdot z$
+- $(x^{-1})^{-1} = x, \text{ für } x \neq 0$
+- $x \cdot y = 0 \iff x = y \text{ oder } y = 0$
+- $z \cdot x = z \cdot y,\ z \neq 0 \implies x = y$
+- $\frac{x}{u} \cdot \frac{y}{v} = \frac{x \cdot y}{u \cdot v}$
+- $\frac{x}{u} + \frac{y}{v} = \frac{x \cdot v + y \cdot u}{u \cdot v}$
+
+# Produkte und Summen
+
+TODO: Später?
+
+# Ordnungsrelationen
+
+---
+
+Eine **Ordnungsrelation** (auch _Halbordnung_ oder _partielle Ordnung_) auf die Menge $M$ ist eine Relation $R \subset M \times M$, sodass für alle $x,y,z \in M$ mit der Notation
+$$x \leq y \iff (x,y) \in R$$
+gilt:
+
+1. _Reflexivität_: $x \leq x$
+1. _Antisymmetrie_: $x \leq y \land y \leq x \implies x = y$
+1. _Transitivität_: $x \leq y \land y \leq z \implies x \leq z$
+
+---
+
+## Total- und Wohlordnungen
+
+Mit der Menge $M$ gilt:
+
+- Eine Ordnungsrelation \enquote{$\leq$} auf $M$ heißt **Totalordnung** oder **lineare Ordnung**, falls je zwei Elemente aus $M$ vergleichbar sind, d.h. für je zwei Elemente $x,y \in M$ gilt $x \leq y$ oder $y \leq x$.
+- Ist \enquote{$\leq$} eine Ordnungsrelation auf $M$, $A \subset M$ und $x \in A$, so heißt x **minimal** (bzw. **maximal** in $A$, falls für alle $y \in A$ mit $y \leq x$ (bzw. $x \leq y$) gilt $x = y$.
+- Eine Totalordnung heißt **Wohlordnung**, falls jede nicht-leere Teilmenge von $M$ ein minimales Element besitzt.
+
+Minima und Maxima einer Menge $M$ bezüglich einer Totalordnung werden mit $\min(M)$ bzw. $\max(M)$ bezeichnet.
+
+Beispiele:
+
+- Die natürlichen Zahlen $(\N,\leq)$ mit der üblichen Kleiner-Gleich-Relation $\leq$ sind wohlgeordnet (**archimedisches Prinzip**).
+- Die reelen Zahlen $(\R,\leq)$ mit der üblichen Kleiner-Gleich-Relation $\leq$ sind totalgeordnet, aber nicht wohlgeordnet.
+- Die reelen Zahlen $(\Z,\leq)$ mit der üblichen Kleiner-Gleich-Relation $\leq$ sind totalgeordnet, aber nicht wohlgeordnet:
+ $$... < -2 < -1 < 0 < 1 < 2 < ...$$ Die \enquote{unübliche Anordnung} $$0 < -1 < 1 < -2 < 2 < -3 < 3 < ...$$ ist eine Wohlordnung auf $\Z$.
+
+## Supremum und Infimum
+
+Es sei \enquote{$\leq$} eine Totalordnung auf einer Menge $M$ und $\emptyset \neq A \subset M$ eine nicht-leere Teilmenge von $M$. Die Menge $B = \{ 1,2,3 \} \subset \R$ dient hierbei als Beispiel. Dann nennt man
+
+- $s \in M$ eine **obere Schranke** von $A$, falls $\forall x \in A : s \geq x$.
+ $$\text{Obere Schranken von } B:\ \{ b\ \vert\ b \geq 3 \}$$
+- $A$ **nach oben beschränkt**, falls $A$ eine obere Schranke besitzt.
+- $s \in M$ das **Supremum** von $A$, falls $s$ das Minimum der Menge der oberen Schranken von $A$ ist. Dieses Minimum ist eindeutig bestimmt, wenn es existiert, und wird dann mit $\sup(A)$ bezeichnet.
+ $$\sup(B) = 3$$
+- $s \in M$ eine **untere Schranke** von $A$, falls $\forall x \in A : s \leq x$.
+ $$\text{Untere Schranken von } B:\ \{ b\ \vert\ b \leq 1 \}$$
+- $A$ **nach unten beschränkt**, falls $A$ eine untere Schranke besitzt.
+- $s \in M$ das **Infimum** von $A$, falls $s$ das Maximum der Menge aller unteren Schranken von $A$ ist. Dieses Maximum ist eindeutig bestimmt, wenn es existiert, und wird dann mit $\inf(A)$ bezeichnet.
+ $$\inf(B) = 1$$
+- $A$ **beschränkt**, wenn $A$ nach oben _und_ nach unten beschränkt ist.
+
+**Supremumsaxiom:**
+
+\begin{center}\fbox{\parbox{12cm}{\centering Jede nicht-leere, nach unten/oben beschränkte Teilmenge von $\R$ besitzt ein Infimum/Supremum in $\R$}}\end{center}
+
+$\Q$ erfüllt die Eigenschaften des Supremumsaxioms nicht, da beispielsweise $$\{ x \in \Q\ \vert\ x > 0 \land x^2 \leq 2 \}$$ zwar nach oben beschränkt ist, aber kein Supremum in $\Q$ besitzt.
+
+# Angeordnete Körper
+
+---
+
+Es sei $K$ ein Körper und \enquote{$\leq$} eine Totalordnung auf $K$. Man nennt das Quadrupel $(K,+,\cdot,\leq)$ einen **angeordneten Körper**, wenn die Totalordnung mit der Addition und der Multiplikation verträglich ist, d.h. wenn für alle $x,y,z \in K$ $$x < y \implies x + z < y + z$$ und $$x < y,\ 0 < z \implies x \cdot z < y \cdot z$$ gilt. Ist $x \in K$ und $x > 0$, so nennt man $x$ **positiv**, ist $x < 0$, so nennt man $x$ **negativ**.
+
+---
+
+## Rechenregeln
+
+Mit dem angeordneten Körper $(K,+,\cdot,\leq)$ und $x,y,u,v \in K$ gilt:
+
+- $x > 0 \iff -x < 0$.
+- Ist $x \neq 0$, so ist $x^2 > 0$.
+- $1 > 0$.
+- Ist $0 < x < y$, so ist $0 < \frac{1}{y} < \frac{1}{x}$.
+- Ist $x < y$ und $u < v$, so ist $x + y < y + v$.
+- Ist $0 < x$ und $n\in\N$, so ist $0 < x^n$.
+- Ist $0 \leq x,y$ und $n\in\N$ mit $n \geq 1$, so gilt $$x < y \iff x^n < y^n.$$
+
+## Charakterisierung des Supremums und Infimums
+
+Mit dem angeordneten Körper $(K,+,\cdot,\leq)$, $A \subset K$ und $s \in K$ gilt:
+$$s = \sup(A) \iff \forall x \in A: x \leq s \text{ und } \forall 0 < \varepsilon \in K: \exists x \in A: s - \varepsilon < x$$
+sowie
+$$s = \inf(A) \iff \forall x \in A: x \geq s \text{ und } \forall 0 < \varepsilon \in K: \exists x \in A: s + \varepsilon > x$$
+
+Mit den nicht-leeren Teilmengen $A,B \subset \R$ mit $\forall a \in A, b \in B: a \leq b$ gilt $$\sup(A) \leq \inf(B).$$
+
+# Eigenschaften der reelen Zahlen $\R$
+
+- Der Körper $\R$ der reelen Zahlen mit der üblichen Ordnungsrelation ist der einzige angeordnete Körper, in dem jede nicht-leere, nach oben beschränkte Menge ein Supremum besitzt. TODO: Why not $\N$, ..?
+- Für $x,y\in\R$ mit $0 < x < y$ gibt es eine natürliche Zahl $n\in\N$, sodass $y < n \cdot x$ (**archimedische Ordnung**)
+- Für alle $x\in\R$ gibt es eine ganze Zahl $n$, sodass $n \leq x < n + 1$.
+- Für alle $\varepsilon\in\R$ mit $\varepsilon > 0$ gibt es eine natürliche Zahl $n$, sodass $0 < \frac{1}{n} < \varepsilon$.
+- $\Q$ liegt dicht in $\R$: Sind $a,b \in \R$ mit $a < b$, so gibt es eine rationale Zahl im Intervall $(a,b)$.
+- Mit $x \in \R$, $x \geq -1$ und $n\in\N$ gilt $(1+x)^n \geq 1 + n \cdot x$ (**bernoullische Ungleichung**)
+- Existenz von $n$-ten Wurzeln in $\R$: $\forall x\in\R \geq 0,\ n\in\N \geq 2\ \exists! a\in\R \geq 0 : a^n = x$
+- $\sqrt{2}$ ist irrational
+
+## Intervalle
+
+Mit $a,b\in\R$ gilt:
+
+- **Abgeschlossenes Intervall**: $[a,b] = \{ x\in\R\ \vert\ a \leq x \leq b \}$
+- **Offenes Intervall**: $(a,b) = \{ x\in\R\ \vert\ a < x < b \}$
+- **Halboffenes Intervall**: $$[a,b) = \{ x\in\R\ \vert\ a \leq x < b \}$$ $$(a,b] = \{ x\in\R\ \vert\ a < x \leq b \}$$
+- **Uneigentliches Intervall**:
+ $$[a,\infty) = \{ x\in\R\ \vert\ a \leq x \}$$
+ $$(a,\infty) = \{ x\in\R\ \vert\ a < x \}$$
+ $$(-\infty,a] = \{ x\in\R\ \vert\ x \leq a \}$$
+ $$(-\infty,a) = \{ x\in\R\ \vert\ x < a \}$$
+ $$(-\infty,\infty) = \R$$
+
+# Der Körper der komplexen Zahlen $\C$
+
+---
+
+Die Menge $\C = \{ (x,y)\ \vert\ x,y\in\R \}$ zusammen mit der durch
+$$(x,y) + (u,v) = (x + u, y + v),\ \text{ für } (x,y),(u,v)\in\C,$$ und
+$$(x,y) \cdot (u,v) = (xu - yv, xv + yu),\ \text{ für } (x,y),(u,v)\in\C,$$
+definierte Addition und Multiplikation ist ein Körper, den man den Körper der **komplexen Zahlen** nennt.
+
+---
+
+## Notation
+
+Mit $x\in\R$ und $x = (x,0)$, sowie mit $i = (0,1)$, gilt für $z = (x,y)\in\C$ $$z = (x,y) = (x,0) + (0,y) = (x,0) + (0,1) \cdot (y,0) = x + iy$$
+Damit gilt dann $$i^2 = (0,1) \cdot (0,1) = -1$$
+Daraus folgt auch die Definition der Multiplikation in dieser Notation: $$(x + iy)(u + iv) = (xu + i^2yv) + i(xv + yu) = (xu - yv) + i(xv + yu)$$
+
+Die **Betragsfunktion** wird auf $\C$ definiert durch $$|\cdot| \C \to \R_{\geq 0}: x + iy \mapsto \sqrt{x^2 + y^2}.$$
+Man nennt $|x|$ den **Absolutbetrag** von $x$.
+
+Die **komplexe Konjugation** wird definiert durch $$\overline{\cdot}: \C \to \C: z = x + iy \mapsto \overline{z} = x - iy.$$
+Für $z\in\C$ heißt $\overline{z}$ die zu $z$ **konjugiert komplexe Zahl**.
+
+Der **Realteil** wird definiert durch die Abbildung $$\text{Re}: \C \to \R: x + iy \mapsto x.$$
+$\text{Re}(x + iy) = x$ nennt man dann den Realteil von $z$.
+
+Der **Imaginärteil** wird definiert durch die Abbildung $$\text{Im}: \C \to \R: x + iy \mapsto y.$$
+$\text{Im}(x + iy) = y$ nennt man dann den Imaginärteil von $z$.
+
+## Eigenschaften
+
+- $\C$ ist eine Teilmenge von $\R$, da es eine Abbildung $$\iota: \R\to\C: x \mapsto (x,0)$$ gibt.
+- Es gibt keine Totalordnung \enquote{$\leq$} auf $\C$, die $\C$ zu einem angeordneten Körper macht (da $0 \nless i^2$).
+
+## Rechenregeln
+
+Mit $z,w\in\C$ gilt:
+
+- Der Betrag ist multiplikativ: $|z| \cdot |w| = |zw|$
+- Der Betrag erfüllt die _Dreiecksungleichung_: $|z + w| \leq |z| + |w|$ und $||z| - |w|| \leq |z - w|$.
+- $z = 0 \iff |z| = 0$
+- $z \cdot \overline{z} = |z|^2$.
+- Wenn $z \neq 0$, dann ist $z^{-1} = \frac{1}{z} = \frac{\overline{z}}{|z|^2}$.
+- Die komplexe Konjugation ist additiv: $\overline{z} + \overline{w} = \overline{z+w}$.
+- Die komplexe Konjugation ist multiplikativ: $\overline{z} \cdot \overline{w} = \overline{z \cdot w}$.
+- $\overline{\overline{z}} = z$.
+- $\text{Re}(z) = \frac{z + \overline{z}}{2} \leq |z|$.
+- $\text{Im}(z) = \frac{z - \overline{z}}{2i} \leq |z|$.
+- $|z| = |\overline{z}| = |-z|$.
+
+## Geometrische Deutung
+
+### Graph von $z$
+
+Mit $z = x + yi = 4 + 5i$:
+
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=-1,xmax=5,ymin=-1,ytick={-1,...,6},ymax=6,minor tick num=1,ticks=both,yticklabels={$-i$, $0$, $i$, $2i$, $3i$, $4i$, $5i$, $6i$}]
+\addplot[black,mark=*] coordinates {(4,5)} {};
+\addplot[ultra thick,dashed,red] coordinates { (0,0) (4,0) } node[pos=0.5,above] {$\text{Re}(z)=4$};
+\addplot[,dashed,red] coordinates { (4,0) (4,5) } node[pos=0.5,left] {$\text{Im}(z)=5$};
+
+\node [above,red] at (axis cs: 4,5) {$4+5i$};
+\end{axis}
+\end{tikzpicture}\end{center}
+
+### Vektoraddition
+
+Mit $z = x + yi = 1 + 3i$ und $w = u + vi = 4 + 2i$ und $z + w = 5 + 5i$:
+
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=-1,xmax=6,ymin=-1,ytick={-1,...,6},ymax=6,minor tick num=1,ticks=both,yticklabels={$-i$, $0$, $i$, $2i$, $3i$, $4i$, $5i$, $6i$}]
+\addplot[black,mark=*] coordinates {(1,3)} {};
+\addplot[black,mark=*] coordinates {(5,5)} {};
+\addplot[black,mark=*] coordinates {(4,2)} {};
+
+\addplot[red] coordinates { (0,0) (1,3) } node[pos=1,left] {$z$};
+\addplot[red] coordinates { (0,0) (5,5) } node[pos=1,above] {$z+w$};
+\addplot[red] coordinates { (0,0) (4,2) } node[pos=1,right] {$w$};
+
+\addplot[dashed,red] coordinates { (1,3) (5,5) };
+\addplot[dashed,red] coordinates { (4,2) (5,5) };
+\end{axis}
+\end{tikzpicture}\end{center}
+
+### Betrag
+
+Mit $z = x + iy = 4 + 5i$, entspricht der Betrag $|z| = \sqrt{x^2 + y^2} = \sqrt{4^2 + 5^2} \approx 6.4 = r$ der euklidischen Länge des Vektors $z$:
+
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=-1,xmax=5,ymin=-1,ytick={-1,...,6},ymax=6,minor tick num=1,ticks=both,yticklabels={$-i$, $0$, $i$, $2i$, $3i$, $4i$, $5i$, $6i$}]
+\addplot[black,mark=*] coordinates {(4,5)} {};
+\addplot[red] coordinates { (0,0) (4,5) } node[pos=0.5,above] {$r$};
+\addplot[ultra thick,dashed,red] coordinates { (0,0) (4,0) } node[pos=0.5,above] {$\text{Re}(z)=4$};
+\addplot[dashed,red] coordinates { (4,0) (4,5) } node[pos=0.5,left] {$\text{Im}(z)=5$};
+
+\node [above,red] at (axis cs: 4,5) {$4+5i$};
+\end{axis}
+\end{tikzpicture}\end{center}
+
+Damit ergibt sich, weshalb $|z| = r = \sqrt{x^2 + y^2}$, da $\text{Re}(z)^2 + \text{Im}(z)^2 = x^2 + y^2 = r^2$ (Satz des Pythagoras).
+
+Daraus erschließt sich auch die Dreiecksungleichung, da in einem Dreieck die Summe der Seitenlängen von zwei Seiten stets eine obere Schranke für die Seitenlänge der dritten Seite ist.
+
+### Einheitskreis
+
+TODO (auch Polarkoordinaten-Zeug und n-te Wurzel)
+
+# Folgen und ihre Grenzwerte
+
+\begin{center}\fbox{\parbox{12cm}{\centering Ab hier ist stets $K \in \{ \R,\C \}$}}\end{center}
+
+---
+
+Eine **Folge** in $K$ ist eine Abbildung $$\alpha: \N \to K.$$ Durch ihre Funktionswerte $\alpha_n = \alpha(n)$ mit $n\in\N$ ist diese eindeutig festgelegt. Deshalb schreibt man statt $\alpha: \N \to K$ häufig nur $(a_n)_{n\in\N}$ oder $(a_0,a_1,a_2,...)$.
+
+---
+
+## Konstante Folgen
+
+Mit $c \in K$ heißt $\alpha: \N \to K : n \mapsto c$ bzw. $a_n = c$ mit $n\in\N$ eine **konstante Folge**.
+
+Beispiel mit $(a_n)_{n\in\N} = (2)_{n\in\N}$:
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=0,ymin=-1,ymax=4,ytick distance=1]
+\addplot[black,mark=*] coordinates {(0,2)} {};
+\addplot[black,mark=*] coordinates {(1,2)} {};
+\addplot[black,mark=*] coordinates {(2,2)} {};
+\addplot[black,mark=*] coordinates {(3,2)} {};
+\addplot[black,mark=*] coordinates {(4,2)} {};
+\addplot[black,mark=*] coordinates {(5,2)} {};
+\end{axis}
+\end{tikzpicture}\end{center}
+
+## Konvergenz und Grenzwert
+
+Mit der Folge $(a_n)_{n\in\N}$ in $K$ und $a \in K$ gilt:
+$a$ ist genau dann ein **Grenzwert** von $(a_n)_{n\in\N}$, wenn $$\forall \varepsilon > 0,\ \varepsilon \in \R: \exists n_\varepsilon\in\N: \forall n \geq n_\varepsilon: |a_n - a| < \varepsilon.$$
+In diesem Fall sagt man, dass $(a_n)_{n\in\N}$ **gegen $\alpha$ konvergiert** und schreibt $$\lim_{n\to\infty} a_n = a \text{ oder } a_n \to a.$$
+Wenn es kein $a \in K$ gibt, so dass $(a_n)_{n\in\N}$ gegen $a$ konvergiert, nennt man $(a_n)_{n\in\N}$ **divergent**.
+
+Falls eine Folge $(a_n)_{n\in\N}$ in $K$ gegen $0$ konvergiert, nennt man $(a_n)_{n\in\N}$ eine **Nullfolge**.
+
+Hilfreiche Umformung: $$a_n \to a \iff a_n - a \to 0 \iff |a_n - a| \to 0.$$
+
+TODO: Vorgehen mit abschätzen usw. (auch bei Cauchy)
+
+Beispiel: **Epsilon-Schlauch**
+
+\includesvg{assets/schlauch}
+
+Mit einem $\varepsilon > 0$ gibt es also einen Mindestindex $n_\varepsilon$, sodass sich ab diesem Index die Folge im Epsilon-Schlauch $(a-\varepsilon,a+\varepsilon)$ befindet. Die Folge ist konvergent, falls dies auch für jedes andere $\varepsilon > 0$ gilt.
+
+### Geometrische Folge
+
+Mit $q \in K$ und $|q| < 1$, ist $(q^n)_{n\in\N}$ eine Nullfolge.
+
+## Beschränkte Folgen
+
+Eine Folge $(a_n)_{n\in\N}$ in $K$ heißt **beschränkt**, wenn die Menge $$\{ |a_n| \in \R\ \vert\ n\in\N \}$$ beschränkt ist, d.h. wenn es eine Zahl $s\in\R$ gibt, sodass $|a_n| \leq s$ für alle $n\in\N$.
+
+- Jede konvergente Folge in $K$ ist beschränkt.
+- Ist $(a_n)_{n\in\N}$ eine Nullfolge in $K$ und $(b_n)_{n\in\N}$ eine beschränkte Folge in $K$, so ist $(a_n \cdot b_n)_{n\in\N}$ eine Nullfolge.
+
+## Grenzwertsätze und Konvergenzkriterien
+
+Mit den konvergenten Folgen $(a_n)_{n\in\N}$ und $(b_n)_{n\in\N}$ in $K$ mit $a_n \to a$ und $b_n \to b$ gilt:
+
+- $a_n + b_n \to a + b$ und $a_n - b_n \to a - b$
+- $a_n \cdot b_n \to a \cdot b$
+- $|a_n| \to |a|$
+- Wenn $b \neq 0$, so gibt es ein $n_0\in\N$ mit $b_n \neq 0$ für alle $n \geq n_0$ und die Folge $\left(\frac{a_n}{b_n}\right)_{n \geq n_0}$ ist konvergent mit $$\frac{a_n}{b_n} \to \frac{a}{b}.$$
+- Ist $(a_n)_{n\in\N}$ im abgeschlossenen Intervall $[a,b]$, so gilt $\lim_{n\to\infty} a_n \in [a,b]$.
+
+### Einschachtelungssatz
+
+Mit den konvergenten Folgen $(a_n)_{n\in\N}$, $(b_n)_{n\in\N}$ und $(c_n)_{n\in\N}$ in $\R$ mit $a_n \to a$ und $b_n \to b$ gilt:
+
+- Ist $a_n \leq b_n$ für alle $n \geq n_0$, so ist $a \leq b$.
+- Ist $a_n \leq c_n \leq b_n$ für alle $n \geq n_0$ und ist a = b, so gilt $c_n \to a$.
+
+## Monotonie
+
+$(a_n)_{n\in\N}$ ist eine Folge in $\R$. Man nennt $(a_n)_{n\in\N}$ **monoton wachsend**, falls $$\forall n\in\N: a_n \leq a_{n+1}.$$
+Analog nennt man $(a_n)_{n\in\N}$ **monoton fallend**, falls $$\forall n\in\N: a_n \geq a_{n+1}.$$
+
+**Monotoniekriterium**: Jede monoton wachsende oder fallende beschränkte Folge in $\R$ ist konvergent.
+
+## Supremum und Infimum
+
+Mit der nicht-leeren Menge $A \subset \R$ gilt:
+
+- Ist $A$ nach oben beschränkt, so gibt es eine monoton wachsende Folge $(a_n)_{n\in\N}$ in $A$, die gegen $\sup(A)$ konvergiert.
+- Ist $A$ nach unten beschränkt, so gibt es eine monoton fallende Folge $(a_n)_{n\in\N}$ in $A$, die gegen $\inf(A)$ konvergiert.
+
+TODO: Heron-Verfahren verstehen
+
+## Der Satz von Bolzano-Weierstraß
+
+Mit der Folge $(a_n)_{n\in\N}$ in $K$ und der in $\N$ aufsteigenden Folge $n_0 < n_1 < n_2 < n_3 < ...$, ist $$(a_{n_k})_{k\in\N} = (a_{n_0}, a_{n_1}, a_{n_2}, a_{n_3}, ...)$$ eine **Teilfolge** von $(a_n)_{n\in\N}$.
+
+Jede beschränkte Folge in $K$ besitzt eine konvergente Teilfolge.
+
+Beispiel: Die divergente beschränkte Folge $((-1)^n)_{n\in\N}$ besitzt als konvergente Teilfolge die konstante Folge $((-1)^{2k})_{k\in\N} = (1)_{k\in\N}$
+
+## Cauchy-Kriterium
+
+Eine Folge $(a_n)_{n\in\N}$ in $K$ heißt **Cauchy-Folge**, falls $$\forall \varepsilon > 0,\ \varepsilon \in \R:\ \exists n_\varepsilon \in \N: \forall m > n \geq n_\varepsilon: |a_m - a_n| < \varepsilon.$$ Sprich, eine Folge, bei der der Abstand beliebiger Folgenglieder ab einem bestimmten $n_\varepsilon$ immer kleiner als $\varepsilon$ ist.
+
+- Eine Folge in $K$ ist (konvergent $\iff$ eine Cauchy-Folge).
+- Eine Cauchy-Folge rationaler Zahlen muss in $\Q$ nicht konvergent sein, d.h. ihr Grenzwert in $\R$ muss keine rationale Zahl sein.
+
+Beispiel: **Konvergente/Cauchy Folge**
+
+\includesvg{assets/folge}
+
+## Bestimmte Divergenz
+
+Mit der Folge $(a_n)_{n\in\N}$ in $\R$ gilt:
+
+- $(a_n)_{n\in\N}$ **divergiert bestimmt gegen $\infty$**, falls $$\forall s > 0: \exists n_s\in\N: \forall n \geq n_s: a_n > s.$$ Man nennt $\lim_{n\to\infty} a_n = \infty$ dann auch den uneigentlichen **Grenzwert** von $(a_n)_{n\in\N}$.
+- $(a_n)_{n\in\N}$ **divergiert bestimmt gegen $-\infty$**, falls $$\forall s > 0: \exists n_s\in\N: \forall n \geq n_s: a_n < s.$$ Man nennt $\lim_{n\to\infty} a_n = -\infty$ dann auch den uneigentlichen **Grenzwert** von $(a_n)_{n\in\N}$.
+
+Beispiel: Die Folge $(n)_{n\in\N}$ ist bestimmt divergent mit Grenzwert $\infty$, die Folge $((-1)^n \cdot n)_{n\in\N}$ ist divergent, aber nicht bestimmt divergent.
+
+## Landau-Symbole
+
+TODO?
+
+# Unendliche Reihen
+
+---
+
+Mit der Folge $(a_n)_{n\in\N}$ in $K$, ist die Folge $(s_n)_{n\in\N}$ mit der Summe der **Partialsummen** von $(a_n)_{n\in\N}$ auch die durch $(a_n)_{n\in\N}$ definierte **Reihe** $$s_n = \sum_{k=0}^n a_k.$$
+
+Die Reihe heißt **konvergent**, wenn $(s_n)_{n\in\N}$ eine konvergente Folge ist, andernfalls heißt sie **divergent**.
+
+---
+
+## Teleskopsumme
+
+Die Reihe $\sum_{n=1}^\infty \frac{1}{n(n+1)}$ ist konvergent mit Grenzwert $\sum_{n=1}^\infty \frac{1}{n(n+1)} = 1$:
+
+<!-- prettier-ignore -->
+\begin{displaymath}\begin{split}
+s_n &= \sum_{k=1}^n \frac{1}{k(k+1)} = \sum_{k=1}^n \frac{1}{k} - \frac{1}{k+1} \\
+&= \left(\frac{1}{1} - \frac{1}{2}\right) + \left(\frac{1}{2} - \frac{1}{3}\right) + \left(\frac{1}{3} - \frac{1}{4}\right) + ... + \left(\frac{1}{n} - \frac{1}{n+1}\right) \\
+&= 1 - \frac{1}{n+1} \to 1.
+\end{split}\end{displaymath}
+
+Reihen, die sich auf zwei Summanden reduzieren, weil sich die übrigen Teile der Summe auslöschen, nennt man **Teleskopsummen**.
+
+## Harmonische Reihe
+
+<!-- prettier-ignore -->
+Die Reihe $\sum_{n=1}^\infty \frac{1}{n}$ ist **divergent**. Die Reihe $\sum_{n=1}^\infty \frac{1}{n^{1+\varepsilon}}$ mit $\varepsilon > 0$ **konvergiert**.
+
+## Grenzwertsätze
+
+Mit den konvergenten Reihen $\sum_{n=0}^\infty a_n$ und $\sum_{n=0}^\infty b_n$ in $K$ und $a \in K$ gilt:
+
+- $\sum_{n=0}^\infty (a_n + b_n) = \sum_{n=0}^\infty a_n + \sum_{n=0}^\infty b_n$ ist konvergent.
+- $\sum_{n=0}^\infty (a_n - b_n) = \sum_{n=0}^\infty a_n - \sum_{n=0}^\infty b_n$ ist konvergent.
+- $\sum_{n=0}^\infty (a \cdot b_n) = a \cdot \sum_{n=0}^\infty a_n$ ist konvergent.
+- Mit $\forall n\in\N: a_n \leq b_n$ und $K = \R$: $\sum_{n=0}^\infty a_n \leq \sum_{n=0}^\infty b_n$.
+
+## Konvergenzkriterien für unendliche Reihen
+
+### Cauchy-Kriterium
+
+Mit der Reihe $\sum_{n=0}^\infty a_n$ in $K$ ist genau dann $\sum_{n=0}^\infty a_n$ konvergent, wenn $$\forall \varepsilon > 0: \exists n_\varepsilon\in\N: \forall m > n \geq n_\varepsilon: \left| \sum_{k=n+1}^m a_k \right| < \varepsilon.$$
+
+### Restglieder
+
+Wenn die Reihe $\sum_{k=0}^\infty a_k$ konvergent ist, so ist die Folge der Restglieder eine Nullfolge, d.h. $$\lim_{n\to\infty} \sum_{k=n}^\infty a_k = 0.$$
+
+### Nullfolgekriterium
+
+Ist $\sum_{n=0}^\infty a_n$ eine konvergente Reihe in $K$, so ist $(a_n)_{n\in\N}$ eine Nullfolge.
+
+### Geometrische Reihe
+
+Mit $q \in K$ gilt:
+
+- Ist $|q| < 1$, so ist die **geometrische Reihe** $\sum_{n=0}^\infty q^n$ konvergent mit Grenzwert $$\sum_{n=0}^\infty q^n = \frac{1}{1-q}.$$
+- Ist $|q| \geq 1$, so ist die **geometrische Reihe** $\sum_{n=0}^\infty q^n$ divergent.
+
+### Leibniz-Kriterium
+
+ist $(a_n)_{n\in\N}$ eine monoton fallende Nullfolge in $\R$, so konvergiert die Reihe $$\sum_{n=0}^\infty (-1)^n \cdot a_n.$$
+Demnach ist auch die alternierende harmonische Reihe $\sum_{n=1}^\infty \frac{(-1)^n}{n}$ konvergent.
+
+### Umklammern
+
+TODO: Verstehen und Beispiele
+
+Mit der konvergenten Reihe $\sum_{n=0}^\infty a_n$ in $K$ und der aufsteigenden Folge $0 = k_0 < k_1 < k_2 < ...$ in $\N$, sowie mit $$b_n = \sum_{k=k_n}^{k_{n+1}-1} a_k = a_{k_n} + a_{k_{n+1}} + ... + a_{k_{n+1}-1}$$ ist die Reihe $\sum_{n=0}^\infty b_n$ konvergent und es gilt $$\sum_{n=0}^\infty a_n = \sum_{n=0}^\infty b_n.$$
+
+## Absolute Konvergenz
+
+Eine Reihe $\sum_{n=0}^\infty a_n$ in $K$ heißt **absolut konvergent**, wenn die Reihe ihrer **Absolut**beträge $\sum_{n=0}^\infty |a_n|$ konvergiert. Da die Folge der Partialsummen $t_n = \sum_{k=0}^n |a_k|$ monoton wächst, ist dies gleichwertig dazu, dass die Folge $(t_n)_{n\in\N}$ beschränkt ist.
+
+Ist die Reihe $\sum_{n=0}^\infty a_n$ in $K$ absolut konvergent, so ist sie auch konvergent.
+
+Beispiel: Die alternierende harmonische Reihe ist konvergent, aber nicht absolut konvergent.
+
+### Umordnung
+
+TODO: Verstehen und Beispiele
+
+Mit der Folge $(a_n)_{n\in\N}$ in $K$ und der bijektiven Abbildung $\sigma: \N \to \N$ nennt man die Folge $$(a_{\sigma(n)})_{n\in\N} = (a_{\sigma(0)},a_{\sigma(1)},a_{\sigma(2)},a_{\sigma(3)},a_{\sigma(4)},...)$$ eine **Umordnung** von $(a_n)_{n\in\N}$ und die Reihe $$\sum_{n=0}^\infty a_{\sigma(n)} = a_{\sigma(0)}+a_{\sigma(1)}+a_{\sigma(2)}+a_{\sigma(3)}+a_{\sigma(3)}+...$$ eine **Umordnung** der Reihe $\sum_{n=0}^\infty a_n$.
+
+Durch Umordnung einer konvergenten Reihe kann sich der Grenzwert ändern. Jede Umordnung einer absolut konvergenten Reihe ist absolut konvergent und konvergiert gegen den gleichen Grenzwert.
+
+## Konvergenzkriterien für absolute Konvergenz
+
+### Majorantenkriterium
+
+Mit den Reihen $\sum_{n=0}^\infty a_n$ und $\sum_{n=0}^\infty b_n$ in $K$ gilt:
+
+Ist $\sum_{n=0}^\infty b_n$ absolut konvergent und $\forall n \geq n_0: |a_n| \leq |b_n|$, so ist auch $\sum_{n=0}^\infty a_n$ absolut konvergent.
+
+$\sum_{n=0}^\infty b_n$ ist dann eine konvergente **Majorante** von $\sum_{n=0}^\infty a_n$.
+
+### Minorantenkriterium
+
+Mit den Reihen $\sum_{n=0}^\infty a_n$ und $\sum_{n=0}^\infty b_n$ in $\R$ gilt:
+
+Ist $\sum_{n=0}^\infty b_n$ divergent und $\forall n\in\N: |a_n| \geq |b_n| \geq 0$, so ist auch $\sum_{n=0}^\infty a_n$ divergent.
+
+$\sum_{n=0}^\infty b_n$ ist dann eine divergente **Minorante** von $\sum_{n=0}^\infty a_n$.
+
+### Wurzelkriterium
+
+Mit der Reihe $\sum_{n=0}^\infty a_n$ in $K$ gilt:
+
+- Existiert ein $q < 1$ mit $\sqrt[n]{|a_n|} \leq q$ für $n \geq n_0$, so ist $\sum_{n=0}^\infty a_n$ absolut konvergent.
+- Ist $\forall n \geq n_0: \sqrt[n]{|a_n|} \geq 1$, so ist $\sum_{n=0}^\infty a_n$ divergent.
+
+### Quotientenkriterium
+
+Mit der Reihe $\sum_{n=0}^\infty a_n$ in $K$ und $\forall n \geq n_0: a_n \neq 0$ gilt:
+
+- Existiert ein $q < 1$ mit $\left| \frac{a_{n+1}}{a_n} \right| \leq q$ für $n \geq n_0$, so ist $\sum_{n=0}^\infty a_n$ absolut konvergent.
+- Ist $\forall n \geq n_0: \left| \frac{a_{n+1}}{a_n} \right| \geq 1$, so ist $\sum_{n=0}^\infty a_n$ divergent.
+
+### Praktikables Quotienten-/Wurzelkriterium
+
+Mit der Reihe $\sum_{n=0}^\infty a_n$ in $K$ und $\forall n \geq n_0: a_n \neq 0$ gilt:
+
+- Falls $\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n} \right| < 1$ oder $\lim_{n\to\infty} \sqrt[n]{|a_n|} < 1$, so ist $\sum_{n=0}^\infty a_n$ absolut konvergent.
+- Falls $\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n} \right| > 1$ oder $\lim_{n\to\infty} \sqrt[n]{|a_n|} > 1$, so ist $\sum_{n=0}^\infty a_n$ divergent.
+- Falls $\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n} \right| = 1$ oder $\lim_{n\to\infty} \sqrt[n]{|a_n|} = 1$, so wird für $\sum_{n=0}^\infty a_n$ keine Aussage getroffen.
+
+### Cauchy-Produkt
+
+TODO: Verstehen und Beispiele.
+
+Mit den absolut konvergenten Reihen $\sum_{n=0}^\infty a_n$ und $\sum_{n=0}^\infty b_n$ in $K$, sowie mit $$c_n = \sum_{k=0}^n a_k \cdot b_{n-k} = \sum_{i + j = n} a_i \cdot b_j.$$ für $n\in\N$, so ist ist die Reihe $\sum_{n=0}^\infty c_n$ absolut konvergent und es gilt $$\sum_{n=0}^\infty c_n = \sum_{n=0}^\infty a_n \cdot \sum_{n=0}^\infty b_n.$$
+
+## Potenzreihen
+
+Mit der Folge $(a_n)_{n\in\N}$ in $K$, $a \in K$ und der Variable $t$ gilt: Ein Ausdruck der Form $\sum_{n=0}^\infty a_n \cdot (t-a)^n$ eine **Potenzreihe** über $K$ in der Variable $t$ mit **Entwicklungspunkt** $a$. Mit $a=0$ schreibt man auch $\sum_{n=0}^\infty a_n \cdot t^n$.
+
+---
+
+Wenn mit der Folge $(a_n)_{n\in\N}$ in $K$ und $y \in K$ die Reihe $\sum_{n=0}^\infty a_n \cdot y^n$ konvergiert, so ist die Reihe $\sum_{n=0}^\infty a_n \cdot x^n$ absolut konvergent für alle $x \in K$ mit $|x| < |y|$.
+
+### Konvergenzradius
+
+Für eine Potenzreihe $\sum_{n=0}^\infty a_n \cdot t^n$ über $K$ nennt man $$r = \sup \left\{ |y|\ \Bigg\vert\ y \in K,\ \sum_{n=0}^\infty a_n \cdot y^n \text{ ist konvergent} \right\} \in \R_{\geq 0} \cup \{ \infty \}$$ den **Konvergenzradius** der Potenzreihe. Sprich: Für welche $t$ konvergiert die Potenzreihe?
+
+Mit der Potenzreihe $\sum_{n=0}^\infty a_n \cdot t^n$ über $K$ mit Konvergenzradius $r$ gilt:
+
+- Ist $x \in K$ mit $|x| < r$, so ist $\sum_{n=0}^\infty a_n \cdot x^n$ absolut konvergent.
+- Ist $x \in K$ mit $|x| > r$, so ist $\sum_{n=0}^\infty a_n \cdot x^n$ divergent.
+- Ist $x \in K$ mit $|x| = r$, so ist $x$ der **Rand** des Konvergenzbereiches und es wird keine Aussage getroffen.
+- Ist $r = \infty$, so ist $\sum_{n=0}^\infty a_n \cdot x^n$ für alle $x \in K$ absolut konvergent.
+
+Mit $U_r(0) = \{ x \in K\ \vert\ |x| < r \}$ definiert die Potenzreihe eine Abbildung, die auch **Konvergenzbereich** der Potenzreihe genannt wird: $$U_r(0) \to K: x \mapsto \sum_{n=0}^\infty a_n \cdot x^n$$
+Ist $K = \R$, so ist die Menge $U_r(0) = (-r,r)$ ein offenes Intervall. Ist $K = \C$, so ist die Menge $U_r(0)$ ein Kreis mit Radius $r$ um den Ursprung.
+
+TODO: Beispiele
+
+### Cauchy-Hadamard
+
+Mit der Potenzreihe $\sum_{n=0}^\infty a_n \cdot t^n$ über $K$ gilt:
+
+- Falls der eigentliche oder uneigentliche Grenzwert $\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n} \right| \in \R_{\geq 0} \cup \{ \infty \}$ existiert, so ist der Konvergenzradius von $\sum_{n=0}^\infty a_n \cdot t^n$ gegeben durch $$r = \frac{1}{\lim_{n\to\infty} \left| \frac{a_{n+1}}{a_n} \right|}.$$
+- Falls der eigentliche oder uneigentliche Grenzwert $\lim_{n\to\infty} \sqrt[n]{|a_n|} \in \R_{\geq 0} \cup \{ \infty \}$ existiert, so ist der Konvergenzradius von $\sum_{n=0}^\infty a_n \cdot t^n$ gegeben durch $$r = \frac{1}{\lim_{n\to\infty} \sqrt[n]{|a_n|}}.$$
+
+### Exponentialfunktion
+
+Die Potenzreihe $\sum_{n=0}^\infty \frac{t^n}{n!}$ über $K$ hat den Konvergenzradius $r = \infty$. Die Dadurch definierte Abbildung $$\exp: K \to K: x \mapsto \exp(x) = \sum_{n=0}^\infty \frac{x^n}{n!}$$ nennt man die **Exponentialfunktion**. Sie genügt der **Funktionalgleichung** $$\exp(x+y) = \exp(x) \cdot exp(y)$$ für $x,y \in K$.
+
+Außerdem gilt $e^x = \exp(x)$, $e = \sum_{n=0}^\infty \frac{1}{n!}$ und damit mit den Potenzgesetzen auch $e^{x+y} = e^x \cdot e^y$.
+
+### Sinus und Cosinus
+
+TODO: Oder später dann?
+
+### $b$-adische Zahldarstellung
+
+TODO: Relevant?
+
+# Grenzwerte von Funktionen
+
+## $\varepsilon$-Umgebung
+
+Mit $\varepsilon > 0$ und $a\in\R$ heißt das Intervall $$U_\varepsilon = (a - \varepsilon, a + \varepsilon) = \{ x\in\R\ \vert\ |x - a| < \varepsilon \}$$ die **$\varepsilon$-Umgebung** von $a$.
+
+## Häufungspunkte
+
+- Mit der Teilmenge $U\subset\R$ und $a\in\R$ nennt man $a$ einen **Häufungspunkt** von $U$, wenn $$\forall \varepsilon > 0: \exists x \in U \setminus \{ a \}: 0 < |x - a| < \varepsilon.$$
+- $a\in\R$ ist genau dann ein Häufungspunkt von $U\subset\R$, wenn jede $\varepsilon$-Umgebung von $a$ einen von $a$ verschiedenen Punkt aus $U$ enthält. TODO: Verstehen
+- $a\in\R$ ist genau dann ein Häufungspunkt von $U\subset\R$, wenn es eine Folge $(a_n)_{n\in\N}$ mit $a_n \in U \setminus \{ a \}$ und $lim_{n\to\infty} a_n = a$ gibt, d.h. $a$ ist Grenzwert einer Folge in $U \setminus \{ a \}$.
+
+Beispiel mit der Folge $(-1)^n \cdot \frac{n}{n+1}$ in $\R$ mit den zwei Häufungspunkten $+1$ und $-1$:
+
+\begin{center}
+\includesvg[width=15cm]{assets/haeufungspunkt}
+\end{center}
+
+## $\varepsilon$-$\delta$-Kriterium
+
+Mit $U\subset\R$, der Funktion $f: U\to\R$ und dem Häufungspunkt $a$ von $U$, ist $y\in\R$ der **Grenzwert** von $f$ in $a$, falls $$\forall \varepsilon > 0: \exists \delta_\varepsilon > 0: \forall x \in U \text{ mit } 0 < |x - a| < \delta_\varepsilon \text{ gilt } |f(x) - y| < \varepsilon.$$ Man schreibt dann $$\lim_{x \to a} f(x) = y$$ und sagt, $f(x)$ **konvergiert** gegen $y$ für $x$ gegen $a$.
+
+\begin{center}\begin{tikzpicture}[holdot/.style={circle,draw,fill=white,inner sep=1pt}]
+\draw[line width=4mm,blue!30] (3,0)--(3,4);
+\draw[very thick,red!80!pink,dashed] (2.8,0) -- (2.8,4);
+\draw[double distance=4mm,very thick,double=orange,red!80!pink] (0,4) -- (5,4);
+\draw[very thick,red!80!pink,dashed] (3.2,0) -- (3.2,4.2);
+\draw[thick,-latex] (-2,0) -- (6,0);
+\draw[thick,-latex] (0,-1) -- (0,6);
+\draw[very thick,blue!50!cyan] (-0.8,0.2) -- (3.5,4.5) to[out=45,in=135]
+node[pos=0.5,above,font=\large]{$f(x) \to y \text{ für } x \to a$} (5,4.5);
+\draw[very thick,dashed] (0,4) node[left] (L) {$y$} -| (3,0) node[below] (x0) {$a$};
+\draw[very thick,blue!50!cyan,fill=white] (3,4) circle[radius=2pt];
+\draw (L) -- ++(120:0.7) node[above] {$y+\varepsilon$}
+(L) -- ++(-120:0.7) node[below] {$y-\varepsilon$}
+(x0) -- ++(-45:0.7) node[below right] {$a+\delta$}
+(x0) -- ++(-135:0.7) node[below left] {$a-\delta$};
+\end{tikzpicture}\end{center}
+
+## Folgenkriterium
+
+Mit $U\subset\R$, der Funktion $f: U\to\R$ und dem Häufungspunkt $a$ (inkl. bestimmte Divergenz mit $\pm\infty$) von $U$ gilt:
+$$\lim_{x \to a} f(x) = y \iff \forall (a_n)_{n\in\N},\ a_n \in U \setminus \{ a \},\ \lim_{n\to\infty} f(a_n) = a: \lim_{n\to\infty} f(a_n) = y.$$
+
+Beispiel mit $f: \R\to\R: x \mapsto x^2$ und $a = 3$. Für eine Folge $(a_n)_{n\in\N}$ mit $a_n \to 3$ gilt dann wegen der Grenzwertsätze für Folgen $$\lim_{n\to\infty} f(a_n) = a^2_n = a_n \cdot a_n \to 3 \cdot 3 = 9.$$ Demnach gilt auch $$\lim_{x \to 3} x^2 = 9 = f(3).$$
+
+TODO: Visualisierung und Verständnis
+
+## Grenzwertsätze
+
+Mit den Funktionen $f: U\to\R$, $g: U\to\R$, dem Häufungspunkt $a$ (inkl. bestimmte Divergenz mit $\pm\infty$) von $U$ und $c\in\R$ gilt:
+
+- Der Grenzwert von $f$ in $a$ ist eindeutig bestimmt, d.h. falls $\lim_{x \to a} f(x) = y$ und $\lim_{x \to a} f(x) = z$, so ist $y = z$. TODO: Verstehen
+- Wenn $\lim_{x \to a} f(x)$ und $\lim_{x \to a} g(x)$ existieren, so gelten:
+ - $\lim_{x \to a}(c \cdot f)(x) = c \cdot \lim_{x \to a} f(x).$
+ - $\lim_{x \to a}(f + g)(x) = \lim_{x \to a} f(x) + \lim_{x \to a} g(x).$
+ - $\lim_{x \to a}(f - g)(x) = \lim_{x \to a} f(x) - \lim_{x \to a} g(x).$
+ - $\lim_{x \to a}(f \cdot g)(x) = \lim_{x \to a} f(x) \cdot \lim_{x \to a} g(x).$
+- Wenn außerdem $\lim_{x \to a} f(x) \neq 0$, so ist $a$ ein Häufungspunkt der Menge $V = \{ x \in U\ \vert\ f(x) \neq 0 \}$ und es gilt $$\lim_{x \to a} \frac{1}{f}(x) = \frac{1}{\lim_{x \to a} f(x)}.$$
+
+## Polynome
+
+Mit der Variable $t$ und $a_0, ..., a_n \in \R$ ist ein Ausdruck der Form $$\sum_{k=0}^n a_k \cdot t^k = a_n \cdot t^n + a_{n-1} \cdot t^{n-1} + ... + a_1 \cdot t + a_0$$ ein **Polynom** in der Variable $t$ mit Koeffizienten in $\R$. Ist $a_n \neq 0$, so heißt $$\deg \left( \sum_{k=0}^n a_k \cdot t^k \right) = n$$ der **Grad** des Polynoms. Außerdem ist $\deg(0) = -\infty$. Mit $$\R[t] = \left\{ \sum_{k=0}^n a_k \cdot t^k\ \Bigg\vert\ n\in\N,\ a_0,...,a_n \in \R \right\}$$ wird die Menge aller Polynome in der Variable $t$ mit Koeffizienten in $\R$ bezeichnet, so dass der Grad eine Abbildung $\deg: \R[t] \to \N \cup \{ -\infty \}$ ist.
+
+Für ein Polynom $f = \sum_{k=0}^n a_k \cdot t^k \in \R[t]$ und ein $x\in\R$ ist $$f(x) = \sum_{k=0}^n a_k \cdot x^k.$$ Sind $f,g\in\R[t]$ zwei Polynome, $g \neq 0$ nicht das Nullpolynom, so ist die Funktion $$f: \R\to\R: x \mapsto f(x)$$ eine **Polynomfunktion** und die Funktion $$\frac{f}{g}: \R \setminus \{ x\in\R\ \vert\ g(x) = 0 \} \to \R: x \mapsto \frac{f(x)}{g(x)}$$ eine **rationale Funktion**.
+
+Ist $h: \R\to\R$ irgendeine Funktion, so ist $x\in\R$ mit $h(x) = 0$ eine **Nullstelle** von $h$.
+
+Es gilt: $$|\{ x\in\R\ \vert\ g(x) = 0 \}| \leq \deg(g) < \infty.$$
+
+## Uneigentliche Grenzwerte
+
+Mit $U\subset\R$, $f: U\to\R$ und $y\in\R$ gilt:
+
+- $U$ ist **nach oben/unten** beschränkt, wenn die Menge $U \cap [0,\infty)$ bzw. $U \cap (-\infty, 0]$ nicht beschränkt ist.
+- Ist $U$ ist nach oben beschränkt, so ist $y$ der **Grenzwert** von $f$ in $\infty$, wenn $$\forall \varepsilon > 0:\ \exists s_\varepsilon > 0: \forall x \in U \text{ mit } x > s_\varepsilon \text{ gilt } |f(x) - y| < \varepsilon.$$ Man schreibt dann $\lim_{x\to\infty} f(x) = y$.
+- Ist $U$ ist nach unten beschränkt, so ist $y$ der **Grenzwert** von $f$ in $\infty$, wenn $$\forall \varepsilon > 0:\ \exists s_\varepsilon < 0: \forall x \in U \text{ mit } x < s_\varepsilon \text{ gilt } |f(x) - y| < \varepsilon.$$ Man schreibt dann $\lim_{x\to\infty} f(x) = y$.
+
+TODO: Visualisierung (bzw. Wiederholung mergen?)
+
+### Definition
+
+Mit $U\subset\R$, $f: U\to\R$ und dem Häufungspunkt $a$ von $U$ gilt:
+
+- $\infty$ ist der **uneigentliche Grenzwert** von $f$ in $a$, wenn $$\forall s > 0: \exists \delta_s > 0: \forall x \in U \text{ mit } 0 < |x - a| < \delta_s \text{ gilt } f(x) > s.$$ Man schreibt dann $\lim_{x \to a} f(x) = \infty$.
+- $-\infty$ ist der **uneigentliche Grenzwert** von $f$ in $a$, wenn $$\forall s < 0: \exists \delta_s > 0: \forall x \in U \text{ mit } 0 < |x - a| < \delta_s \text{ gilt } f(x) < s.$$ Man schreibt dann $\lim_{x \to a} f(x) = -\infty$.
+- Ist $U$ nach oben unbeschränkt, so ist $\infty$ ist der **uneigentliche Grenzwert** von $f$ in $\infty$, wenn $$\forall s > 0: \exists t > 0: \forall x \in U \text{ mit } x > t \text{ gilt } f(x) > s.$$ Man schreibt dann $\lim_{x \to \infty} f(x) = \infty$.
+- Ist $U$ nach oben unbeschränkt, so ist $-\infty$ ist der **uneigentliche Grenzwert** von $f$ in $\infty$, wenn $$\forall s < 0: \exists t > 0: \forall x \in U \text{ mit } x > t \text{ gilt } f(x) < s.$$ Man schreibt dann $\lim_{x \to \infty} f(x) = -\infty$.
+- Ist $U$ nach unten unbeschränkt, so ist $\infty$ ist der **uneigentliche Grenzwert** von $f$ in $-\infty$, wenn $$\forall s > 0: \exists t < 0: \forall x \in U \text{ mit } x < t \text{ gilt } f(x) > s.$$ Man schreibt dann $\lim_{x \to \infty} f(x) = \infty$.
+- Ist $U$ nach unten unbeschränkt, so ist $-\infty$ ist der **uneigentliche Grenzwert** von $f$ in $-\infty$, wenn $$\forall s < 0: \exists t < 0: \forall x \in U \text{ mit } x < t \text{ gilt } f(x) < s.$$ Man schreibt dann $\lim_{x \to \infty} f(x) = -\infty$.
+
+TODO: Visualisierung
+
+# Stetigkeit
+
+## $\varepsilon$-$\delta$-Kriterium
+
+Mit $U\subset\R$, der Funktion $f: U\to\R$ und $a \in U$, ist $f$ **stetig in $a$**, wenn $$\forall \varepsilon > 0: \exists \delta_\varepsilon > 0: \forall x \in U \text{ mit } |x - a| < \delta_\varepsilon \text{ gilt } |f(x) - f(a)| < \varepsilon.$$
+Die Funktion $f$ heißt **stetig** (auf $U$), wenn sie stetig in jedem Punkt in $U$ ist. $\mathcal{C}(U,\R) = \{ f: U \to \R\ \vert\ f \text{ stetig } \}$ ist die Menge der auf $U$ stetigen Funktionen.
+
+\begin{center}\begin{tikzpicture}[holdot/.style={circle,draw,fill=white,inner sep=1pt}]
+\draw[line width=4mm,blue!30] (3,0)--(3,4);
+\draw[very thick,red!80!pink,dashed] (2.8,0) -- (2.8,4);
+\draw[double distance=4mm,very thick,double=orange,red!80!pink] (0,4) -- (5,4);
+\draw[very thick,red!80!pink,dashed] (3.2,0) -- (3.2,4.2);
+\draw[thick,-latex] (-2,0) -- (6,0);
+\draw[thick,-latex] (0,-1) -- (0,6);
+\draw[very thick,blue!50!cyan] (-0.8,0.2) -- (3.5,4.5) to[out=45,in=135]
+node[pos=0.5,above,font=\large]{$f(x)$} (5,4.5);
+\draw[very thick,dashed] (0,4) node[left] (L) {$f(a)$} -| (3,0) node[below] (x0) {$a$};
+\draw[very thick,blue!50!cyan,fill=white] (3,4) circle[radius=2pt];
+\draw (L) -- ++(120:0.7) node[above] {$f(a)+\varepsilon$}
+(L) -- ++(-120:0.7) node[below] {$f(a)-\varepsilon$}
+(x0) -- ++(-45:0.7) node[below right] {$a+\delta$}
+(x0) -- ++(-135:0.7) node[below left] {$a-\delta$};
+\end{tikzpicture}\end{center}
+
+Da die Stetigkeit sich immer nur auf eine $\varepsilon$-Umgebung von $a$ bezieht, ist Stetigkeit eine _lokale_ Eigenschaft.
+
+## Stetigkeit in Häufungspunkten
+
+Mit $U\subset\R$, $f: U\to\R$ und dem Häufungspunkt $a \in U$, gilt:
+$$f \text{ ist stetig in } a \iff \lim_{x \to a} f(x) = f(a).$$
+
+Beispiel mit $f: \R\to\R: x \mapsto \begin{cases} x & \text{falls $x < 1$} \\ x + 1 & \text{falls $x \ge 1$} \end{cases}$
+
+<!-- prettier-ignore -->
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines = center]
+\addplot[domain=-5:1,color=black]{x};
+\addplot[domain=1:5,color=black]{x + 1};
+\end{axis}
+\end{tikzpicture}\end{center}
+
+$f$ ist in $1$ nicht stetig, da $\lim_{x \to 1} f(x) = 1 \neq 2 = f(1)$.
+
+Beispiel mit $f: \R\to\R: x \mapsto |x|$
+
+<!-- prettier-ignore -->
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines = center]
+\addplot[domain=-5:0,color=black]{abs(x)};
+\addplot[domain=0:5,color=black]{x};
+\end{axis}
+\end{tikzpicture}\end{center}
+
+$f$ ist in $0$ stetig, da $\lim_{x \to 0} f(x) = 0 = f(0)$.
+
+Die Betragsfunktion ist außerdem im Allgemeinen stetig, da aufgrund der Grenzwertsätze für Folgen für $a\in\R$ und $(a_n)_{n\in\N}$ mit $a_n \to a$ auch $|a_n| \to |a|$ gilt. TODO
+
+## Folgenkriterium
+
+Mit $U \subset \R$, $f: U\to\R$ und $a \in U$ gilt:
+
+$f$ ist genau dann stetig in $a$, wenn $$\forall (a_n)_{n\in\N} \text{ mit } a_n \in U \text{ und } \lim_{n\to\infty} a_n = a \text{ gilt } \lim_{n\to\infty} f(a_n) = f(a).$$
+
+## Rechenregeln
+
+Mit $c\in\R$ und den den in $a \in U$ stetigen Funktionen $f: U\to\R$ und $g: U\to\R$ gilt:
+
+- $c \cdot f$, $f+g$, $f-g$ und $f \cdot g$ sind stetig in $a$.
+- Ist $g(a) \neq 0$, so ist auch $\frac{f}{g}: U \setminus \{ x \in U\ \vert\ g(x) = 0 \} \to \R$ stetig in $a$.
+
+Mit $a \in U$ und den Funktionen $f: U\to\R$ und $g: V\to\R$ mit $\text{im}(f) \subset V$ gilt: Ist $f$ stetig in $a$ und $g$ stetig in $f(a)$, so ist $g \circ f$ stetig in $a$.
+
+## Fortsetzbarkeit
+
+Mit der stetigen Funktion $f: U\to\R$ und dem Häufungspunkt $a\in\R \setminus U$ von $U$, nennt man $f$ in $a$ **stetig fortsetzbar**, falls $\lim_{x \to a} f(x)$ existiert.
+
+Dann nennt man auch $$g: U \cup \{ a \} \to \R: x \mapsto \begin{cases}f(x) & \text{ falls } x \neq a\\ \lim_{z \to a} f(z) & \text{ falls } x = a\end{cases}$$ die **stetige Fortsetzung** von $f$, und $g$ ist aufgrund der Stetigkeit in Häufungspunkten stetig in $a$ und damit stetig auf $U \cup \{ a \}$. TODO: Wie bitte
+
+## Eigenschaften
+
+### Zwischenwertsatz
+
+Eine stetige Funktion $f: [a,b]\to\R$ nimmt jeden Wert zwischen $f(a)$ und $f(b)$ an.
+
+### Beschränktheit
+
+Eine Funktion $f: U\to\R$ heißt **beschränkt**, wenn $\text{im}(f)$ beschränkt ist.
+
+Eine stetige Funktion $f: [a,b]\to\R$ ist beschränkt.
+
+### Minima/Maxima
+
+Eine stetige Funktion $f: [a,b]\to\R$ nimmt ihr Maximum und ihr Minimum an, d.h. es gibt $c,d \in [a,b]$, so dass für alle $x \in [a,b]$ gilt $$f(c) \leq f(x) \leq f(d).$$
+
+## Monotonie
+
+### Definition
+
+TODO: Woanders hin?
+
+Mit der Funktion $f: U\to\R$ gilt:
+
+- $f$ heißt **monoton wachsend**, wenn für $x,y \in U$ aus $x \leq y$ stets $f(x) \leq f(y)$ folgt.
+- $f$ heißt **streng monoton wachsend**, wenn für $x,y \in U$ aus $x < y$ stets $f(x) < f(y)$ folgt.
+- $f$ heißt **monoton fallend**, wenn für $x,y \in U$ aus $x \leq y$ stets $f(x) \geq f(y)$ folgt.
+- $f$ heißt **streng monoton fallend**, wenn für $x,y \in U$ aus $x < y$ stets $f(x) > f(y)$ folgt.
+
+Ist $f: U\to\R$ streng monoton wachsend oder fallend, so ist $f$ injektiv.
+Denn, für $x,y \in U$ mit $x \neq y$ gilt $x < y$ oder $x > y$ und somit $f(x) < f(y)$ oder $f(x) > f(y)$, aber in jedem Fall $f(x) \neq f(y)$.
+
+### Umkehrsatz
+
+Mit $a,b\in\R \cup \{ -\infty, \infty \}$ mit $a < b$, der Funktion $f: (a,b) \to \R$, $c = \inf(\text{im}(f))\in\R \cup \{ -\infty \}$ und $d = \sup(\text{im}(f))\in\R \cup \{ \infty \}$ gilt:
+
+- Ist $f$ streng monoton wachsend und stetig, so gilt:
+ - $f: (a,b) \to (c,d)$ ist bijektiv.
+ - $f^{-1}: (c,d) \to (a,b)$ ist streng monoton wachsend und stetig.
+- Ist $f$ streng monoton fallend und stetig, so gilt:
+ - $f: (a,b) \to (c,d)$ ist bijektiv.
+ - $f^{-1}: (c,d) \to (a,b)$ ist streng monoton fallend und stetig.
diff --git a/notes/mathe1/main.pdf b/notes/mathe1/main.pdf
new file mode 100644
index 0000000..c01ea3e
--- /dev/null
+++ b/notes/mathe1/main.pdf
Binary files differ
diff --git a/notes/mathe1/makefile b/notes/mathe1/makefile
new file mode 100644
index 0000000..3cd45c6
--- /dev/null
+++ b/notes/mathe1/makefile
@@ -0,0 +1,12 @@
+VIEW = zathura
+
+all:
+ @mkdir -p build/
+ @pandoc main.md --toc -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o build/main.pdf --pdf-engine-opt=-shell-escape
+ @cp build/main.pdf .
+
+clean:
+ @$(RM) -rf build
+
+run: clean all
+ @$(VIEW) build/main.pdf
diff --git a/notes/mathe2/exam.md b/notes/mathe2/exam.md
new file mode 100644
index 0000000..453f664
--- /dev/null
+++ b/notes/mathe2/exam.md
@@ -0,0 +1,367 @@
+---
+author: Marvin Borner
+date: "`\\today`{=tex}"
+lang: de-DE
+pandoc-latex-environment:
+ bsp-box:
+ - bsp
+ defi-box:
+ - defi
+ visu-box:
+ - visu
+toc-title: Inhalt
+---
+
+```{=tex}
+\newpage
+```
+# Negative Zahlen in $\Z/n\Z$
+
+Solange $n$ addieren, bis die Zahl positiv ist.
+
+::: bsp
+**Beispiel**: Äquivalenzklassen in $\Z/6\Z$.
+
+1. $[-2] = [4]$
+2. $[-7] = [5]$
+:::
+
+# Reduzibilität
+
+Generell: Bei Polynomen der Grade 2/3 prüfen auf Nullstellen, da
+$f = (x-a)g$ reduzibel mit $a$ NS. Bei Grad 4 Spezialfall der Zelegung
+in zwei irreduzible Polynome zweiten Grades beachten (siehe Beispiel).
+
+Bei $\Z/n\Z[X]$ typischerweise jegliche Kombinationen ausprobieren und
+NS finden.
+
+::: bsp
+**Beispiel**: Reduzibilität von $f=x^4+2x^2+1$ in $\R[X]$:
+
+Man erkennt schnell, dass $f$ keine NS in $\R$ besitzt, da die
+Exponenten jeweils positiv sind.
+
+**ALLERDINGS**: Polynome in Grad 4 sind durch Polynome folgender Grade
+reduzibel: $$4 = 4 + 0 = 1 + 3 = 1 + 1 + 2 + 2 = 2 + 2 = 1 + 1 + 1 + 1$$
+Eine Zerlegung in ein Polynom mit Graden $4+0$ wäre der irreduzible
+Fall. Alle Zerlegungen mit 1 stellen den Fall einer Nullstelle dar, da
+dort ein Linearfaktor existiert. Dann bleibt hier der Fall $2+2$.
+
+Dann muss die Zerlegung existieren:
+$$(x^2+ax+b)(x^2+cx+d) = x^4+(a+c)x^3+(b+ac+d)x^2+(ad+bc)x+bd$$
+
+Durch die Koeffizienten von $f$ entsteht ein LGS:
+
+```{=tex}
+\begin{splitty}a+c&=0\\b+ac+d&=2\\ad+bc&=0\\bd&=1\end{splitty}
+```
+Mit der Lösung $a=c=0$ und $b=d=1$ lässt sich $f$ in $(x^2+1)(x^2+1)$
+zerlegen.
+:::
+
+# Komplexe Zahlen
+
+## Gleichungen mit komplexen Zahlen lösen
+
+::: bsp
+**Beispiel**: Bestimmen von $z$ bei $z^3 = 2 + 2i$.
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=-1,xmax=3,ymin=-1,ytick={-1,...,3},ymax=3,minor tick num=1,ticks=both,yticklabels={$-i$, $0$, $i$, $2i$, $3i$}]
+\addplot[black,mark=*] coordinates {(4,5)} {};
+\addplot[ultra thick,dashed,red] coordinates { (0,0) (2,0) } node[pos=0.5,above] {$\mathrm{Re}(z)=2$};
+\addplot[thick,dashed,red] coordinates { (2,0) (2,2) } node[pos=0.5,right] {$\mathrm{Im}(z)=2$};
+\addplot[thick,blue] coordinates { (0,0) (2,2) } node[pos=0.5,left] {$r$};
+
+\node [above,red] at (axis cs: 2,2) {$2+2i$};
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+Zuerst bestimmt man die Exponentialdarstellung mittels des Winkels. In
+diesem Fall ist $\varphi=\frac{\pi}{4}$. $r$ lässt sich mit Pythagoras
+berechnen als $r^2=2^2+2^2=8\implies r=\sqrt{8}$. Dann ist
+$z^3 = 2+2i = \sqrt{8}e^{i(\frac{\pi}{4}+k2\pi)}$. Es folgt mit
+$k=0,1,2$:
+$$z_k=(\sqrt{8})^{\frac{1}{3}}e^{i(\frac{\pi}{4}+k2\pi)\cdot\frac{1}{3}} = \sqrt{2}e^{i(\frac{\pi}{12}+k\frac{2}{3}\pi)}.$$
+Alle Lösungen liegen dann auf dem imaginären Kreis.
+:::
+
+# Vektorräume
+
+## Prüfen auf Erzeugendensystem/Basis
+
+Prüfen, ob $E = \{v_1,...,v_n\}$ eine Basis bzw. ein Erzeugendensystem
+von Vektorraum $V$ ist:
+
+0. Für Basis ggf. zuerst auf lineare Unabhängigkeit prüfen zwecks
+ Effizienz (wenn offensichtlich, sonst sowieso ZSF in nächsten
+ Schritten)
+1. Matrix $A$ erstellen mit Vektoren $v_1,...,v_n$ als Zeilen
+ untereinander
+2. Rang von $A$ bestimmen
+3. Dimension von $V$ bestimmen
+ - wenn $\mathrm{rank}(A) = \mathrm{dim}(V)$, dann $E$
+ Erzeugendensystem
+ - wenn zusätzlich $\mathrm{rank}(A) = n$, dann $E$ Basis
+4. Wenn keine Basis: Basis ermitteln/ergänzen:
+ - wenn $\mathrm{rank}(A) < \mathrm{dim}(V)$, dann alle linear
+ unabhängigen Vektoren (nicht-Nullzeilen der ZSF) zu einer Basis
+ ergänzen (z.B. durch passende Einheitsvektoren)
+ - wenn $\mathrm{rank}(A) = \mathrm{dim}(V) < n$, dann linear
+ abhängige Vektoren streichen
+
+ODER über Determinante $\neq 0$ (TUDU)
+
+## Basis ermitteln
+
+- Spalten einer Matrix bilden dessen Basis
+
+## Prüfen auf lineare Unabhängigkeit
+
+Anwenden des Gauß-Algorithmus:
+
+::: bsp
+**Beispiel** mit $v_1=\begin{pmatrix}5\\11\\-2\end{pmatrix}$,
+$v_2=\begin{pmatrix}3\\5\\-1\end{pmatrix}$ und
+$v_3=\begin{pmatrix}4\\3\\-1\end{pmatrix}$:
+$$\begin{pmatrix}5&3&4\\11&5&3\\-2&-1&-1\end{pmatrix} \leadsto \begin{pmatrix}0&\frac{1}{2}&\frac{3}{2}\\0&-\frac{1}{2}&-\frac{5}{2}\\-2&-1&-1\end{pmatrix} \leadsto \begin{pmatrix}0&0&-1\\0&-\frac{1}{2}&-\frac{5}{2}\\-2&-1&-1\end{pmatrix} \leadsto \begin{pmatrix}1&\frac{1}{2}&\frac{1}{2}\\0&1&5\\0&0&1\end{pmatrix}$$
+Man erkennt die lineare Unabhängigkeit: Die Vektoren bilden eine Basis
+in $\R^3$.
+:::
+
+## Prüfen auf Untervektorraum
+
+**Über Untervektorraumaxiome**:
+
+1. $0\in U$
+2. $x,y\in U \implies x+y\in U$
+3. $x\in U, \lambda\in K \implies \lambda x\in U$
+
+**Über Kern/Bild**:
+
+Wenn man zeigen soll, dass eine Menge einen Untervektorraum darstellt,
+ist es sinnvoll die Tatsache zu verwenden, dass sowohl Kern als auch
+Bild immer Untervektorräume darstellen.
+
+::: bsp
+**Beispiele**: Schreiben einer Menge als Kern zum Beweis des
+Untervektorraums.
+
+1. Sei $U=\{x\in\R^3: x_1-x_2-x_3=0\}$. Dies lässt sich schreiben als
+ Matrixvektorprodukt mit
+ $U=\{x\in\R^3: (1,-1,-1)(x_1,x_2,x_3)^\top = 0\}$. Dann ist $U$
+ wegen der Definition des Kerns mit $U=\{x\in V: Ax = 0\}$ ein
+ Untervektorraum von $\R^3$.
+2. Sei
+ $U=\{(u_1,u_2,u_3)^\top\in\R^3: \begin{pmatrix}2u_1+3u_2-u_3\\u_1-4u_2+3u_3\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}\}$.
+ Dies lässt sich schreiben als Matrixvektorprodukt mit
+ $U=\{(u_1,u_2,u_3)^\top\in\R^3: \begin{pmatrix}2&3&-1\\1&-4&3\end{pmatrix}(u_1,u_2,u_3)^\top=\begin{pmatrix}0\\0\end{pmatrix}\}$.
+ Dann ist $U$ wegen der Definition des Kerns mit
+ $U=\{x\in V: Ax = 0\}$ ein Untervektorraum von $\R^3$.
+:::
+
+::: bsp
+**Beispiel**: Schreiben einer Menge als Bild zum Beweis des
+Untervektorraums.
+
+Sei $U=\{(2x,-3x)^\top:x\in\R\}$. Dies lässt sich schreiben als
+$U=\{\begin{pmatrix}2\\-3\end{pmatrix}x: x\in\R\}$. Dann ist $U$ wegen
+der Definition des Bildes mit $U=\{Ax: x\in V\}$ ein Untervektorraum von
+$\R^2$.
+:::
+
+# Prüfen auf Linearität
+
+## Homomorphismus
+
+Beide Bedingungen lassen sich gemeinsam prüfen mit:
+$$f(\lambda\vec{u} + \vec{v}) = \lambda f(\vec{u}) + f(\vec{v}).$$
+
+# Matrizen
+
+## Matrizen transponieren
+
+$$A=\begin{pmatrix}a_{11}&...&a_{1n}\\\vdots&&\vdots\\a_{m1}&...&a_{mn}\end{pmatrix} \implies A^\top=\begin{pmatrix}a_{11}&...&a_{m1}\\\vdots&&\vdots\\a_{1n}&...&a_{mn}\end{pmatrix}$$
+
+## Rang bestimmen
+
+1. Matrix in Zeilenstufenform bringen
+2. Die Anzahl aller Zeilen, die nicht vollständig aus Nullen bestehen,
+ entspricht dem Rang
+
+## Bild bestimmen
+
+1. Transponierte Matrix $A^\top$ in Zeilenstufenform bringen
+2. Umgeformte Matrix erneut transponieren
+3. Die Menge aller Linearkombinationen der Spalten, die nicht
+ vollständig aus Nullen bestehen, entspricht dem Bild
+
+## Kern bestimmen
+
+1. Gleichungssystem $A\cdot v = 0$ aufstellen (mit
+ $A\in K^{m\times n} \implies v\in K^{n\times1}$)
+ - $A$ ist dann eine Abbildungsmatrix
+2. Gleichungssystem in Zeilenstufenform bringen
+3. Lösung (in Abhängigkeit von Parametern) als Menge schreiben
+
+## Determinante bestimmen
+
+### Regel von Sarrus
+
+Gilt bei $3\times3$-Matrizen:
+
+$$A=\begin{pmatrix}a&b&c\\d&e&f\\g&h&i\end{pmatrix}$$
+$$\implies \mathrm{det}(A) = aei+bfg+cdh-bdi-afh-ceg$$
+
+### Gaußsches Eliminationsverfahren
+
+1. Gauß nutzen für Zeilenstufenform (rechte obere Dreiecksmatrix)
+ - bei jeder Vertauschung der Zeilen muss die Determinante mit $-1$
+ multipliziert werden
+2. Die Determinante ist das Produkt der Hauptdiagonalelemente:
+ $$\mathrm{det}(A) = (-1)^{\text{\#Vertauschungen}} \cdot a'_{11}\cdot...\cdot a'_{nn}$$
+
+### Laplacescher Entwicklungssatz
+
+1. Wähle Zeile/Spalte aus, nach welcher entwickelt wird (optimalerweise
+ möglichst viele Nullen)
+
+2. Startpunkt als Faktor aufschreiben und mit der Determinanten der
+ Matrix multiplizieren, die entsteht, wenn die gesamte derzeitige
+ Zeile/Spalte gestrichen wird (abhängig von Schachbrettmuster ggf.
+ mit $-1$ multiplizieren)
+
+3. 2 wiederholen für alle Elemente der gewählten Spalte/Zeile und
+ addieren
+
+::: bsp
+**Beispiel**: Entwicklung nach der ersten Zeile:
+
+```{=tex}
+\begin{splitty}
+ \mathrm{det}\begin{pmatrix}1&2&3\\4&5&6\\7&8&9\end{pmatrix} &= 1 \cdot \mathrm{det}\begin{pmatrix}5&6\\8&9\end{pmatrix} + (-1)\cdot2\cdot\mathrm{det}\begin{pmatrix}4&6\\7&9\end{pmatrix} + 3\cdot\mathrm{det}\begin{pmatrix}4&5\\7&8\end{pmatrix}\\
+ &= 1\cdot(-3) - 2 \cdot (-6) + 3\cdot(-3)\\
+ &= 0
+\end{splitty}
+```
+:::
+
+## Matrizen invertieren
+
+Generell: Für $2\times2$-Matrizen empfiehlt sich das
+**Adjunktenverfahren**. Für $3\times3$-Matrizen empfiehlt sich das
+**Adjunktenverfahren** sowie die **Cramersche Regel**. Bei größeren
+Matrizen oder bei Matrizen mit vielen Nullen empfiehlt sich der
+**Gauß-Jordan-Algorithmus**.
+
+Wichtig ist: Matrizen lassen sich nur invertieren, wenn $n\times n$ und
+$$\mathrm{rank}(A) = n \iff \mathrm{det}(A)\neq0 \iff A^{-1} \text{ existiert.}$$
+
+### Adjunktenverfahren
+
+Für $n\times n$-Matrizen: TUDU adj
+$$A^{-1} = \frac{1}{\mathrm{det}(A)} \mathrm{adj}(A)$$
+
+Für $2\times2$-Matrizen:
+$$A^{-1}=\frac{1}{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}$$
+
+## Cramersche Regel
+
+1. $\mathrm{det}(A)$ berechnen und $\mathrm{det}(A)\neq0$ prüfen
+2. Einzelne Einträge der Lösung $x=(x_1,...,x_n)^\top$ mit
+ $x_i=\frac{\mathrm{det}(A_i)}{\mathrm{det}(A)}$ bestimmen ($A_i$
+ ergibt sich, wenn die $i$-te Spalte von $A$ durch den Vektor $b$
+ ersetzt wird)
+
+### Gauß-Jordan-Algorithmus
+
+1. Erweiterte Koeffizientenmatrix $(A\mid E_n)$ bilden:
+ $$(A\mid E_n) = \left(\begin{array}{ccc|ccc}a_{11}&...&a_{1n}&1&...&0\\\vdots&&\vdots&\vdots&\ddots&\vdots\\a_{m1}&...&a_{mn}&0&...&1\end{array}\right)$$
+2. Gaußsches Eliminationsverfahren anwenden, um die linke Seite auf die
+ Einheitsmatrix zu bringen:
+ $$(E_n\mid A^{-1}) = \left(\begin{array}{ccc|ccc}1&...&0&b_{11}&...&b_{1n}\\\vdots&\ddots&\vdots&\vdots&&\vdots\\0&...&1&b_{m1}&...&b_{mn}\end{array}\right)$$
+3. Die Matrix auf der rechten Seite entspricht dem Inversen von $A$
+
+## Charakteristisches Polynom bestimmen
+
+Determinante von $A-\lambda E_n$ abhängig von $\lambda$ bestimmen:
+$$P_A = \mathrm{det}(A-\lambda E_n)$$
+
+::: bsp
+**Beispiel**: Mit
+$A=\begin{pmatrix}1&1&-2\\1&1&-2\\-2&-2&4\end{pmatrix}$:
+
+Lösen durch Laplaceschen Entwicklungssatz:
+`\begin{align*}P_A&=\mathrm{det}\begin{pmatrix}1-\lambda&1&-2\\1&1-\lambda&-2\\-2&-2&4-\lambda\end{pmatrix}\\&=(1-\lambda)\mathrm{det}\begin{pmatrix}1-\lambda&-2\\-2&4-\lambda\end{pmatrix}-1\mathrm{det}\begin{pmatrix}1&-2\\-2&4-\lambda\end{pmatrix}-2\mathrm{det}\begin{pmatrix}1&1-\lambda\\-2&-2\end{pmatrix}\\&=-\lambda^2(\lambda-6)\end{align*}`{=tex}
+:::
+
+## Eigenwerte bestimmen
+
+1. Charakteristisches Polynom $P_A$ bestimmen
+2. Nullstellen von $P_A$ sind Eigenwerte
+
+::: bsp
+**Beispiel**: Mit $P_A=-\lambda^2(\lambda-6)$:
+`\begin{align*}&-\lambda^2(\lambda-6)=0\\\implies&\lambda_{1,2}=0\quad\land\quad\lambda_3=6\end{align*}`{=tex}
+:::
+
+## Eigenvektoren bestimmen
+
+1. Eigenwerte $\lambda_i$ bestimmen
+2. Für jedes $\lambda_i$ lösen:
+ $$V_{\lambda_i} = \mathrm{ker}(A-\lambda_i E_n)$$
+3. Die Lösungen werden jeweils abhängig von einer Variable sein
+ `\textrightarrow\space`{=tex} linearen Spann aufstellen
+
+::: bsp
+**Beispiel**: Mit $\lambda_{1,2}=0,\ \lambda_3=6$ und
+$A=\begin{pmatrix}1&1&-2\\1&1&-2\\-2&-2&4\end{pmatrix}$:
+
+1. Eigenvektor für $\lambda_1=0$ berechnen: $\\A-\lambda_1$ umformen:
+ $$\begin{pmatrix}1&1&-2\\1&1&-2\\-2&-2&4\end{pmatrix}\leadsto\begin{pmatrix}1&1&-2\\0&0&0\\0&0&0\end{pmatrix}$$
+ Gleichung $\mathrm{ker}(A-\lambda_1) \implies A-\lambda_1 = 0$
+ lösen:
+ `\begin{align*}&x_1+x_2-2x_3=0\\\implies&x_1=-x_2+2x_3\\\implies&x_2=...=x_2\\\implies&x_3=...=x_3\end{align*}`{=tex}
+ Linearen Spann aufstellen:
+ $$V_0=\mathrm{Lin}\left(\begin{pmatrix}-1\\1\\0\end{pmatrix},\begin{pmatrix}2\\0\\1\end{pmatrix}\right)$$
+2. Eigenvektor für $\lambda_3=6$ berechnen: $\\A-\lambda_3$ umformen:
+ $$\begin{pmatrix}1-6&1&-2\\1&1-6&-2\\-2&-2&4-6\end{pmatrix}\leadsto\begin{pmatrix}2&0&1\\0&2&1\\0&0&0\end{pmatrix}$$
+ Gleichung $\mathrm{ker}(A-\lambda_3) \implies A-\lambda_3 = 0$ lösen
+ durch LGS:
+ `\begin{align*}&2x_1+x_3=0\quad\land\quad2x_2+x_3=0\\\implies&x_1=-\frac{x_3}{2}\quad\land\quad x_2=-\frac{x_3}{2}\quad\land\quad x_3=x_3\end{align*}`{=tex}
+ Linearen Spann aufstellen:
+ $$V_6=\mathrm{Lin}\begin{pmatrix}-\frac{1}{2}\\-\frac{1}{2}\\1\end{pmatrix}=\mathrm{Lin}\begin{pmatrix}-1\\-1\\2\end{pmatrix}$$
+:::
+
+## Eigenraum bestimmen
+
+1. Eigenvektoren $V_{\lambda_i}$ bestimmen
+2. Linearen Spann aller Eigenvektoren aufstellen
+
+::: bsp
+**Beispiel**: Mit
+$V_0=\mathrm{Lin}\left(\begin{pmatrix}-1\\1\\0\end{pmatrix},\begin{pmatrix}2\\0\\1\end{pmatrix}\right)$
+und $V_6=\mathrm{Lin}\begin{pmatrix}-1\\-1\\2\end{pmatrix}$:
+$$\mathbb{L}=\mathrm{Lin}\left(\begin{pmatrix}-1\\1\\0\end{pmatrix},\begin{pmatrix}2\\0\\1\end{pmatrix},\begin{pmatrix}-1\\-1\\2\end{pmatrix}\right)$$
+:::
+
+## Diagonalmatrix und invertierbare Matrix bestimmen
+
+Gesucht werden Lösungen von $S^{-1}AS=D$ mit der invertierbaren Matrix
+$S$ und der Diagonalmatrix $D$.
+
+1. Eigenwerte und Eigenvektoren von $A$ bestimmen
+2. Die Spalten der invertierbaren Matrix $S$ entsprechen den
+ Eigenvektoren
+3. Die Elemente der Diagonalen der Diagonalmatrix entsprechen den
+ Eigenwerten
+
+::: bsp
+**Beispiel**: Mit $\lambda_{1,2}=0,\ \lambda_3=6$ sowie
+$V_0=\mathrm{Lin}\left(\begin{pmatrix}-1\\1\\0\end{pmatrix},\begin{pmatrix}2\\0\\1\end{pmatrix}\right)$
+und $V_6=\mathrm{Lin}\begin{pmatrix}-1\\-1\\2\end{pmatrix}$:
+
+$$S=\begin{pmatrix}-1&2&-1\\-1&0&-1\\0&1&2\end{pmatrix}$$
+$$D=\begin{pmatrix}\lambda_1&0&0\\0&\lambda_2&0\\0&0&\lambda_3\end{pmatrix}=\begin{pmatrix}0&0&0\\0&0&0\\0&0&6\end{pmatrix}$$
+:::
diff --git a/notes/mathe2/examtitle.tex b/notes/mathe2/examtitle.tex
new file mode 100644
index 0000000..5419f39
--- /dev/null
+++ b/notes/mathe2/examtitle.tex
@@ -0,0 +1,20 @@
+\begin{titlepage}
+ \begin{center}
+ \vspace*{1cm}
+
+ {\huge\textbf{Mathematik für Informatik 2}}
+
+ \vspace{0.5cm}
+ {\Large Klausurvorbereitung}\\
+ \textbf{Marvin Borner}
+
+ \vfill
+ \includegraphics[width=0.4\textwidth]{ochs_logo}\\
+ \vfill
+
+ \includegraphics[width=0.4\textwidth]{uni_logo}\\
+ Sommersemester 2022
+ \end{center}
+\end{titlepage}
+
+\pagebreak\hspace{0pt}\vfill\begin{center}{\Large Dies ist meine WIP Zusammenfassung, welche hauptsächlich mir dienen soll. Ich schreibe außerdem ein inoffizielles Skript, welches auf \url{https://marvinborner.de/mathe2.pdf} zu finden ist.}\end{center}\vfill\hspace{0pt}\pagebreak
diff --git a/notes/mathe2/header.tex b/notes/mathe2/header.tex
new file mode 100644
index 0000000..d66e279
--- /dev/null
+++ b/notes/mathe2/header.tex
@@ -0,0 +1,39 @@
+\usepackage{braket}
+\usepackage{polynom}
+\usepackage{amsthm}
+\usepackage{csquotes}
+\usepackage{svg}
+\usepackage{environ}
+\usepackage{tikz,pgfplots}
+\usepackage{titleps}
+\usepackage{tcolorbox}
+
+\pgfplotsset{width=10cm,compat=1.15}
+\usepgfplotslibrary{external}
+\usetikzlibrary{calc,trees,positioning,arrows,fit,shapes}
+%\tikzexternalize
+\setcounter{MaxMatrixCols}{20}
+
+\newpagestyle{main}{\sethead{\toptitlemarks\thesection\quad\sectiontitle}{}{\thepage}\setheadrule{.4pt}}
+\pagestyle{main}
+
+\newtcolorbox{defi-box}{colback=gray!5!white,arc=0pt,outer arc=0pt,colframe=gray!60!black}
+\newtcolorbox{bsp-box}{colback=orange!5!white,arc=0pt,outer arc=0pt,colframe=orange!60!black}
+\newtcolorbox{visu-box}{colback=cyan!5!white,arc=0pt,outer arc=0pt,colframe=cyan!60!black}
+\NewEnviron{splitty}{\begin{displaymath}\begin{split}\BODY\end{split}\end{displaymath}}
+
+\newcommand\N{\mathbb{N}}
+\newcommand\R{\mathbb{R}}
+\newcommand\Z{\mathbb{Z}}
+\newcommand\Q{\mathbb{Q}}
+\newcommand\C{\mathbb{C}}
+\renewcommand\P{\mathbb{P}}
+\renewcommand\O{\mathcal{O}}
+\newcommand\pot{\mathcal{P}}
+\newcommand{\cupdot}{\mathbin{\mathaccent\cdot\cup}}
+\newcommand{\bigcupdot}{\dot{\bigcup}}
+
+\newcommand\refiff[1]{\stackrel{\text{#1}}{\iff}}
+\newcommand\refimp[1]{\stackrel{\text{#1}}{\implies}}
+\newcommand\refeq[1]{\stackrel{\text{#1}}{=}}
+\newcommand\refless[1]{\stackrel{\text{#1}}{<}}
diff --git a/notes/mathe2/main.md b/notes/mathe2/main.md
new file mode 100644
index 0000000..80ff25e
--- /dev/null
+++ b/notes/mathe2/main.md
@@ -0,0 +1,2500 @@
+---
+author: Marvin Borner
+date: "`\\today`{=tex}"
+lang: de-DE
+pandoc-latex-environment:
+ bsp-box:
+ - bsp
+ defi-box:
+ - defi
+ visu-box:
+ - visu
+toc-title: Inhalt
+---
+
+# Logik
+
+::: defi
+Aussagen werden **einem** Wahrheitswert zugeordnet: **w** für *wahr* und
+**f** für *falsch*. Eine Aussage, der der Wahrheitswert **w** schlicht
+durch Festlegung zugewiesen wurde, heißt **Axiom**.
+:::
+
+## Negation (nicht)
+
+- Notation: $\neg X$
+
+- Gesprochen: `\enquote{nicht X}`{=tex}
+
+ $X$ $\neg X$
+ ------- ----------
+ **w** **f**
+ **f** **w**
+
+- $\neg\neg x \iff x$
+
+- $\neg (\forall x : P) \iff \exists x : (\neg P)$
+
+- $\neg (\exists x : P) \iff \forall x : (\neg P)$
+
+## Konjunktion (und)
+
+- Notation: $X \land Y$
+
+- Gesprochen: `\enquote{X und Y}`{=tex}
+
+ $Y$ $X$ $X \land Y$
+ ------- ------- -------------
+ **w** **w** **w**
+ **w** **f** **f**
+ **f** **w** **f**
+ **f** **f** **f**
+
+## Disjunktion (oder)
+
+- Notation: $X \lor Y$
+
+- Gesprochen: `\enquote{X oder Y}`{=tex}
+
+ $Y$ $X$ $X \lor Y$
+ ------- ------- ------------
+ **w** **w** **w**
+ **w** **f** **w**
+ **f** **w** **w**
+ **f** **f** **f**
+
+## Bijunktion (Äquivalenz)
+
+- Notation: $X \iff Y$
+
+- Gesprochen: `\enquote{X genau dann wenn Y}`{=tex}
+
+ $Y$ $X$ $X \iff Y$
+ ------- ------- ------------
+ **w** **w** **w**
+ **w** **f** **f**
+ **f** **w** **f**
+ **f** **f** **w**
+
+- Alternative: $(X \implies Y) \land (Y \implies X)$
+
+## Subjunktion (Implikation)
+
+- Notation: $X \implies Y$
+
+- Gesprochen: `\enquote{Aus X folgt Y}`{=tex}
+
+ $Y$ $X$ $X \implies Y$
+ ------- ------- ----------------
+ **w** **w** **w**
+ **w** **f** **f**
+ **f** **w** **w**
+ **f** **f** **w**
+
+- Alternative: $(\neg X) \lor Y$
+
+- Der Wahrheitswert der Implikation $X \implies Y$ bewertet nur die
+ Korrektheit des Schließens, nicht jedoch die Wahrheit der Aussagen
+ $X$ und $Y$
+
+## Kontraposition
+
+- Definition: $X \implies Y \iff \neg Y \implies \neg X$
+
+ ---------------------------------------------------------------------------------
+ $X$ $Y$ $\neg Y$ $\neg Y$ $X \implies Y$ $\neg Y \implies \neg x$
+ ------- ------- ---------- ---------- ---------------- --------------------------
+ **w** **w** **f** **f** **w** **w**
+
+ **w** **f** **f** **w** **f** **f**
+
+ **f** **w** **w** **f** **w** **w**
+
+ **f** **f** **w** **w** **w** **w**
+ ---------------------------------------------------------------------------------
+
+- Die Kontraposition ist sehr hilfreich für **Widerspruchsbeweise**
+
+## Quantoren
+
+- $\forall$: `\enquote{für alle}`{=tex}
+- $\exists$: `\enquote{es existiert ein}`{=tex}
+- $\exists!$: `\enquote{es existiert genau ein}`{=tex}
+- $\nexists$: `\enquote{es existiert kein}`{=tex}
+
+## Präzedenz
+
+Sortiert nach stärkster Bindung:
+
+1. Negation ($\neg$)
+2. Konjunktion ($\land$) und Disjunktion ($\lor$)
+3. Implikation ($\iff$) und Äquivalenz ($\implies$)
+
+## Gesetze
+
+- Absorption
+ - $X \land w \iff X$
+ - $X \land f \iff f$
+ - $X \lor w \iff w$
+ - $X \lor f \iff X$
+- Assoziativität
+ - $(X \lor Y) \lor Z \iff X \lor (X \lor Z)$
+ - $(X \land Y) \land Z \iff X \land (X \land Z)$
+- Kommutativität
+ - $X \lor Y \iff Y \lor X$
+ - $X \land Y \iff Y \land X$
+- Distributivität
+ - $X \land (Y \lor Z) \iff (X \land Y) \lor (X \land Z)$
+ - $X \lor (Y \land Z) \iff (X \lor Y) \land (X \lor Z)$
+- De Morgansche Regeln
+ - $\neg (X \lor Y) \iff \neg X \land \neg Y$
+ - $\neg (X \land Y) \iff \neg X \lor \neg Y$
+
+# Mengen
+
+::: defi
+Eine *Menge* ist eine Zusammenfassung von bestimmten,
+wohlunterschiedenen Objekten unserer Anschauung oder unseres Denkens zu
+einem Ganzen. Die in einer Menge zusammengefassten Objekte heißen
+*Elemente* der Menge.
+:::
+
+## Notation
+
+- Mengen angeben durch Auflisten der Elemente: $\{ 1,2,5,3,4,0 \}$
+- Mengen angeben durch Vorschreiben einer Eigenschaft:
+ $\{ x \mid x \text{ ist eine natürliche Zahl kleiner als } 6 \}$
+- $x \in M$ heißt `\enquote{x ist Element von M}`{=tex}
+- $x \notin M$ heißt `\enquote{x ist nicht Element von M}`{=tex}
+- $\{ \}$ und $\emptyset$ bezeichnen die *leere Menge*
+
+## Inklusionsrelationen
+
+- $M \subset N \iff (x \in M \implies x \in N)$
+- $M = N \iff (M \subset N \land N \subset M)$
+- $M \neq N \iff \neg (M = N) \iff ((\exists x \in M : x \notin N) \lor (\exists x \in N : x \notin M))$
+- $M \subsetneq N \iff (M \subset N \land M \neq N)$
+
+## Zahlenbereiche
+
+$$ \P \subsetneq \N \subsetneq \Z \subsetneq \Q \subsetneq \R \subsetneq \C $$
+
+- **Natürliche Zahlen**: $\N = \{ 0,1,2,3,4,5,... \}$
+- **Positive natürliche Zahlen**: $\N_{>0} = \{ 1,2,3,4,5,... \}$
+- **Ganze Zahlen**: $\Z = \{ ...,-3,-2,-1,0,1,2,3,... \}$
+- **Rationale Zahlen**:
+ $\Q = \{ \frac{p}{q} \mid p,q \in Z, q \neq 0 \}$
+- **Komplexe Zahlen**: $\C = 42$ TODO
+- **Primzahlen**: Menge der natürlichen Zahlen $p$, die genau zwei
+ positive Teiler, nämlich $1$ und $p$, haben
+
+## Operationen von Mengen
+
+- $M \cap N = \{ x \mid x \in M \land x \in N \}$ heißt der
+ **Durchschnitt** von $M$ und $N$
+- $M \cup N = \{ x \mid x \in M \lor x \in N \}$ heißt die
+ **Vereinigung** von $M$ und $N$
+- $M \setminus N = \{ x \mid x \in M \land x \notin N \}$ heißt die
+ **Differenzmenge** von $M$ und $N$
+- $M \times N = \{ (x, y) \mid x \in M \land y \in N \}$ heißt das
+ **kartesische Produkt** von $M$ und $N$. Dabei ist $(x, y)$ ein
+ **geordnetes Paar (Tupel)**, und für zwei geordnete Paare
+ $(x, y), (u, v) \in M \times N$ gilt:
+ $$(x, y) = (u, v) \iff (x = u \land y = v)$$
+- $M$ und $N$ heißen genau dann **disjunkt**, wenn
+ $M \cap N = \emptyset$, d.h. wenn sie kein Element gemeinsam
+ besitzen
+- $P = M \cupdot N \iff (P = M \cup N \land M \cap N = \emptyset)$
+ beschreibt die **disjunkte Vereinigung**
+- $\bigcap_{i \in I} M_i = \{ x \mid \forall i \in I : x \in M_i \}$
+ heißt der **Durchschnitt** der $M_i$
+- $\bigcup_{i \in I} M_i = \{ x \mid \exists i \in I : x \in M_i \}$
+ heißt die **Vereinigung** der $M_i$
+- $P = \bigcupdot_{i \in I} M_i \iff (P = \bigcup_{i \in I} M_i \land M_i \cap M_j = \emptyset\ \forall i,j \in I$
+ mit $i \neq j)$
+
+::: visu
+**Visualisierung im Venn-Diagramm**:
+
+```{=tex}
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=gray!30}]
+\newcommand\intersection{0.8}
+
+% Set M
+\node[set,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Intersection
+\begin{scope}
+\clip (0,0) circle(1cm);
+\clip (\intersection,0) circle(1cm);
+\fill[orange!50](0,0) circle(1cm);
+\end{scope}
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \cap N$};
+
+\end{tikzpicture}
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=orange!50}]
+\newcommand\intersection{0.8}
+
+% Set M
+\node[set,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \cup N$};
+
+\end{tikzpicture}
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=gray!30}]
+\newcommand\intersection{0.8}
+
+% Set M
+\node[set,fill=orange!50,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Intersection
+\begin{scope}
+\clip (0,0) circle(1cm);
+\clip (\intersection,0) circle(1cm);
+\fill[gray!30](0,0) circle(1cm);
+\end{scope}
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \setminus N$};
+
+\end{tikzpicture}
+\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 2cm, fill=orange!50}]
+\newcommand\intersection{2.1}
+
+% Set M
+\node[set,label={135:$M$}] (M) at (0,0) {};
+
+% Set N
+\node[set,label={45:$N$}] (N) at (\intersection,0) {};
+
+% Circles outline
+\draw (0,0) circle(1cm);
+\draw (\intersection,0) circle(1cm);
+
+% Set intersection label
+\node at (\intersection/2,-1.5) {$M \cupdot N$};
+
+\end{tikzpicture}
+```
+:::
+
+::: bsp
+**Beispiel** mit den Mengen $I = \{ 1, 2, 3 \}$, $M_1 = \{ a, 1, c \}$,
+$M_2 = \{ b, 1, e \}$ und $M_3 = \{ d, 1, f \}$:
+$$\bigcap_{i \in I} = \{ 1 \} \text { und } \bigcup_{i \in I} = \{ 1, a, b, c, d, e, f \}$$
+:::
+
+## Spezielle Mengen
+
+### Komplementärmenge
+
+Für eine Teilmenge $M$ einer Menge $N$ ist
+$\overline{M} = N \setminus M$.
+
+::: visu
+**Visualisierung**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[thick, set/.style = {circle, minimum size = 4cm, fill=gray!30}]
+
+% Set N
+\node[set,fill=orange!50,label={45:$N$}] (N) at (0,0) {};
+
+% Set M
+\node[set,minimum size=2cm,label={135:$M$}] (M) at (0,0) {};
+
+% Circles outline
+\draw (0,0) circle(2cm);
+\draw (0,0) circle(1cm);
+
+% Set intersection label
+\node at (0,-2.5) {$\overline{M} = N \setminus M$};
+
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Potenzmenge
+
+Für eine Menge $M$ ist die Potenzmenge
+$\pot(M) = \{ A \mid A \subset M \}$.
+
+::: visu
+**Visualisierung**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\node (max) at (0,4) {$\{ x,y,z \}$};
+\node (a) at (-2,2) {$\{ x,y \}$};
+\node (b) at (0,2) {$\{ x,z \}$};
+\node (c) at (2,2) {$\{ y,z \}$};
+\node (d) at (-2,0) {$\{ x \}$};
+\node (e) at (0,0) {$\{ y \}$};
+\node (f) at (2,0) {$\{ z \}$};
+\node (min) at (0,-2) {$\emptyset$};
+\draw (min) -- (d) -- (a) -- (max) -- (b) -- (f)
+(e) -- (min) -- (f) -- (c) -- (max)
+(d) -- (b);
+\draw[preaction={draw=white, -,line width=4pt}] (a) -- (e) -- (c);
+\end{tikzpicture}\end{center}
+```
+:::
+
+Außerdem gilt mit der endlichen Menge $M$: $|\pot(M)| = 2^{|M|}$
+
+::: bsp
+**Beispiel** mit der Menge $M = \{1,2,3\}$:
+$$\pot(M) = \{\emptyset, \{1\},\{2\},\{3\},\{1,2\},\{1,3\},\{2,3\},\{1,2,3\}\}$$
+sowie $$|\pot(M)| = 8 = 2^{3} = 2^{|M|}$$
+:::
+
+## Gesetze
+
+- Assoziativität
+ - $(M \cup N) \cup P = M \cup (N \cup P)$
+ - $(M \cap N) \cap P = M \cap (N \cap P)$
+- Kommutativität
+ - $M \cup N = N \cup M$
+ - $M \cap N = N \cap M$
+- Distributivität
+ - $M \cap (N \cup P) = (M \cap N) \cup (M \cap P)$
+ - $M \cup (N \cap P) = (M \cup N) \cap (M \cup P)$
+- Identität
+ - $M \cup \emptyset = M$
+ - $M \subset N \implies M \cap N = M$
+- Komplement
+ - $M \subset N \implies M \cup (N \setminus M) = N$
+ - $M \subset N \implies M \cap (N \setminus M) = \emptyset$
+- De Morgansche Regeln
+ - $M \setminus \bigcup_{i \in I} M_i = \bigcap_{i \in I} M \setminus M_i$
+ - $M \setminus \bigcap_{i \in I} M_i = \bigcup_{i \in I} M \setminus M_i$
+
+# Abbildungen
+
+::: defi
+Es seien $M$ und $N$ zwei Mengen. Eine **Abbildung** oder **Funktion**
+$f$ von $M$ nach $N$ ist eine *eindeutige Zuordnung*, die $jedem$
+Element $x \in M$ *genau ein* Element $f(x) \in N$ zuweist. Man
+verwendet den Begriff Funktion nur dann, wenn $N = \R$ ist.
+:::
+
+Man nennt $M$ den **Definitionsbereich** von $f$ und $N$ den **Ziel-**
+oder **Wertebereich**.
+
+*Notation*: $$f: M \to N,\ x \mapsto f(x)$$ Für zwei Abbildungen
+$f: M \to N$ und $g: X \to Y$ gilt:
+$$f = g \iff (M = X \land N = Y \land \forall x \in M : f(x) = g(x))$$
+
+## Legitime Abbildungen
+
+::: visu
+**Visualisierung**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b2);
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b1);
+\end{tikzpicture}\end{center}
+```
+:::
+
+## Illegitime Abbildungen
+
+::: visu
+**Visualisierung**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,fill=red,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,fill=red,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\end{tikzpicture}\end{center}
+```
+:::
+
+## Rechenregeln
+
+Mit den Abbildungen/Funktionen $f: U\to\R$, $g: V\to\R$ und $c\in\R$
+gilt:
+`\begin{gather*} c \cdot f: U\to\R \to \R: x \mapsto c \cdot f(x) \\ f + g: U \cap V \to \R: x \mapsto f(x) + g(x) \\ f - g: U \cap V \to \R: x \mapsto f(x) - g(x) \\ f \cdot g: U \cap V \to \R: x \mapsto f(x) \cdot g(x) \\ \end{gather*}`{=tex}
+Falls außerdem $\forall x \in U \cap V: g(x) \neq 0$:
+$$\frac{f}{g}: U \cap V \to \R: x \mapsto \frac{f(x)}{g(x)}$$
+
+## Selektionen
+
+### Einschränkung
+
+Mit der Abbildung $f: M \to N$ und $A \subset M$, ist
+$$f_{\vert A}: A \to N,\ x \mapsto f(x)$$ die **Einschränkung** von $f$
+auf $A$.
+
+::: bsp
+**Beispiel** mit $A = \{ b,c \}$:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b1);
+
+\node at (1,-1) {$f$};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$ $] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b1);
+
+\node at (1,-1) {$f_{\vert A}$};
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Identität
+
+Mit der Menge $M$ ist die Abbildung
+$$\text{id}_M : M \to M,\ x \mapsto x$$ die **Identität** auf $M$.
+
+::: bsp
+**Beispiel** mit $M = \{ 1,2,3 \}$:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$1$] (a1) at (0,3) {};
+\node[ele,label=left:$2$] (a2) at (0,2) {};
+\node[ele,label=left:$3$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+
+\node at (1,0) {$\text{id}_M$};
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Graph
+
+Mit der Abbildung $f: M \to N$ ist
+$$\text{Graph}(f) = \{ (x, f(x)) \mid x \in M \} \subset M \times N$$
+der **Graph** von $f$.
+
+::: bsp
+**Beispiel** mit Abbildung $f: \R\to\R,\ x \mapsto x^2$:
+
+```{=html}
+<!-- prettier-ignore -->
+```
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines = center]
+\addplot[domain=-5:5,color=red]{x*x};
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+:::
+
+- Für zwei Abbildungen $f: M \to N$ und $g: P \to N$ gilt:
+ $$f = g \iff \text{Graph}(f) = \text{Graph}(g)$$
+- Ist $\Gamma \subset M \times N$ so, dass
+ $$\forall x \in M\ \exists!\ y \in N: (x,y) \in \Gamma,$$ dann gibt
+ es eine Abbildung $f: M \to N$ mit $\Gamma = \text{Graph}(f)$
+
+### Bild
+
+Mit der Abbildung $f: M \to N$ und $A \subset M$ ist
+$$f(A) = \{ f(x) \mid x \in A \} \subset N$$ das **Bild** von $A$
+*unter* $f$.
+
+::: bsp
+**Beispiel** mit $f: \R\to\R,\ x \mapsto x^2$ und
+$A = \{ -2,-1,0,1,2 \} \subset M$: $$f(A) = \{ 0,1,4 \}$$
+:::
+
+$\text{im}(f) = f(M) \subset N$ heißt das **Bild** von $f$.
+Umgangssprachlich bezeichnet das die Menge des getroffenen Zielbereichs.
+
+::: bsp
+Mit vorigem **Beispiel**: $\text{im}(f) = \{ x\in\R \mid x \geq 0 \}$.
+:::
+
+### Urbild
+
+Mit der Abbildung $f: M \to N$ und $B \subset N$ ist
+$$f^{-1}(B) = \{ x \in M \mid f(x) \in B \} \subset M$$ das **Urbild**
+von $B$ unter $f$.
+
+::: bsp
+**Beispiel** mit $f: \R\to\R,\ x \mapsto x^2$ und
+$B = \{ 0, 1, 4 \} \subset N$: $$f^{-1}(B) = \{ -2,-1,0,1,2 \}$$
+:::
+
+Ist $y \in N$ und $x \in M$ mit $f(x) = y$, so nennt man $x$ **ein
+Urbild** von $y$ unter $f$.
+
+## Nachfolgerfunktion
+
+Die Abbildung $$\text{nf}: \N\to\N,\ x \mapsto x + 1$$ nennt man
+**Nachfolgerfunktion**. Es gilt
+$$\text{im}(\text{nf}) = \N \setminus \{ 0 \}$$ und
+$$\forall y \in \text{im}(f): \text{nf}^{-1}(\{ y \}) = \{ y - 1 \}$$
+
+## Eindeutigkeiten
+
+### Injektivität (linkseindeutig)
+
+Mit Abbildung $f: M \to N$:
+
+$$f \text{ ist injektiv} \iff \forall x,x' \in M: f(x) = f(x') \implies x = x'$$
+oder
+$$f \text{ ist injektiv} \iff \text{jedes } y \in N \text{ hat höchstens ein Urbild}$$
+oder $$f \text{ ist injektiv} \iff f \text{ ist linksinvertierbar}$$
+
+Es gilt: Bei injektivem $f$ gibt es eine oder keine Lösungen für
+$f(x) = y$.
+
+::: visu
+**Visualisierung**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+
+\node at (1,-1) {injektiv};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,fill=red,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+
+\node at (1,-1) {nicht injektiv};
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Surjektivität (rechtstotal)
+
+Mit Abbildung $f: M \to N$:
+
+$$f \text{ ist surjektiv} \iff \forall y \in N\ \exists x \in M: f(x) = y$$
+oder $$f \text{ ist surjektiv} \iff \text{im}(f) = N$$ oder
+$$f \text{ ist surjektiv} \iff \text{jedes } y \in N \text{ hat mindestens ein Urbild}$$
+oder $$f \text{ ist surjektiv} \iff f \text{ ist rechtsinvertierbar}$$
+
+Es gilt: Bei surjektivem $f$ gibt es eine oder mehrere Lösungen für
+$f(x) = y$.
+
+::: visu
+**Visualisierung**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b3);
+
+\node at (1,-1) {surjektiv};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,fill=red,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b3);
+
+\node at (1,-1) {nicht surjektiv};
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Bijektivität (eineindeutig)
+
+Mit Abbildung $f: M \to N$:
+
+$$f \text{ ist bijektiv} \iff f \text{ ist injektiv und surjektiv}$$
+oder
+$$f \text{ ist bijektiv} \iff g: N \to M \text{ existiert}: (g \circ f = \text{id}_M) \land (f \circ g = \text{id}_N)$$
+oder
+$$f \text{ ist bijektiv} \iff \text{jedes } y \in N \text{ hat genau ein Urbild}$$
+oder $$f \text{ ist bijektiv} \iff f \text{ ist invertierbar}$$
+
+Es gilt: Bei bijektivem $f$ gibt es genau eine Lösung für $f(x) = y$.
+
+::: visu
+**Visualisierung**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b1);
+
+\node at (1,-1) {bijektiv};
+\end{tikzpicture}
+\hspace{1cm}
+\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+\node[ele,label=left:$d$] (a4) at (0,0) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,fill=red,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+\node[ele,fill=red,label=right:$4$] (b4) at (2,0) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3) (b4),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b3);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b4);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a4) -- (b4);
+
+\node at (1,-1) {nicht bijektiv};
+\end{tikzpicture}\end{center}
+```
+:::
+
+## Komposition
+
+Mit den Abbildungen $f: M \to N$ und $g: N \to P$, ist
+$$g \circ f: M \to P,\ x \mapsto g(f(x))$$ die **Komposition** oder
+**Verkettung** von $f$ und $g$.
+
+::: bsp
+**Beispiel**:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$1$] (b1) at (2,3) {};
+\node[ele,label=right:$2$] (b2) at (2,2) {};
+\node[ele,label=right:$3$] (b3) at (2,1) {};
+
+\node[ele,label=right:$\alpha$] (c1) at (4,3) {};
+\node[ele,label=right:$\beta$] (c2) at (4,2) {};
+\node[ele,label=right:$\gamma$] (c3) at (4,1) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\node[draw,fit= (c1) (c2) (c3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (b1) ++(13pt,0) -- (c2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (b2) ++(18pt,0) -- (c1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (b3) ++(12pt,0) -- (c3);
+
+\node at (1,0) {$f: M \to N$};
+\node at (3,0) {$g: N \to P$};
+
+\draw[->,thick] (2,-1) -- (2, -2);
+\end{tikzpicture}\end{center}
+```
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$a$] (a1) at (0,3) {};
+\node[ele,label=left:$b$] (a2) at (0,2) {};
+\node[ele,label=left:$c$] (a3) at (0,1) {};
+
+\node[ele,label=right:$\alpha$] (c1) at (4,3) {};
+\node[ele,label=right:$\beta$] (c2) at (4,2) {};
+\node[ele,label=right:$\gamma$] (c3) at (4,1) {};
+
+\node[draw,fit= (a1) (a2) (a3),minimum width=1.4cm] {} ;
+\node[draw,fit= (c1) (c2) (c3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (c2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (c2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (c1);
+
+\node at (2,0) {$g \circ f: M \to P$};
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Assoziativität
+
+Mit den Abbildungen $f: M \to N$, $g: N \to P$ und $h: P \to Q$ gilt:
+$$(h \circ g) \circ f = h \circ (g \circ f),$$ weshalb man auch kurz
+$h \circ g \circ f$ schreibt.
+
+### Eindeutigkeiten unter Komposition
+
+Mit den Abbildungen $f: M \to N$ und $g: N \to P$ gilt:
+
+- Sind $f$ und $g$ injektiv, so ist $g \circ f$ injektiv.
+- Sind $f$ und $g$ surjektiv, so ist $g \circ f$ surjektiv.
+- Sind $f$ und $g$ bijektiv, so ist $g \circ f$ bijektiv.
+
+# Vollständige Induktion
+
+::: defi
+Sei $\mathcal{A}(n)$ eine Aussageform mit zulässigen Werten $n\in\N$.
+Falls $\mathcal{A}(0)$ wahr ist und
+$\mathcal{A}(n) \implies \mathcal{A}(n+1)$ wahr ist, so ist
+$\mathcal{A}(n)$ wahr für alle $n\in\N$.
+:::
+
+- `\enquote{$\mathcal{A}(0)$ wahr}`{=tex} nennt man den
+ *Induktionsanfang*
+- `\enquote{$\mathcal{A}(n)$ wird als wahr vorausgesetzt}`{=tex} nennt
+ man die *Induktionsvoraussetzung*
+- `\enquote{$\mathcal{A}(n) \implies \mathcal{A}(n + 1)$}`{=tex} nennt
+ man den *Induktionsschluss*
+
+# Mächtigkeit von Mengen
+
+::: defi
+- Eine Menge $M$ ist **endlich**, wenn sie nur endlich viele Elemente
+ enthält. In diesem Fall bezeichnet man mit $\#M = |M|$ die Anzahl an
+ Elementen in $M$ und nennt die Zahl die
+ **Mächtigkeit**/**Kardinalität** von $M$. Enthält $M$ unendlich
+ viele Elemente, so nennt man $M$ **unendlich** und setzt
+ $\#M = |M| = \infty$.
+- Zwei Mengen $M$ und $N$ heißen **gleichmächtig**, wenn es eine
+ bijektive Abbildung $f: M \to N$ gibt.
+- Eine Menge heißt **abzählbar unendlich**, wenn sie gleichmächtig zu
+ $\N$ ist.
+- Eine Menge heißt **überabzählbar**, wenn sie weder endlich noch
+ abzählbar unendlich ist.
+- Für $m,n\in\Z$ bezeichnet man mit
+ $$\{ m,...,n \} = \{ k\in\Z \mid m \leq k \leq n \}$$ die Menge der
+ ganzen Zahlen zwischen $m$ und $n$.
+:::
+
+## Eigenschaften endlicher Mengen
+
+- Ist eine Menge endlich und enthält genau $n$ Elemente, so kann man
+ die Elemente in $M$ mit $x_1,x_2,x_3,...,x_n$ abzählen und man
+ erhält eine bijektive Abbildung
+ $$f: \{ 1,...,n \} \to M: i \mapsto x_i.$$ Umgekehrt erlaubt eine
+ solche Abbildung, die Elemente von $M$ abzuzählen und man erhält
+ $|M| = n$. Damit sieht man, dass eine Menge genau dann endlich von
+ Mächtigkeit $n$ ist, wenn es eine Bijektion von $\{ 1,...n \}$ nach
+ $M$ gibt.
+- Ist die Menge $M$ endlich und $A \subset M$, so ist auch $A$ endlich
+ und $|A| \leq |M|$.
+- Ist $M = A \cupdot B$ eine endliche Menge, so gilt
+ $|M| = |A| + |B|$.
+
+**Zusammenhang zwischen Mächtigkeit und Abbildung**:
+
+Mit den nicht-leeren endlichen Mengen $M$ und $N$ gilt:
+
+- $|M| \leq |N| \iff$ eine injektive Abbildung $f: M \to N$ existiert
+- $|M| \geq |N| \iff$ eine surjektive Abbildung $f: M \to N$ existiert
+- $|M| = |N| \iff$ eine bijektive Abbildung $f: M \to N$ existiert
+
+## Schubfachprinzip
+
+Aus dem Zusammenhang zwischen Mächtigkeit und Abbildung folgt
+$$f: M \to N \text{ ist eine Abbildung und } |M| > |N| \implies f \text{ ist nicht injektiv}.$$
+Diese Kontraposition nennt man auch das **Schubfachprinzip**.
+Umgangssprachlich heißt das: Wenn man $m > n$ Gegenstände auf $n$
+Schubfächer verteilen möchte, dann muss man in mindestens ein Schubfach
+zwei legen.
+
+::: bsp
+**Beispiel** des Versuchs einer Konstruktion einer injektiven Abbildung
+trotz $|M| > |N|$ mit $M = \{ 1,2,3,4 \}$ und $N = \{ a,b,c \}$:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[ele/.style={fill=black,circle,minimum width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner sep=-2pt}]
+\node[ele,label=left:$1$] (a1) at (0,3) {};
+\node[ele,label=left:$2$] (a2) at (0,2) {};
+\node[ele,label=left:$3$] (a3) at (0,1) {};
+\node[ele,fill=red,label=left:$4$] (a4) at (0,0) {};
+
+\node[ele,label=right:$a$] (b1) at (2,3) {};
+\node[ele,label=right:$b$] (b2) at (2,2) {};
+\node[ele,label=right:$c$] (b3) at (2,1) {};
+
+\node[draw,fit= (a1) (a2) (a3) (a4),minimum width=1.4cm] {} ;
+\node[draw,fit= (b1) (b2) (b3),minimum width=1.4cm] {} ;
+\draw[->,thick,shorten <=2pt,shorten >=2] (a1) -- (b1);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a2) -- (b2);
+\draw[->,thick,shorten <=2pt,shorten >=2] (a3) -- (b3);
+
+\node at (1,-1) {Injektivität nicht möglich};
+\end{tikzpicture}\end{center}
+```
+:::
+
+# Äquivalenzrelationen
+
+::: defi
+Mit den Mengen $M$ und $N$, ist jede Teilmenge $R \subset M \times N$
+eine **Relation** zwischen $M$ und $N$. Für $x \in M$ und $y \in N$
+schreibt man auch $xRy$ statt $(x,y) \in R$, wenn $x$ in Relation zu $y$
+bezüglich $R$ steht.
+:::
+
+Für die Äquivalenzrelation $R$ auf die Menge $M$ gilt die Notation:
+$$x \sim y \iff (x,y) \in R.$$
+
+## Axiome
+
+1. *Reflexivität*: $x \sim x$
+2. *Symmetrie*: $x \sim y \implies y \sim x$
+3. *Transitivität*: $x \sim y \land y \sim z \implies x \sim z$
+
+::: bsp
+**Beispiel** einer abstrakten Alltagssituation: In einer Schule werden
+SchülerInnen klassisch in Schulklassen unterteilt. Übertragen sind die
+Axiome dann für die Schüler Alfred, Ben und Christoph:
+
+1. Alfred gehört zu einer Schulklasse: Er ist in derselben Schulklasse
+ wie er selbst.
+2. Wenn Alfred in derselben Schulklasse ist wie Ben, dann ist Ben auch
+ in derselben Schulklasse wie Alfred.
+3. Wenn Alfred in derselben Schulklasse ist wie Ben und wenn zugleich
+ Ben in derselben Schulklasse ist wie Christoph, dann ist auch Alfred
+ in derselben Schulklasse wie Christoph.
+
+In diesem Fall ist dann die Relation
+`\enquote{SchülerIn $x$ ist in derselben Schulklasse wie SchülerIn $y$}`{=tex}
+die *Äquivalenzrelation*, die SchülerInnen derselben Schulklasse
+*äquivalent* und die Schulklassen die *Äquivalenzklassen*.
+:::
+
+**Visualisierung** zu vorigem Beispiel (wunderschön):
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
+% Generated using mathcha.io
+\draw [fill={rgb, 255:red, 216; green, 216; blue, 216 } ,fill opacity=0.38 ] (10.08,222.25) .. controls (10.08,106.27) and (152.23,12.25) .. (327.58,12.25) .. controls (502.93,12.25) and (645.08,106.27) .. (645.08,222.25) .. controls (645.08,338.23) and (502.93,432.25) .. (327.58,432.25) .. controls (152.23,432.25) and (10.08,338.23) .. (10.08,222.25) -- cycle ;
+\draw [color={rgb, 255:red, 255; green, 0; blue, 0 } ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=0.07 ] (45,224.63) .. controls (45,156.9) and (106.8,102) .. (183.04,102) .. controls (259.28,102) and (321.08,156.9) .. (321.08,224.63) .. controls (321.08,292.35) and (259.28,347.25) .. (183.04,347.25) .. controls (106.8,347.25) and (45,292.35) .. (45,224.63) -- cycle ;
+\draw [color={rgb, 255:red, 0; green, 56; blue, 255 } ,draw opacity=1 ][fill={rgb, 255:red, 0; green, 36; blue, 255 } ,fill opacity=0.09 ] (294,112.13) .. controls (294,66.77) and (334.54,30) .. (384.54,30) .. controls (434.55,30) and (475.08,66.77) .. (475.08,112.13) .. controls (475.08,157.48) and (434.55,194.25) .. (384.54,194.25) .. controls (334.54,194.25) and (294,157.48) .. (294,112.13) -- cycle ;
+\draw [color={rgb, 255:red, 0; green, 255; blue, 18 } ,draw opacity=1 ][fill={rgb, 255:red, 0; green, 255; blue, 64 } ,fill opacity=0.15 ] (319,292.13) .. controls (319,238.48) and (380.8,195) .. (457.04,195) .. controls (533.28,195) and (595.08,238.48) .. (595.08,292.13) .. controls (595.08,345.77) and (533.28,389.25) .. (457.04,389.25) .. controls (380.8,389.25) and (319,345.77) .. (319,292.13) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (132.45,169.89) -- (152.06,172.25) -- (149.92,191.88) -- (145.56,186.38) -- (123.81,203.66) -- (128.18,209.15) -- (108.57,206.8) -- (110.71,187.17) -- (115.08,192.66) -- (136.82,175.39) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (171.25,236.85) -- (182.75,256.14) -- (161.41,263.16) -- (163.87,256.58) -- (131.04,244.31) -- (128.58,250.88) -- (117.08,231.59) -- (138.41,224.58) -- (135.95,231.15) -- (168.79,243.43) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (225.02,221) -- (219.54,243.94) -- (199.19,232.02) -- (205.65,229.26) -- (190.78,194.41) -- (184.32,197.16) -- (189.8,174.23) -- (210.15,186.14) -- (203.69,188.9) -- (218.56,223.75) -- cycle ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (141.42,125.91) .. controls (144.77,122.76) and (157.93,131.32) .. (170.82,145.04) -- (164.76,150.74) .. controls (151.87,137.03) and (138.7,128.46) .. (135.35,131.61) ;\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (135.35,131.61) .. controls (132.69,134.11) and (137.01,143.23) .. (145.35,153.75) -- (143.33,155.65) -- (155.66,159.29) -- (153.44,146.15) -- (151.42,148.05) .. controls (143.08,137.53) and (138.76,128.4) .. (141.42,125.91)(135.35,131.61) -- (141.42,125.91) ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (280,228.97) .. controls (283.26,232.22) and (275.13,245.66) .. (261.84,258.99) -- (255.94,253.11) .. controls (269.23,239.78) and (277.36,226.34) .. (274.11,223.09) ;\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (274.11,223.09) .. controls (271.52,220.52) and (262.54,225.14) .. (252.3,233.82) -- (250.34,231.86) -- (247.1,244.3) -- (260.17,241.65) -- (258.2,239.69) .. controls (268.44,231.01) and (277.42,226.4) .. (280,228.97)(274.11,223.09) -- (280,228.97) ;
+\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (71.28,251.71) .. controls (67.32,249.24) and (69.89,233.12) .. (77.02,215.69) -- (84.19,220.16) .. controls (77.06,237.58) and (74.49,253.71) .. (78.45,256.17) ;\draw [fill={rgb, 255:red, 255; green, 0; blue, 0 } ,fill opacity=1 ] (78.45,256.17) .. controls (81.59,258.13) and (87.9,250.9) .. (93.93,239.12) -- (96.32,240.61) -- (94.94,226.86) -- (84.38,233.17) -- (86.76,234.66) .. controls (80.73,246.43) and (74.42,253.66) .. (71.28,251.71)(78.45,256.17) -- (71.28,251.71) ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (417.45,243.89) -- (437.06,246.25) -- (434.92,265.88) -- (430.56,260.38) -- (408.81,277.66) -- (413.18,283.15) -- (393.57,280.8) -- (395.71,261.17) -- (400.08,266.66) -- (421.82,249.39) -- cycle ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (458.25,313.85) -- (469.75,333.14) -- (448.41,340.16) -- (450.87,333.58) -- (418.04,321.31) -- (415.58,327.88) -- (404.08,308.59) -- (425.41,301.58) -- (422.95,308.15) -- (455.79,320.43) -- cycle ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (513.48,300.42) -- (508.49,324.5) -- (487.65,311.44) -- (494.11,308.69) -- (478.26,271.55) -- (471.81,274.31) -- (476.8,250.23) -- (497.64,263.28) -- (491.18,266.04) -- (507.03,303.18) -- cycle ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (428.42,203.91) .. controls (431.77,200.76) and (444.93,209.32) .. (457.82,223.04) -- (451.76,228.74) .. controls (438.87,215.03) and (425.7,206.46) .. (422.35,209.61) ;\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (422.35,209.61) .. controls (419.69,212.11) and (424.01,221.23) .. (432.35,231.75) -- (430.33,233.65) -- (442.66,237.29) -- (440.44,224.15) -- (438.42,226.05) .. controls (430.08,215.53) and (425.76,206.4) .. (428.42,203.91)(422.35,209.61) -- (428.42,203.91) ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (558,304.97) .. controls (561.26,308.22) and (553.13,321.66) .. (539.84,334.99) -- (533.94,329.11) .. controls (547.23,315.78) and (555.36,302.34) .. (552.11,299.09) ;\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (552.11,299.09) .. controls (549.52,296.52) and (540.54,301.14) .. (530.3,309.82) -- (528.34,307.86) -- (525.1,320.3) -- (538.17,317.65) -- (536.2,315.69) .. controls (546.44,307.01) and (555.42,302.4) .. (558,304.97)(552.11,299.09) -- (558,304.97) ;
+\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (357.28,329.71) .. controls (353.32,327.24) and (355.89,311.12) .. (363.02,293.69) -- (370.19,298.16) .. controls (363.06,315.58) and (360.49,331.71) .. (364.45,334.17) ;\draw [fill={rgb, 255:red, 0; green, 255; blue, 91 } ,fill opacity=1 ] (364.45,334.17) .. controls (367.59,336.13) and (373.9,328.9) .. (379.93,317.12) -- (382.32,318.61) -- (380.94,304.86) -- (370.38,311.17) -- (372.76,312.66) .. controls (366.73,324.43) and (360.42,331.66) .. (357.28,329.71)(364.45,334.17) -- (357.28,329.71) ;
+\draw [fill={rgb, 255:red, 0; green, 19; blue, 255 } ,fill opacity=1 ] (347.56,81.47) .. controls (351.45,77.84) and (365.02,86.04) .. (377.87,99.8) -- (370.81,106.39) .. controls (357.97,92.63) and (344.4,84.42) .. (340.5,88.06) ;\draw [fill={rgb, 255:red, 0; green, 19; blue, 255 } ,fill opacity=1 ] (340.5,88.06) .. controls (337.55,90.82) and (341,99.59) .. (348.44,109.67) -- (346.09,111.86) -- (360.23,116.27) -- (357.85,100.89) -- (355.5,103.08) .. controls (348.06,93) and (344.6,84.23) .. (347.56,81.47)(340.5,88.06) -- (347.56,81.47) ;
+
+\draw (153,153) node [anchor=north west][inner sep=0.75pt] [align=left] {Antonia};
+\draw (84,207) node [anchor=north west][inner sep=0.75pt] [align=left] {Benny};
+\draw (187,245) node [anchor=north west][inner sep=0.75pt] [align=left] {Christoph};
+\draw (440,230) node [anchor=north west][inner sep=0.75pt] [align=left] {Anne};
+\draw (371,284) node [anchor=north west][inner sep=0.75pt] [align=left] {Freddi};
+\draw (474,322) node [anchor=north west][inner sep=0.75pt] [align=left] {Dominik};
+\draw (360,105) node [anchor=north west][inner sep=0.75pt] [align=left] {Lars};
+\draw (150,52) node [anchor=north west][inner sep=0.75pt] [align=left] {\textbf{\underline{Alle SchülerInnen}}};
+\draw (232,158) node [anchor=north west][inner sep=0.75pt] [font=\normalsize,color={rgb, 255:red, 0; green, 0; blue, 0 } ,opacity=1 ] [align=left] {\textbf{\underline{Klasse 1}}};
+\draw (350,40) node [anchor=north west][inner sep=0.75pt] [align=left] {\textbf{\underline{Klasse 2}}};
+\draw (511.17,240) node [anchor=north west][inner sep=0.75pt] [align=left] {\textbf{\underline{Klasse 3}}};
+\end{tikzpicture}\end{center}
+```
+## Äquivalenzklassen
+
+Mit der Menge $M$ und der Äquivalenzrelation $\sim$ auf $M$, heißt für
+$x \in M$ die Menge $$[x] = \{ y \in M \mid y \sim x \}$$ die
+**Äquivalenzklasse** von $x$. Jedes $y \in [x]$ heißt ein
+**Repräsentant** der Klasse $[x]$.
+
+::: bsp
+Mit dem vorigen **Beispiel** gilt:
+$$[\text{Alfred}] = \{ \text{Alfred, Ben, Christoph} \},$$ sowie
+$$[\text{Alfred}] = [\text{Ben}] = [\text{Christoph}].$$
+:::
+
+------------------------------------------------------------------------
+
+Mit $$M/{\sim} = \{ [x] \mid x \in M \}$$ bezeichnet man die Menge der
+**Äquivalenzklassen modulo der Äquivalenzrelation** $\sim$.
+
+::: bsp
+Mit dem vorigen **Beispiel** gilt:
+$$M/{\sim} = \{ [\text{Alfred}], [\text{Ben}], [\text{Christoph}], [\text{Philipp}], [\text{Anne}], [\text{Dominik}], [\text{Freddi}] \}.$$
+:::
+
+## Disjunkte Zerlegung
+
+Ist $(M_i)_{i \in I}$ eine disjunkte Zerlegung der Menge $M$ und die
+Relation auf $M$ $$x \sim y \iff \exists i \in I : x,y \in M_i,$$ dann
+ist $\sim$ eine Äquivalenzrelation auf $M$.
+
+------------------------------------------------------------------------
+
+Ist $\sim$ eine Äquivalenzrelation auf der Menge $M$, dann bilden die
+Äquivalenzklassen eine disjunkte Zerlegung von $M$, d.h. jedes $x \in M$
+liegt in genau einer Äquivalenzklasse. Insbesondere gilt für
+Äquivalenzklassen $[x]$ und $[y]$ entweder $[x] = [y]$ oder
+$[x] \cap [y] = \emptyset$.
+
+::: bsp
+Voriges **Beispiel** der Schulklassen ist hilfreich um zu sehen, dass
+kein Repräsentant in zwei Äquivalenzklassen gleichzeitig sein kann und
+damit eine disjunkte Zerlegung der SchülerInnen vorliegen muss.
+:::
+
+## Kongruenz modulo $n$
+
+Mit $n\in\Z_{>0}$ und $a,b\in\Z$ wird die Äquivalenzrelation $\equiv$
+definiert: $$a \equiv b \pmod{n} \iff n \mid a - b$$ Das heißt, die
+Reste der ganzzahligen Division von $a$ mit $n$, sowie von $b$ mit $n$,
+müssen gleich sein. Zwei äquivalente Zahlen $a$ und $b$ werden dann auch
+**kongruent modulo $n$** genannt.
+
+::: bsp
+**Beispiel** mit $5 \equiv 11 \pmod{3}$:
+
+Die Aussage ist wahr, da $\frac{5}{3} = 1 \text{ Rest } 2$ und
+$\frac{11}{3} = 3 \text{ Rest } 2$ die gleichen Reste besitzen bzw. auch
+$3 \mid (11 - 5) = 3 \mid 6$ wahr ist.
+:::
+
+Man bezeichnet die Äquivalenzklasse von $a\in\Z$ mit
+$$[a] = \{ a+kn \mid k\in\Z \} = \{ b\in\Z \mid a \equiv b \pmod{n} \}$$
+Die Menge der Äquivalenzklassen ist $$\Z/n\Z = \{ [a] \mid a\in\Z \}$$
+und es gilt $|\Z/n\Z| = n$.
+
+### Teilbarkeit in Kongruenz
+
+Mit $a\in\Z$ und $n > 1$ ist die Kongruenz $$ax \equiv b \pmod{n}$$
+genau dann für alle $b\in\Z$ lösbar, wenn $\mathrm{ggT}(a,n) = 1$ gilt,
+also wenn $$ax \equiv 1 \pmod{n}$$ lösbar ist.
+
+::: bsp
+**Beispiel** mit $n=27$ und $a=5$: Es gilt $\mathrm{ggT}(5,27) = 1$.
+Dann ist $$5 \cdot z \equiv b \pmod{27}$$ lösbar für jedes $b\in\Z$. Es
+gilt $$5 \cdot 11 \equiv 1 \pmod{27}$$ und allgemein für
+$z = 11 \cdot b$:
+$$5 \cdot (11 \cdot b) \equiv (5 \cdot 11) \cdot b \equiv b \pmod{27}.$$
+:::
+
+Als direkte Konsequenz gilt dann: Mit $a\in\Z$, $n>1$ und
+$[a] \in\Z/n\Z$ gilt
+$$[a] \text{ ist invertierbar in } \Z/n\Z\quad\iff\quad\mathrm{ggT}(a,n) = 1$$
+
+Jene invertierbaren Restklassen in $\Z/n\Z$ bezeichnet man dann als
+**prime Restklassen** modulo $n$ und die Menge der Restklassen (modulo
+$n$) als **prime Restklassengruppe** $(\Z/n\Z)^*$) (modulo $n$).
+Außerdem wird die **Euler'sche $\varphi$-Funktion** für $n\in\N$
+definiert durch
+$$\varphi(n) := \begin{cases}1, &\text{wenn } n=1\\\#(\Z/n\Z)^*, &\text{wenn } n>1\end{cases}$$
+wobei
+$$\#(\Z/n\Z)^* = \#\{i\in\N \mid i < n \text{ und } \mathrm{ggT}(i,n) = 1 \}.$$
+
+::: bsp
+**Beispiel**: $$\varphi(p) = p - 1\quad\text{für } p\in\P$$
+$$\varphi(12) = 4 \text{ und } (\Z/n\Z)* = \{ 1,5,7,11 \}$$
+:::
+
+# Primzahlen
+
+::: defi
+- Zu jeder Zahl $a\in\Z$ und $b\in\N_{>0}$ gibt es eindeutig bestimmte
+ Zahlen $q,r\in\Z$ mit $$a = qb + r,\quad 0 \leq r < b.$$ Dabei ist
+ $q$ der **Quotient** und $r$ der **Rest der Division** von $a$ und
+ $b$.
+- Für eine Primzahl $p\in\P$ gilt mit $a,b\in\Z$:
+ $$p \mid a \cdot b \implies p \mid a \lor p \mid b.$$
+- Die Menge $\P$ der Primzahlen ist unendlich.
+:::
+
+## Fundamentalsatz der Arithmetik
+
+Jedes $n\in\N \setminus \{0;1\}$ hat eine eindeutige Zerlegung
+$$n=p_1^{v_1} \cdot p_2^{v_2} \cdot ... \cdot p_r^{v_r}$$ mit Primzahlen
+$p_1 < p_2 < ... < p_r$ und $v_1, ..., v_r \in \N_{>0}$. Diese Zerlegung
+nennt man die **Primfaktorzerlegung** von $n$.
+
+TODO: Erathostenes, ggT, euklidischer Algorithmus
+
+# Gruppen
+
+::: defi
+Eine **Gruppe** ist ein Paar $(G,*)$ bestehend aus einer *nicht-leeren*
+Menge $G$ und einer zweistelligen Operation `\enquote{$*$}`{=tex}, d.h.
+einer Abbildung $$*: G \times G \to G: (g,h) \mapsto g * h,$$ sodass
+folgende *Gruppenaxiome* gelten:
+
+1. *Assoziativgesetz*: $(g * h) * k = g * (h * k)\ \forall g,h,k \in G$
+2. *Existenz eines Neutralen*:
+ $\exists e \in G: \forall g \in G: e * g = g$
+3. *Existenz von Inversen*:
+ $\forall g \in G: \exists g^{-1} \in G: g^{-1} * g = e$
+
+Eine Gruppe $(G,*)$ heißt **abelsch** oder **kummutativ**, wenn $(G,*)$
+zudem noch dem folgenden Axiom genügt:
+
+4. *Kommutativgesetz*: $g * h = h * g\ \forall g,h \in G$
+:::
+
+## Eigenschaften
+
+- Aufgrund der Axiome erhält man folgende Eigenschaften für eine
+ Gruppe $(G,*)$:
+
+ - Das neutrale Element $e \in G$ ist eindeutig bestimmt und hat
+ die Eigenschaft $$e * g = g * e = g\quad\forall g \in G$$
+ - Mit $g \in G$ ist das inverse Element $g^{-1}$ zu $g$ eindeutig
+ bestimmt und hat die Eigenschaft $$g^{-1} * g = g * g^{-1} = e$$
+ - Für $g,h \in G$ gelten $(g^{-1})^{-1} = g$ und
+ $(g * h)^{-1} = h^{-1} * g^{-1}$
+
+- Häufig wird `\enquote{$*$}`{=tex} die **Gruppenmultiplikation**
+ genannt.
+
+- Ist $(G,*)$ eine Gruppe mit endlich vielen Elementen $n\in\N$, so
+ bezeichnet man mit $\#G = |G| = n$ die **Ordnung** der Gruppe.
+
+## Kürzungsregeln
+
+Für die Gruppe $(G,*)$ gilt mit $g,a,b \in G$:
+
+- $g * a = g * b \implies a = b$
+- $a * g = b * g \implies a = b$
+
+## Multiplikative Gruppe
+
+Wird die Gruppenoperation als Multiplikation und mit
+`\enquote{$\cdot$}`{=tex} bezeichnet, so schreibt man
+
+- für das Neutrale Element $1_G$ bzw. 1
+- für das Inverse zu $g$ $g^{-1}$ oder $\frac{1}{g}$
+- häufig das Multiplikationszeichen nicht, wenn die Bedeutung klar
+ ersichtlich ist (z.B. $gh$ statt $g \cdot h$)
+- für das Produkt von $g1,...,g_n \in G$
+ $$\prod_{i=1}^n g_i = g_1 \cdot g_2 \cdot ... \cdot g_n$$
+
+Außerdem gelten normale multiplikative Potenzgesetze. Allerdings gilt
+$$(g \cdot h)^n = g^n \cdot h^n$$ **nicht** in nicht-abelschen Gruppen,
+da z.B. mit $n = 4$ Kommutativität notwendig ist:
+
+::: bsp
+**Beispiel**:
+`\begin{splitty}(g \cdot h)^n &= g^n \cdot h^n \\ \implies (g \cdot h)^4 &= g^4 \cdot h^4 \\ \implies (g \cdot h) \cdot (g \cdot h) \cdot (g \cdot h) \cdot (g \cdot h) &= (g \cdot g \cdot g \cdot g) \cdot (h \cdot h \cdot h \cdot h) \\ \implies g \cdot h \cdot g \cdot h \cdot g \cdot h \cdot g \cdot h &= g \cdot g \cdot g \cdot g \cdot h \cdot h \cdot h \cdot h \end{splitty}`{=tex}
+:::
+
+## Additive Gruppe
+
+Wird die Gruppenoperation als Addition und mit `\enquote{$+$}`{=tex}
+bezeichnet, so schreibt man
+
+- für das Neutrale Element meist $0_G$ bzw. 0
+- für das Inverse zu $g$ meist $-g$ und meist $g - h$ statt $g + (-h)$
+- für die Summe von $g1,...,g_n \in G$
+ $$\sum_{i=1}^n g_i = g_1 + g_2 + ... + g_n$$
+
+Außerdem gelten normale additive Rechenregeln. Insbesondere muss man bei
+Rechnungen aufpassen, die je nach Variablen unterschiedliche Operationen
+mit gleichem Symbol nutzen. **Beispiel** mit $g,h \in G$ und
+$m,n \in \Z$:
+
+- $\underbrace{(m + n)}_{\text{Add. in } \Z}g = \underbrace{mg + ng}_{\text{Add. in } G}$
+- $n \cdot \underbrace{(m + n)}_{\text{Add. in } G} = \underbrace{ng + nh}_{\text{Add. in } G}$
+- $0_\Z \cdot g = 0_G$
+- $n \cdot 0_G = 0_G$
+
+## Permutationsgruppe
+
+Eine **Permutation** ist eine bijektive Abbildung einer endlichen Menge
+auf sich selbst. Für ein $n\in\N$ verwendet man im Allgemeinen die Menge
+$\{ 1,...,n \}$ und schreibt die Permutation
+$$\begin{split}\sigma:\quad\{1,...,n\}\quad &\to \quad \{1,...,n\}\\\quad i \quad &\mapsto \quad \sigma(i)\end{split}$$
+als Tabelle
+$$\sigma = \begin{pmatrix}1&2&...&n\\\sigma(1)&\sigma(2)&...&\sigma(n)\end{pmatrix}.$$
+
+::: bsp
+**Beispiel** mit $n=4$:
+$$\sigma = \begin{pmatrix}1&2&3&4\\2&3&1&4\end{pmatrix}$$ Die
+Permutation (bijektive Abbildung (!)) ist dann
+`\begin{gather*}1\mapsto2\\2\mapsto3\\3\mapsto1\\4\mapsto4\end{gather*}`{=tex}
+:::
+
+## Symmetrische Gruppe
+
+Die **Menge aller Permutationen** von $\{1,...,n\}$ wird mit $S_n$
+bezeichnet und bildet mit der Komposition "$\circ$" von Abbildungen als
+Gruppenoperation ("Gruppenmultiplikation")
+`\begin{splitty}\circ:\quad S_n\times S_n &\to S_n\\(\sigma,\tau) &\mapsto \sigma \circ \tau\end{splitty}`{=tex}
+eine Gruppe $(S_n, \circ)$ die für $n > 2$ nicht abelsch ist. Diese
+Gruppe nennt man die **Permutationsgruppe** oder die **Symmetrische
+Gruppe der Ordnung $n$**. Es gilt $S_n = \mathrm{Sym}(\{1,...,n\})$.
+
+Eine Permutation, die nur zwei Elemente vertauscht, heißt
+**Transposition** (2-Zykel).
+
+::: bsp
+**Beispiel** 1:
+$$\sigma = \begin{pmatrix}1&2&3&4&5&6&7\\2&3&1&4&5&7&6\end{pmatrix}\quad\text{Zykelschreibweise: }\sigma = (1,2,3)(4)(5)(6,7) = (1,2,3)(6,7)$$
+**Beispiel** 2: $$\sigma = (1,2,3)(6,7) = (1,2)(2,3)(6,7)$$ Dann ist
+`\begin{splitty}\sigma(7)&=6\\\sigma(6)&=7\\\sigma(4)&=4\\\sigma(5)&=5\\\sigma(1)&=2\\\sigma(2)&=3\\\sigma(5)&=1\end{splitty}`{=tex}
+:::
+
+Hat $\sigma \in S_n$ zwei Zerlegungen in Transpositionen
+$\sigma_1,...,\sigma_k\in S_n$ und $\tau_1,...,\tau_l\in S_n$, d.h.
+$$\sigma = \sigma_1...\sigma_k=\tau_1...\tau_l,$$ dann gilt
+$k\equiv l \pmod{2}$ und man bezeichnet die **Signatur** von $\sigma$
+mit
+$$\mathrm{sign}(\sigma) = (-1)^{\text{Anzahl von Transpositionen in einer Darstellung von $\sigma$}}.$$
+Man nennt eine Permutation $\sigma$ **gerade**, wenn
+$\mathrm{sign}(\sigma)=1$ und **ungerade**, wenn
+$\mathrm{sign}(\sigma) = -1$ ist.
+
+## Untergruppen
+
+::: defi
+Mit der Gruppe $(G,*)$ mit neutralem Element $e \in G$, heißt die
+Teilmenge $U \subset G$ **Untergruppe** von $G$, wenn gilt:
+
+1. $e \in U$
+2. $g,h \in U \implies g * h \in U$
+3. $g \in U \implies g^{-1} \in U$
+:::
+
+::: bsp
+**Beispiel**: Die Menge der Vielfache einer Zahl $n$, d.h. die Menge
+$n\Z = \{ n\cdot k \mid k \in \Z \}$, bildet eine Untergruppe von
+$(\Z, +)$.
+:::
+
+## Nebenklassen
+
+### Motivation
+
+$\Z = \{ ..., -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, ...\}$, dann ist
+$\{...,-3,0,3,6,...\} = 3\Z$ eine Untergruppe von $Z$.
+$\{...,-2,1,4,7,...\} = 1+3\Z$ sowie $\{...,-1,2,5,8,...\} = 2+3\Z$ sind
+allerdings keine Untergruppen, aber **Nebenklassen**.
+
+### Definition
+
+Mit der Untergruppe $U\subset G$ und $g\in G$, ist die
+**Linksnebenklasse** von $g$ bezüglich $U$ in $G$ die Menge
+$$g * U = \{ g * u \mid u \in U \}.$$ Die **Menge der
+Linksnebenklassen** ist dann $$G/U = \{ g * U \mid g \in G \}.$$ Die
+**Rechtsnebenklasse** von $g$ bezüglich $U$ in $G$ ist die Menge
+$$U * g = \{ u * g \mid u \in U \}.$$ Die **Menge der
+Rechtsnebenklassen** ist analog enstprechend
+$$U\backslash G = \{ U * g \mid g \in G \}.$$
+
+------------------------------------------------------------------------
+
+Mit der Untergruppe $U\subset G$ und $g,h \in G$ gilt:
+
+1. $g * U = h * U \quad\iff\quad h^{-1} * g\quad\in U.$
+
+ **Beispiel**: $1+3\Z = 10 + 3\Z \implies (-10) + 1\quad\in 3\Z.$
+
+2. Je zwei verschiedene Nebenklassen sind disjunkt.
+
+3. Die Abbildung $f: U \to g*U$ mit $f(u) = g * u$ ist eine Bijektion.
+
+4. Die Anzahl der Linksnebenklassen von $U$ in $G$ ist gleich der
+ Anzahl der Rechtsnebenklassen von $U$ in $G$. Diese Anzahl heißt
+ **Index** $$[G : U] := |G/U| = |U\backslash G|$$ von $U$ in $G$.
+
+### Satz von Lagrange
+
+Mit der Untergruppe $U \subset G$ gilt $$|G| = |U| \cdot [G : U].$$ Es
+folgt, dass *die Ordnung einer jeden Untergruppe die Gruppenordnung
+teilen muss*.
+
+::: bsp
+**Beispiel** bei Primzahlen: Mit $p\in\P$ gilt: Wenn $-1$ ein Quadrat in
+$Z/p\Z$ ist, so ist $p-1$ durch $4$ teilbar.
+
+```{=tex}
+\begin{proof} Mithilfe des Satz von Lagrange:\\
+$\exists i \in \Z/p\Z:\ i^2=-1$. Dann ist $U = \{ 1,-1,i,-i \} \subset (Z/p\Z)^*$ mit $|U| = 4$. Es gilt demnach: $$p-1 = |(\Z/p\Z)^*| = |U| \cdot [(\Z/p\Z)^* : U]$$ und deshalb $4 \mid (p-1)$.
+\end{proof}
+```
+:::
+
+## Zyklische Gruppen
+
+Mit der Gruppe $S \subset G$ ist das **Erzeugnis** von $S$ bzw. die von
+$S$ **erzeugte Untergrupppe** definiert mit
+$$\braket{S} = \bigcap \{ U \subset G \mid U \text{ ist Untergruppe von } G \text{ mit } S \subset U \}.$$Ist
+$S = \{ g_1,g_2,... \}$ gegeben, schreibt man
+$$\braket{g_1,g_2,...} = \bigcap \{ U \subset G \mid U \text{ ist Untergruppe von } G \text{, die } g_1, g_2, ... \text{ enthält} \}.$$
+
+Insbesondere für $g\in G$ ist $\braket{g} = \{ g^k \mid k\in\Z \}$ die
+von $g$ **erzeugte zyklische Untergruppe**. Die **Ordnung** von $g$ ist
+die Ordnung von $\braket{g}$.
+
+Allgemein: Ist $G = \braket{g}$ für ein $g\in G$, dann heißt $G$
+zyklisch.
+
+::: bsp
+**Beispiel**:
+
+1. $(\Z, +)$: $\Z = \braket{1} = \{ k \cdot 1 \mid k\in\Z \}$.
+2. $(\Z/n\Z, +)$ ist eine zyklische Gruppe.
+3. $((\Z/5\Z)^*, \cdot) \ni [1]$:
+ $\braket{[1]} = \braket{1_{(\Z/5\Z)^*}} = \braket{1} = \{ [1]^k \mid k\in\Z \} = \{ [1^k] \mid k\in\Z \} = \{ [1] \}$.
+ $$\braket{[2]} = \{ [2]^0, [2]^1, [2]^2, [2]^3, [2]^4 \}$$
+ $$\implies |\braket{[2]}| = 4 \mid (5 - 1) = |(\Z/5\Z)^*|$$
+:::
+
+Mit der endlichen Gruppe $G$ und $g\in G$ gilt:
+$$|\braket{g}| \mid |G|.$$
+
+Außerdem gilt mit der Gruppe $G$ und $g\in G$: Die Ordnung von $g$ ist
+unendlich und die kleinste positive ganze Zahl $k$ mit $g^k = e$, wobei
+$e$ das neutrale Element der Gruppe ist. Demnach folgt:
+
+### Kleiner Satz von Fermat
+
+Ist $G$ eine endliche Gruppe, so gilt für alle Elemente $g\in G$:
+$$g^{|G|} = e.$$
+
+### Satz von Euler
+
+Mit $n\in \N_{>0}$ und $a \in \{ 1,2,...,n-1 \}$ gilt: Ist $a$
+teilerfremd zu $n$, so gilt $$a^{\varphi(n)} \equiv 1 \pmod{n}.$$ Ist
+$n = p$ eine Primzahl, so gilt $$a^{p-1} \equiv 1 \pmod{p}.$$
+
+## Klassifikation von zyklischen Gruppen
+
+Mit den Gruppen $G,H$ heißt die Abbildung $f: G\to H$ **Homomorphismus**
+(der Gruppen $G$ und $H$), wenn gilt
+$$\forall g,g'\in G: f(g *_G g') = f(g) *_H f(g').$$
+
+------------------------------------------------------------------------
+
+Ein **Isomorphismus** ist ein bijektiver Homomorphismus. Wenn es einen
+Isomorphismus auf zwei Gruppen $G$ und $H$ gibt, heißen diese
+**isomorph** und werden geschrieben als $G \cong H$.
+
+Für eine zyklische Gruppe $G$ gilt:
+$$(G,*) \cong (\Z,+)\quad\text{oder}\quad(G,*) \cong (\Z/n\Z, +) \text{ mit } n = |G|.$$
+
+------------------------------------------------------------------------
+
+Ein **Automorphismus** ist ein Isomorphismus einer Gruppe auf sich
+selbst. TODO?
+
+# Ringe und Körper
+
+::: defi
+Ein **Ring** ist ein Tripel $(R,+,\cdot)$ bestehend aus einer Menge $R$
+zusammen mit zwei zweistellgen Operationen
+$$+: R\times R \to R: (g,h) \mapsto g+h\quad \text{\enquote{Addition}}$$
+und
+$$\cdot: R\times R \to R: (g,h) \mapsto g\cdot h\quad \text{\enquote{Multiplikation}}$$
+sodass folgende Axiome erfüllt sind:
+
+1. $(R,+)$ ist eine abelsche Gruppe mit neutralem Element $0_R$.
+2. $R$ zusammen mit der Multiplikation `\enquote{$\cdot$}`{=tex}
+ erfüllt die Axiome
+ a. *Assoziativgesetz*:
+ $(g\cdot h) \cdot k = g \cdot (h \cdot k)\quad\forall g,h,k \in R$
+ b. *Existenz eines Neutralen*:
+ $\exists 1_R \in R: \forall g\in R: 1_R \cdot g = g$
+3. *Zwei Distributivgesetze*: $\forall g,h,k \in R:$
+ a. $(g+h) \cdot k = g\cdot k + h\cdot k$
+ b. $g \cdot (h+k) = g\cdot h + g\cdot k$
+4. $0_R \neq 1_R$
+
+Ein Ring $(R,+,\cdot)$ heißt **kommutativ**, wenn zudem noch die
+Multiplikation dem folgenden Axiom genügt:
+
+5. *Kommutativgesetz*: $g\cdot h = h \cdot g\quad\forall g,h\in R$
+
+Ein kommutativer Ring $(R,+,\cdot)$ heißt **Körper**, falls zusätzlich
+gilt
+
+6. $(R\setminus \{0_R\},\cdot)$ eine abelsche Gruppe mit $1_R$
+:::
+
+TODO: Unterschied Ring Körper 9.3
+
+::: bsp
+**Beispiele**:
+
+- $\Z/n\Z$ ist ein kommutativer Ring.
+- $\Z/p\Z$ ist ein Körper für $p\in\P$.
+:::
+
+## Rechenregeln
+
+Mit Körper $K$, $x,y,z \in K$ und $u,v \in K \setminus \{ 0 \}$ gilt:
+
+- $-(-x) = x$
+- $x + y = z \iff x = z - y$
+- $-(x + y) = -x -y$
+- $0 \cdot x = x \cdot 0 = 0$
+- $(-x) \cdot y = x \cdot (-y) = -(x \cdot y)$
+- $(-x) \cdot (-y) = x \cdot y$
+- $x \cdot (y - z) = x \cdot y - x \cdot z$
+- $(x^{-1})^{-1} = x, \text{ für } x \neq 0$
+- $x \cdot y = 0 \iff x = y \text{ oder } y = 0$
+- $z \cdot x = z \cdot y,\ z \neq 0 \implies x = y$
+- $\frac{x}{u} \cdot \frac{y}{v} = \frac{x \cdot y}{u \cdot v}$
+- $\frac{x}{u} + \frac{y}{v} = \frac{x \cdot v + y \cdot u}{u \cdot v}$
+
+## Unterringe
+
+Sei $(R,+,\cdot)$ ein Ring und $S \subset R$. Dann ist $(S,+,\cdot)$ ein
+**Unterring**, wenn folgende Unterringkriterien erfüllt sind:
+
+1. $(S,+)$ ist eine Untergruppe von $(R,+)$.
+2. $1_R \in S$.
+3. $g,h \in S \implies g\cdot h \in S$.
+
+## Unterkörper/Teilkörper
+
+Sei $(K,+,\cdot)$ ein Körper und $L\subset K$. Dann ist $L$ ein
+**Teilkörper**/**Unterkörper**, von $K$, wenn folgende Bedingungen
+erfüllt sind:
+
+1. $g,h \in L \implies g+h,g\cdot h \in L$.
+2. $0,1 \in L$.
+3. $g\in L \implies -g \in L$.
+4. $g\in L, g\neq 0 \implies g^{-1} \in L$.
+
+## Chinesischer Restsatz
+
+### Ziel
+
+Sei $m,n\geq 1$ und $a,b\in\Z$. Finde $x\in\Z$: $$x \equiv a \pmod{n}$$
+$$x \equiv b \pmod{m}$$
+
+::: bsp
+**Beispiele**: $$x \equiv 4 \pmod{7}$$ $$x \equiv 2 \pmod{6}$$
+
+**Schreibe**:
+$x = 4 \cdot ?_1 + 2 \cdot ?_2 \equiv 4 \cdot 1 + 2 \cdot 0 \pmod{4} \equiv 4 \cdot 0 + 2 \cdot 1 \pmod{6}$
+
+**Demnach**:
+
+Für $?_1$ finde
+$k\in\Z: 6\cdot k \equiv 1 \pmod{7} \implies 6^{-1} = 6$.
+
+Für $?_2$ finde
+$k\in\Z: 7\cdot l \equiv 1 \pmod{6} \implies 7^{-1} = 1$.
+:::
+
+### Definition
+
+Seien $m_1,...,m_r > 1$ paarweise teilerfremde Zahlen, $r>1$ und
+$a_1,...,a_r \in \Z$ beliebig. Dann existiert ein $x\in\Z$ mit
+$$x \equiv a_1 \pmod{m_i}\quad\forall i = 1,...,r$$ und je zwei Lösungen
+$x,x'$ dieser Kongruenzen erfüllen
+$$x \equiv x' \pmod{m},\quad m := \prod_{i=1}^r m_i.$$
+
+```{=tex}
+\begin{proof} Zunächst wird die \textit{Existenz} bewiesen. Es sei $n_i := \frac{m}{m_i} = m_1 \cdot ... \cdot m_{i-1} \cdot m_{i+1} \cdot ... \cdot m_r$. Dann ist $\mathrm{ggT}(m_i,n_i) = 1$ und nach 8.19 existiert $n_i^*$, sodass $[n_i^*] := [n_i]^{-1} \in \Z/m_i\Z$ ist, d.h. $n_i^* \cdot n_i \equiv 1 \pmod{m_i}$. Wenn nun $x := a_1n_1n_1^* + a_2n_2n_2^* + ... + a_rn_rn_r*$, gilt nach Konstruktion $m_i \mid n_j$ für $i\neq j$ und damit $a_jn_jn_j^* \equiv 0 \pmod{m_i}$ und daher $$x \equiv a_in_in_i^* \pmod{m_i} \equiv a_i \pmod{m_i}.$$
+Um die \textit{Eindeutigkeit} zu zeigen, seien $x, x'$ Lösungen der Kongruenzen (9.1). Dann gilt $x \equiv x' \pmod{m_i}$ für alle $i=1,...,r$ und daher auch $m_i \mid (x-x')$. Da dies für alle $i$ erfüllt ist, gilt auch $m \mid x$, woraus die Behauptung bewiesen ist.
+\end{proof}
+```
+::: bsp
+**Beispiel**: $$x \equiv 6 \pmod{30}$$ $$x \equiv 2 \pmod{7}$$ Anwendung
+des chinesischen Restsatzes: Setze $m_1 = \frac{m_1m_2}{m_1} = m_2 = 7$
+und $m_2 = \frac{m_1m_2}{m_2} = m_1 = 30$.
+
+- Bestimme Inverse von $n_1$ und $n_2$:
+ `\begin{splitty}30 &= 4\cdot 7 + 2\\7 &= 3 \cdot 2 + 1\\2 &= 2 \cdot 1 + 0\end{splitty}`{=tex}
+ und Rückeinsetzen:
+ `\begin{splitty}1 &= 7 - 3 \cdot 2\\&= 7 - 3 \cdot (30 - 4 \cdot 7)\\&= 13 \cdot 7 - 3 \cdot 30\end{splitty}`{=tex}
+ Also $13 \cdot 7 \equiv 1 \pmod{30}$.
+- Lösung:
+ $$x = a_1n_1n_1^* + a_2n_2n_2^* = a_1 \cdot 7 \cdot 13 + a_2 \cdot 30 \cdot 4 = 6 \cdot 7 \cdot 13 + 2 \cdot 4 \cdot 30.$$
+ Demnach: $$x \equiv 156 \pmod{210},$$ d.h. der nächste Vollmond am
+ Sonntag ist in $156$ Tagen und wiederholt sich dann alle $210$ Tage.
+:::
+
+# Körper der komplexen Zahlen
+
+::: defi
+Motivation: Lösung für $x^2 = -1$ mit $x = i$ und $i^2 = -1$. Also:
+Konstruktion von $i$, damit dies erfüllt ist.
+
+Man kann den Körper der komplexen Zahlen konstruieren, indem man den
+Körper $\R$ der reelen Zahlen und die Menge
+$C := \R \times \R = \{(a,b) \mid a,b\in\R\}$ betrachtet mit den
+folgenden Operationen:
+`\begin{splitty}+:\quad C\times C\quad &\to \quad C\\((a,b),(c,d))&\mapsto (a,b)+(c,d) := (a+c, b+d)\end{splitty}`{=tex}und`\begin{splitty}\cdot:\quad C\times C\quad &\to \quad C\\((a,b),(c,d))&\mapsto (a,b)\cdot(c,d) := (ac - bd, ad + bc).\end{splitty}`{=tex}Also
+definiert man:
+`\begin{splitty}(x,0),\quad x\in\R &:= x\\(0,1)&:=i,\end{splitty}`{=tex}
+da dann gilt: $$i^2 = (0,1)(0,1) = (-1,0) = -1.$$Für $z=(x,y)\in C$
+gilt: $$z = (x,0) + (0,1)(y,0) = x + iy.$$Außerdem gilt in
+$\C$:`\begin{splitty}(x+iy)(u+iv) &= (xu + i^2yv) + i(xv+yu) = (xu - yv) + i(xv+yu).\end{splitty}`{=tex}Das
+multiplikative Inverse von $x+iy$ ist demnach:
+$$u+iv = \frac{x}{x^2 + y^2} - \frac{iy}{x^2+y^2}.$$
+:::
+
+## Operationen
+
+1. **Betragsfunktionen**:
+ `\begin{splitty}|\cdot|:\quad\C\quad&\to\quad\R_{\geq0}\\x+iy&\mapsto\sqrt{x^2+y^2}\end{splitty}`{=tex}
+2. **Komplexe Konjugation**:
+ `\begin{splitty}\bar{\cdot}:\quad\C\quad&\to\quad\C\\z = x + iy &\mapsto \bar{z} := x - iy.\end{splitty}`{=tex}
+3. **Realteil**:
+ `\begin{splitty}\mathrm{Re}:\quad\C\quad&\to\quad\R\\x+iy &\mapsto\quad x.\end{splitty}`{=tex}
+4. **Imaginärteil**:
+ `\begin{splitty}\mathrm{Im}:\quad\C\quad&\to\quad\R\\x+iy &\mapsto\quad y.\end{splitty}`{=tex}
+
+## Geometrische Deutung
+
+### Graph von $z$
+
+::: visu
+Mit $z = x + yi = 4 + 5i$:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=-1,xmax=5,ymin=-1,ytick={-1,...,6},ymax=6,minor tick num=1,ticks=both,yticklabels={$-i$, $0$, $i$, $2i$, $3i$, $4i$, $5i$, $6i$}]
+\addplot[black,mark=*] coordinates {(4,5)} {};
+\addplot[ultra thick,dashed,red] coordinates { (0,0) (4,0) } node[pos=0.5,above] {$\text{Re}(z)=4$};
+\addplot[,dashed,red] coordinates { (4,0) (4,5) } node[pos=0.5,left] {$\text{Im}(z)=5$};
+
+\node [above,red] at (axis cs: 4,5) {$4+5i$};
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Vektoraddition
+
+::: visu
+Mit $z = x + yi = 1 + 3i$ und $w = u + vi = 4 + 2i$ und
+$z + w = 5 + 5i$:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=-1,xmax=6,ymin=-1,ytick={-1,...,6},ymax=6,minor tick num=1,ticks=both,yticklabels={$-i$, $0$, $i$, $2i$, $3i$, $4i$, $5i$, $6i$}]
+\addplot[black,mark=*] coordinates {(1,3)} {};
+\addplot[black,mark=*] coordinates {(5,5)} {};
+\addplot[black,mark=*] coordinates {(4,2)} {};
+
+\addplot[red] coordinates { (0,0) (1,3) } node[pos=1,left] {$z$};
+\addplot[red] coordinates { (0,0) (5,5) } node[pos=1,above] {$z+w$};
+\addplot[red] coordinates { (0,0) (4,2) } node[pos=1,right] {$w$};
+
+\addplot[dashed,red] coordinates { (1,3) (5,5) };
+\addplot[dashed,red] coordinates { (4,2) (5,5) };
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Betrag
+
+::: visu
+Mit $z = x + iy = 4 + 5i$, entspricht der Betrag
+$|z| = \sqrt{x^2 + y^2} = \sqrt{4^2 + 5^2} \approx 6.4 = r$ der
+euklidischen Länge des Vektors $z$:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[axis lines=center,xmin=-1,xmax=5,ymin=-1,ytick={-1,...,6},ymax=6,minor tick num=1,ticks=both,yticklabels={$-i$, $0$, $i$, $2i$, $3i$, $4i$, $5i$, $6i$}]
+\addplot[black,mark=*] coordinates {(4,5)} {};
+\addplot[red] coordinates { (0,0) (4,5) } node[pos=0.5,above] {$r$};
+\addplot[ultra thick,dashed,red] coordinates { (0,0) (4,0) } node[pos=0.5,above] {$\text{Re}(z)=4$};
+\addplot[dashed,red] coordinates { (4,0) (4,5) } node[pos=0.5,left] {$\text{Im}(z)=5$};
+
+\node [above,red] at (axis cs: 4,5) {$4+5i$};
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+:::
+
+### Einheitskreis
+
+$$z = \cos(\alpha) + i\sin(\alpha)$$
+
+TODO. Tikz weird af
+
+**Euler-Formel**: $$\C\ni e^{i\alpha} = \cos(\alpha) + i\sin(\alpha)$$
+mit $\alpha$ als Winkel im Bogenmaß, sowie
+$$|e^{i\alpha}| = 1,\quad\forall\alpha\in\R.$$
+
+### Polarkoordinaten
+
+Mit dem Punkt $z' = \frac{z}{|z|}$ gilt:
+$$z = x+iy = |z| \cdot \frac{z}{|z|} = |z| \cdot z' = |z| \cdot e^{i\alpha}.$$
+**Polarkoordinatendarstellung**:
+$z = r \cdot e^{i\alpha} = r(\cos(\alpha) + i\sin(\alpha))$
+
+TODO: Tikz Darstellung der Multiplikation
+
+`\begin{splitty}(r\cdot e^{i\alpha})(r'\cdot e^{i\alpha'}) &= r \cdot r' (\cos(\alpha) + i\sin(\alpha))(\cos(\alpha')+i\sin(\alpha'))\\&= ...\\&= r\cdot r' \cdot e^{i(\alpha+\alpha')}\end{splitty}`{=tex}
+
+## Gleichungen in $\C$
+
+### Lineare Gleichung
+
+Finde $z\in\C$ mit $u,v\in\C$ und $u\neq0$:
+`\begin{splitty} uz+v &= 0\\ \iff z &= -u^{-1} \cdot v \end{splitty}`{=tex}
+Ist $u = a + ib$ und $v = c + id$ mit $a,b,c,d\in\R$, dann ist
+$$z = -\frac{v}{u} = -\frac{c+id}{a + ib} \cdot \frac{a-ib}{a-ib} = -\frac{(ac+bd) - i(bc-ad)}{a^2+b^2} = -\frac{ac+bd}{a^2+b^2} + i\frac{bc-ad}{a^2+b^2}$$
+
+### Quadratische Gleichungen
+
+Finde $z\in\C$ mit Koeffizienten $a,b,c\in\R,\quad a\neq0$, sodass
+`\begin{splitty}az^2 + bz + c &= 0\\\iff a(z^2 + \frac{b}{a} \cdot z + \frac{z}{a}) &= 0\\\iff^{a\neq0} z^2 + \frac{b}{a}\cdot z + \frac{b^2}{4a^2} &= \frac{b^2}{4a^2} - \frac{c}{a}\\\iff (z+\frac{b}{za})^2 &= \frac{b^2-4ac}{4a^2}\\\iff z_{1,2} &= \pm \sqrt{\frac{b^2-4ac}{4a^2}} - \frac{b}{2a}\\&=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\end{splitty}`{=tex}
+$$z_{1,2} = \begin{cases}-\frac{b}{2a}\in\R,&\text{wenn } \Delta = 0\\\frac{-b\pm\sqrt{b^2-4ac}}{2a}\in\R,&\text{wenn } \Delta > 0\\\frac{-b\pm i\sqrt{4ac-b^2}}{2a} = \frac{-b}{2a}\pm i\frac{\sqrt{4ac-b^2}}{2a}, &\text{wenn } \Delta < 0\end{cases}$$
+
+### Einheitswurzeln
+
+Sei $0\neq\omega = r \cdot e^{i\alpha} \in \C$ und $n\in\N$. Finde
+$z\in\C$ mit $$z^n = \omega.$$ **Polarkoordinatendarstellung**: Betrag
+und Argument von $z^n$ gleich $r$ und $\alpha$. Sei
+$z = s\cdot e^{i\beta}$, dann sucht man $(s,\beta)$, sodass
+$$z^n = s^n \cdot e^{i(n\beta)} = r \cdot e^{i\alpha} = \omega$$ also
+$s^n = r$ und $n\beta = \alpha + 2 \pi k$ mit $k\in\Z$. **Also**:
+$s = \sqrt[n]{r}$ und $\beta_k \frac{\alpha+2\pi k}{n}$ mit
+$k=0,...,n-1$. Es gibt also $n$ Lösungen
+$z_k = \sqrt[n]{r} \cdot e^{i\beta k},\quad k=0,...,n-1$.
+
+# Polynomringe
+
+::: defi
+Sei $R$ ein kommutativer Ring.
+
+1. Ein **Polynom** über dem Ring $R$ in der Unbestimmten $X$ ist ein
+ Ausdruck der Form
+ $$f=f(x)=\alpha_nX^n+\alpha_{n-1}X^{n-1}+...+\alpha_0X^0=\sum_{i=0}^n \alpha_iX^i$$
+ mit $n\in\N$ und **Koeffizienten** $\alpha_i\in R,\ i=0,...,n$.
+ Genauer ist $\alpha_i$ der **Koeffizient von $f$ zum Grad $i$**. Ist
+ $a_n=1$, so nennt man das Polynom $f$ **normiert**.
+2. Ist $\alpha_n\neq0$, so ist $n$ der **Grad** $\mathrm{grad}(f)$ des
+ Polynoms $f$. Man definiert den Grad des **Nullpolynoms** $f=0$ als
+ $\mathrm{grad}(0) = -\infty$.
+3. Ist $\mathrm{grad}(f)=2$, dann nennt man
+ $f(X) = \alpha_2X^2+\alpha_1X+\alpha_0$ auch **quadratische
+ Polynome**. Ist $\mathrm{grad}(f)=1$, dann spricht man auch von
+ **linearen Polynomen** $f(X)=\alpha_1X+\alpha_0$, und für
+ $\mathrm{grad}(f)=0$ von den **konstanten Polynomen**
+ $f(X)=\alpha_0$.
+:::
+
+Ein **Polynomring** $R[X]$ ist dann die Menge aller Polynome in der
+Unbestimmten $X$ mit Koeffizienten in einem Ring $R$, weshalb dieser
+auch die Ringaxiome erfüllt.
+
+$R[X]$ besitzt die folgenden Operationen:
+
+1. $$\left(\sum_{i\in\N} \alpha_iX^i\right)+\left(\sum_{i\in\N} \beta_iX^i\right) = \sum_{i\in\N}(\alpha_i+\beta_i)X^i$$
+2. $$\left(\sum_{i\in\N} \alpha_iX^i\right)\cdot\left(\sum_{i\in\N} \beta_iX^i\right) = \sum_{i\in\N}\left(\sum_{k+l=i}(\alpha_k+\beta_l)X^i\right)$$
+
+------------------------------------------------------------------------
+
+Für $f,g\in R[X]$ gilt:
+$$\mathrm{grad}(f+g)\leq\mathrm{max}(\mathrm{grad}(f),\mathrm{grad}(g))$$
+$$\mathrm{grad}(f\cdot g)\leq\mathrm{grad}(f) + \mathrm{grad}(g)$$ Ist
+$R=K$ ein Körper, so gilt sogar:
+$$\mathrm{grad}(f\cdot g)=\mathrm{grad}(f) + \mathrm{grad}(g)$$
+
+## Polynomdivision
+
+Von nun an ist $R=K$ ein beliebiger Körper.
+
+------------------------------------------------------------------------
+
+Seien $f,g\in K[X]$ und $g\neq0$ Polynome mit Koeffizienten in $K$. Dann
+existieren eindeutig bestimmte Polynome $q,r\in K[X]$ mit
+$$f=q\cdot g+r\quad\text{mit } \mathrm{grad}(r)<\mathrm{grad}(g).$$ Man
+nennt $q$ den **Quotienten** und $r$ den **Rest der Division** von $f$
+durch $g$.
+
+::: bsp
+**Beispiel**:
+
+```{=tex}
+\polylongdiv[style=C]{X^4+2X^3-X+2}{3X^2-1}
+```
+:::
+
+Mit $f,g\in K[X]$, definiert man **$g$ teilt $f$** oder **$g$ ist ein
+Teiler von $f$**, wenn
+$$g \mid f\quad:\iff\quad\exists q\in K[X]: f = g\cdot q.$$ Falls $g$
+kein Teiler von $f$ ist, so schreibt man $g \nmid f$.
+
+::: bsp
+**Beispiel**: Das Polynom $X+1$ ist ein teiler von $X^2-1$ in $\R[x]$,
+da $$X^2-1 = (X+1)(X-1) = X^2 - X + X - 1.$$
+:::
+
+Ein Polynom $f\in K[X]$ heißt **reduzibel**, wenn es nicht-konstante
+Polynome $g,h\in K[X]$ gibt, sodass $f=g\cdot h$ gilt. Andernfalls heißt
+$f$ **irreduzibel**.
+
+::: bsp
+**Beispiel**: $X^2+1$ ist irreduzibel in $\R[X]$, aber reduzibel in
+$\C[x]$, da $X^2 + 1 = (X - i)(X + i)$ gilt.
+:::
+
+## Euklidischer Algorithmus
+
+------------------------------------------------------------------------
+
+Ein Polynom $p\in K[X]$ ist **gemeinsamer Teiler** von Polynomen
+$f,g\in K[X]$, wenn $p$ ein Teiler von $f$ und ein Teiler von $g$ ist.
+Wir nennen $$p=\mathrm{ggT}(f,g)$$ einen **größten gemeinsamen Teiler**
+von $f$ und $g$, falls $p$ durch jeden gemeinsamen Teiler von $f$ und
+$g$ teilbar ist. Man nennt $p$ den **normierten größten gemeinsamen
+Teiler**, wenn $p=\mathrm{ggT}(f,g)$ normiert ist.
+
+------------------------------------------------------------------------
+
+Seien $f,g\in K[X]$, $g\neq0$ und
+$\mathrm{grad}(f)\geq\mathrm{grad}(g)$. Setze man $r_0=f$ und $r_1=g$
+und berechne für $j=0,1,...$ die Division von $r_j$ durch $r_{j+1}$ mit
+Rest $r_{j+2}$ bis $r_{j+2}=0$ gilt, d.h. finde $q_j\in K[X]$ so, dass
+$$r_j=q_jr_{j+1}+r_{j+2}\quad\text{(mit } 0\leq\mathrm{grad}(r_{j+2}) < \mathrm{grad}(r_{j+1}))$$
+erfüllt ist. Ist $n=j+1\in\N$ gefunden mit $r_{n+1}=0$, dann gilt
+$r_n=\mathrm{ggT}(f,g)$.
+
+TODO: Beispiel
+
+------------------------------------------------------------------------
+
+Jedes nicht-konstante Polynom $f\in K[X]$ lässt sich als Produkt
+irreduzible Polynome aus $K[X]$ darstellen. Diese Darstellung ist bis
+auf die Reihenfolge und die Multiplikation mit konstanten Polynomen
+eindeutig.
+
+## Nullstellen von Polynomen
+
+Ist $f\in K[X]$ ein Polynom mit **Nullstelle** $x_0\in K$, d.h.
+$f(x_0) = 0$, so ist das Polynom (auch **Linearfaktor** genannt)
+$g(X) = (X = x_0)$ ein Teiler von $f$.
+
+------------------------------------------------------------------------
+
+Sei $0\neq f\in K[X]$, dann besitzt $f$ nur endlich viele paarweise
+verschiedenen Nullstellen $\alpha_1,...,\alpha_r\in K$, wobei
+$r \leq \mathrm{grad}(f)$ gilt. Weiter existieren
+$n_1,...,n_r\in\N_{>0}$ sowie ein Polynom $g\in K[X]$ ohne Nullstellen
+in $K$ mit $$f = \prod_{i=1}^r (X - a_i)^{n_i} \cdot g.$$ Dabei sind die
+Exponenten $n_i$ sowie das Polynom $g$ eindeutig durch $f$ bestimmt. Wir
+nennen $n_i$ die **Vielfachheit** der Nullstelle $a_i$.
+
+### Anzahl der Nullstellen
+
+Ein Polynom $f\in K[X]$ vom Grad $\mathrm{grad}(f) = n \geq 0$ hat
+höchstens $n$ Nullstellen.
+
+### Fundamentalsatz der Algebra
+
+Jedes Polynom $f\in\C[X]$ zerfällt in Linearfaktoren, d.h. es lässt sich
+als Produkt von Linearfaktoren schreiben.
+
+# Vektorräume
+
+::: defi
+1. Ein **$K$-Vektorraum** ist eine Menge $V$, auf der eine (innere)
+ Verknüpfung
+ `\begin{splitty}+:\quad V\times V\quad&\to\quad V\\(u,v)\quad&\mapsto\quad u+v\end{splitty}`{=tex}
+ und eine **skalare Multiplikation** (äußere Verknüpfung)
+ `\begin{splitty}\cdot:\quad K\times V\quad&\to\quad V\\(\lambda,v)\quad&\mapsto\quad\lambda\cdot v\end{splitty}`{=tex}
+ definiert sind, sodass folgende **Vektorraumaxiome** erfüllt sind:
+ 1. $(V,+)$ ist eine abelsche Gruppe
+ 2. *Assoziativgesetz*:
+ $\forall \lambda,\gamma\in K \land v\in V: \lambda (\gamma \cdot v) = (\lambda \cdot \gamma) v$
+ 3. *Neutrales Element*: $\forall v\in V: 1 \cdot v = v$
+ 4. *Distributivgesetze*:
+ 1. $\forall \lambda\in K \land u,v\in V: \lambda \cdot (u+v) = \lambda \cdot u + \lambda \cdot v$
+ 2. $\forall \lambda,\gamma\in K \land u\in V: (\lambda + \gamma) \cdot u = \lambda \cdot u + \gamma \cdot u$
+2. Die Elemente von $V$ heißen **Vektoren** und die Elemente in $K$
+ **Skalare**. Das neutrale Element der Gruppe $(V,+)$ nennt man den
+ **Nullvektor** $0$.
+3. Für $K=\R$ spricht man von einem **reelen Vektorraum** und für
+ $K=\C$ von einem **komplexen Vektorraum**.
+:::
+
+::: bsp
+**Beispiele**:
+
+1. $\R^n$: $n$-dimensionaler euklidischer Raum, welcher alle $n$-Tupel
+ der reelen Zahlen enthält. $\R^2$ ist entsprechend der klassische
+ zweidimensionale Raum mit Vektor $(x,y)^\top$; analog $\R^3$ mit
+ Vektor $(x,y,z)^\top$. $\R^n$ ist erweiterbar zu $\C^n$ und enthält
+ entsprechend zusätzlich die komplexen Zahlen.
+2. Funktionenräume: Die Menge aller $K$-wertigen Abbildungen
+ $\mathrm{Abb}(X, K) = \{f: X \to K\}$. Dann gilt:
+ $$(f+g)(x) = f(x) + g(x),\quad\forall x\in X,$$
+ $$(\lambda \cdot f)(x) = \lambda \cdot f(x),\quad\forall x\in X.$$
+3. Der Polynomring $K[X]$ über einem Körper $K$ ist ein $K$-Vektorraum.
+ Die Ringeigenschaften von $K[X]$ liefern eine Addition, die man als
+ Vektoraddition interpretieren kann. Die skalare Multiplikation mit
+ $\lambda\in K$ lässt sich als Multiplikation in $K[X]$ definieren,
+ indem man den Skalar $\lambda$ als konstantes Polynom mit dem Wert
+ $\lambda$ identifiziert (d.h. als Polynom
+ $\lambda X^0 = \lambda\in K[X]$).
+:::
+
+## Unterräume
+
+### Untervektorraum
+
+::: defi
+Mit dem $K$-Vektorraum $V$ und $U\subset V$ ist $U$ ein
+$K$-**Untervektorraum** von $V$, wenn folgende Axiome erfüllt sind:
+
+1. $U\neq\emptyset$
+2. $u,v\in U\quad\implies\quad u+v\in U$
+3. $u\in U,\ \lambda\in K\quad\implies\quad\lambda u\in U$
+
+Kurz spricht man auch von einem **Unterraum** $U$ von $V$.
+:::
+
+::: bsp
+**Beispiele**:
+
+1. Jeder $K$-Vektorraum $V$ hat die trivialen Unterräume $\{0\}$ und
+ $V$.
+2. Die Menge aller Polynome vom Grad kleiner gleich $n\in\N$
+ $$K[X]_{\leq n} = \{f\in K[X] \mid \mathrm{grad}(f) \leq n\}$$ ist
+ ein Unterraum von $K[X]$. Die Addition und Multiplikation können
+ jeweils den Grad nicht gehören und der Raum ist somit abgeschlossen.
+:::
+
+## Familie von Vektoren
+
+::: defi
+Eine Familie ist eine geordnete Ansammlung von Elementen. TODO: Mehr.
+:::
+
+Mit der Familie von Untervektorräumen von $V$ namens $(U_i)_{i\in I}$
+ist auch $$\bigcap_{i\in I} U_i \text{ ein Untervektorraum von } V.$$
+
+TODO: (Generell) TikZ aus Gekritzel?
+
+## Lineare Hülle {#lspan}
+
+::: defi
+Mit der Familie von Vektoren in $V$ $\mathcal{F} = (v_i)_{i\in I}$ ist
+eine **Linearkombination** von $\mathcal{F}$ (oder über $\mathcal{F}$)
+ein Element der Form
+$$\sum_{i\in I} \lambda_i v_i \in V,\quad \text{ wobei } \lambda_i \in K \text{ und } \lambda_i\neq0 \text{ für höchstes endlich viele } i\in I.$$
+Die Menge aller Linearkombinationen von $\mathcal{F}$ in $V$ wird als
+**Erzeugnis** (**lineare Hülle**, **Spann**) von $\mathcal{F}$
+bezeichnet und mit
+$$\mathrm{Lin}(\mathcal{F}) = \mathrm{Lin}((v_i)_{i\in I}) = \left\{ v\in V \biggm| v \text{ ist Linearkombination über } \mathcal{F} \right\}$$
+notiert. Dabei nennt man $\mathcal{F} = (v_i)_{i\in I}$ ein
+**Erzeugendensystem** von $\mathrm{Lin}(\mathcal{F})$. Es gilt außerdem
+$\mathrm{Lin}() = \{0\}$.
+:::
+
+Eine **Linearkombination** von einer Familie von Vektoren
+$\mathcal{F} = (v_1,...,v_n)$ in $V$ ist ein Element der Form
+$$\mathrm{Lin}(\mathcal{F}) = \mathrm{Lin}(v_1,...,v_n) = \left\{\sum_{i=1}^n \lambda_iv_i \biggm| \lambda_i\in K, i\in I\right\}.$$
+
+::: bsp
+**Beispiele**:
+
+1. Die lineare Hülle der $n$ Koordinateneinheitsvektoren
+ (Basisvektoren) von $\R^n$ ist gerade wieder $\R^n$.
+2. Die lineare Hülle von den Vektoren $(1,2)^\top$, $(3,6)^\top$ und
+ $(-2,-4)^\top$ ist die Gerade
+ $\{\vec{r}\mid\vec{r}=t(1,2)^\top,t\in\R\}$ da diese Gerade durch
+ jeden Vektor verläuft (bzw. Ergebnis einer Linearkombination ist).
+3. Ist $V$ ein $\R$-Vektorraum $\R^3$ und $\mathcal{F} = (v_1,v_2)$ mit
+ $v_1 = (1,1,0)$ und $v_2 = (1,0,0)$ in $\R^3$, gilt
+ $$\mathrm{Lin}(\mathcal{F}) = \mathrm{Lin}(v_1,v_2) = \{(\lambda_1+\lambda_2,\lambda_1,0)\mid\lambda_1,\lambda_2\in\R\} = \{(\lambda_1',\lambda_2',0)\mid\lambda_1',\lambda_2'\in\R\}.$$
+:::
+
+::: visu
+**Visualisierung** in $\R^3$. Zuerst mit $\vec{u}=(0,1,1)^\top$ und
+$\vec{v}=(1,0,1)^\top$:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[xlabel={$x$},ylabel={$y$},zlabel={$z$}]
+ \addplot3[surf, mesh]
+ {x+y};
+ \fill[red] (0,0,0) circle (2pt);
+ \draw[->, ultra thick] (0,0,0) -- node [above] {$\vec{u}$} (0,3,3);
+ \draw[->, ultra thick] (0,3,3) -- node [above] {$\vec{v}$} (3,3,6);
+ \draw[->, ultra thick, blue] (0,0,0) -- node [above] {$\vec{k}$} (3,3,6);
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+Es entsteht ein linearkombinierter Vektor (in diesem Fall
+$\vec{k} = 3\vec{u} + 3\vec{v} = (3,3,6)^\top$). Durch diesen Vektor
+lässt sich entsprechend jeglicher Punkt auf der entstandenen Ebene (=
+lineare Hülle) bestimmen. Nun kommt ein dritter Vektor $\vec{w}=(0,0,1)$
+hinzu:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[xlabel={$x$},ylabel={$y$},zlabel={$z$}]
+ \addplot3[surf, mesh]
+ {x+y-8};
+ \fill[red] (0,0,0) circle (2pt);
+ \draw[->, ultra thick] (0,0,0) -- node [above] {$\vec{u}$} (0,3,3);
+ \draw[->, ultra thick] (0,3,3) -- node [above] {$\vec{v}$} (3,3,6);
+ \draw[->, ultra thick] (3,3,6) -- node [right] {$\vec{w}$} (3,3,-2);
+ \draw[->, ultra thick, blue] (0,0,0) -- node [above] {$\vec{k}$} (3,3,-2);
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+$\vec{w}$ dient nun also als `\enquote{Veschiebungs}`{=tex}-Vektor,
+welcher die Ebene in $z$-Richtung verschieben kann (im Bild mit Faktor
+$-8$). Damit ergibt sich, dass die lineare Hülle der drei Vektoren nun
+den ganzen Raum $\R$ umfasst.
+:::
+
+Ist $\mathcal{F} = (v_i)_{i\in I}$ eine Familie von Vektoren in $V$,
+dann ist $\mathrm{Lin}(\mathcal{F})$ ein Untervektorraum von $V$ und es
+gilt $$\forall i\in I: v_i\in\mathrm{Lin}(\mathcal{F}).$$
+
+------------------------------------------------------------------------
+
+Ist $\mathcal{F} = (v_i)_{i\in I}$ eine Familie von Vektoren in $V$ und
+$M = \{v_i\mid i\in I\}$ die Menge der Vektoren aus $\mathcal{F}$, dann
+gilt
+$$\mathrm{Lin}(\mathcal{F}) = \underset{U\text{ Unterraum von } V}{\bigcap_{M\subset U\subset V}} U.$$
+
+------------------------------------------------------------------------
+
+Existiert für einen Unterraum $U\subset V$ eine Familie von Vektoren
+$\mathcal{F} = (v_i)_{i\in I}$, sodass $U = \mathrm{Lin}(\mathcal{F})$
+gilt, dann nennt man $\mathcal{F}$ ein **Erzeugendensystem** von $U$,
+bzw. **$U$ wird von $\mathcal{F}$ erzeugt**. Ist $\mathcal{F}$ endlich,
+so ist $U$ **endlich erzeugt** (von $\mathcal{F}$).
+
+## Lineare Unabhängigkeit
+
+::: defi
+1. Eine Familie $\mathcal{F} = (v_i)_{i\in I}$ in V heißt genau dann
+ **linear abhängig**, wenn eine Linearkombination mit mindestens
+ einem Koeffizienten ungleich $0$ existiert, sodass mit $J\subset I$
+ gilt
+ $$\sum_{i\in J} \lambda_iv_i = 0,\quad\exists i\in J: \lambda_i \neq 0.$$
+2. Dieselbe Familie $\mathcal{F}$ heißt genau dann **linear
+ unabhängig**, wenn diese nicht linear abhängig ist - also wenn jede
+ Darstellung der $0$ mittels einer Linearkombination ausschließlich
+ triviale Koeffizienten besitzt:
+ $$\sum_{i\in J} \lambda_iv_i = 0\quad\implies\quad\forall i\in J: \lambda_i=0.$$
+3. Dieselbe Familie $\mathcal{F}$ ist außerdem ganau dann linear
+ unabhängig, wenn sich jeder Vektor $v\in\mathrm{Lin}(\mathcal{F})$
+ in eindeutiger Weise als Linearkombination aus Vektoren von
+ $\mathcal{F}$ schreiben lässt.
+:::
+
+::: bsp
+**Beispiele** bzw. vereinfachte Erklärung:
+
+1. Eine Vektorfamilie ist **linear abhängig**, wenn mindestens ein
+ Vektor bereits durch eine Linearkombination eines oder mehrerer
+ anderen Vektoren der Familie ersetzt werden könnte (er ist also
+ redundant für den linearen Spann). Das heißt der lineare Spann
+ verändert sich nicht, wenn man diesen Vektor entfernen würde.
+2. Wenn hingegen jeder Vektor tatsächlich eine neue Dimension zum
+ linearen Spann hinzufügt, ist die Vektorfamilie **linear
+ unabhängig**.
+:::
+
+::: visu
+**Visualisierung** in $\R^3$.
+
+1. Mit linear abhängigen Vektoren $\vec{u}=(0,1,1)^\top$,
+ $\vec{v}=(1,0,1)^\top$ und $\vec{w}=(2,0,2)^\top$ entsteht ein
+ zweidimensionaler Spann, da $\vec{w}$ durch $2\vec{v}$ ersetzt
+ werden kann:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[xlabel={$x$},ylabel={$y$},zlabel={$z$}]
+ \addplot3[surf, mesh]
+ {x+y};
+ \fill[red] (0,0,0) circle (2pt);
+ \draw[->, ultra thick] (0,0,0) -- node [above] {$\vec{u}$} (0,3,3);
+ \draw[->, ultra thick] (0,3,3) -- node [above] {$\vec{v}$} (3,3,6);
+ \draw[->, ultra thick] (3,3,6) -- node [above] {$\vec{w}$} (5,3,8);
+ \draw[->, ultra thick, blue] (0,0,0) -- node [above] {$\vec{k}$} (5,3,8);
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+2. Mit linear unabhängigen Vektoren $\vec{u}=(0,1,1)^\top$,
+ $\vec{v}=(1,0,1)^\top$ und $\vec{w}=(0,0,1)^\top$ entsteht ein
+ dreidimensionaler Spann, da keiner der Vektoren durch eine
+ Linearkombination anderer Vektoren dargestellt werden kann (siehe
+ auch Kapitel *[Lineare Hülle](#lspan))*:
+
+```{=tex}
+\begin{center}\begin{tikzpicture}
+\begin{axis}[xlabel={$x$},ylabel={$y$},zlabel={$z$}]
+ \addplot3[surf, mesh]
+ {x+y-8};
+ \fill[red] (0,0,0) circle (2pt);
+ \draw[->, ultra thick] (0,0,0) -- node [above] {$\vec{u}$} (0,3,3);
+ \draw[->, ultra thick] (0,3,3) -- node [above] {$\vec{v}$} (3,3,6);
+ \draw[->, ultra thick] (3,3,6) -- node [right] {$\vec{w}$} (3,3,-2);
+ \draw[->, ultra thick, blue] (0,0,0) -- node [above] {$\vec{k}$} (3,3,-2);
+\end{axis}
+\end{tikzpicture}\end{center}
+```
+:::
+
+## Basis
+
+::: defi
+Eine **Basis** $\mathcal{B}$ für $V$ ist ein linear unabhängiges
+Erzeugendensystem für $V$, d.h. es gilt
+$$\mathrm{Lin}(\mathcal{B}) = V\quad\land\quad\mathcal{B} \text{ ist linear unabhängig}.$$
+Sie ist also eine Familie an linear unabhängigen Vektoren, die einen
+Raum aufspannen.
+:::
+
+::: bsp
+**Beispiele**:
+
+1. Die Koordinateneinheitsvektoren $e_1=(1,0,...,0)^\top$,
+ $e_2=(0,1,0,...,0)^\top$ bis $e_n=(0,0,0,...,1)^\top$ sind eine
+ Basis des $n$-dimensionalen Raumes $\R^n$
+2. Die Monome $1,x,x^2,x^3,...$ bilden eine Basis des
+ unendlichdimensionalen Raumes aller Polynome.
+:::
+
+**Eigenschaften**:
+
+1. Aus jedem endlichen Erzeugendensystem eines Vektorraums kann man
+ eine Basis auswählen.
+2. Jeder endlich erzeugte Vektorraum hat eine endliche Basis.
+3. Jeder Vektorraum besitzt eine Basis.
+4. Hat $V$ eine endliche Basis von $n$ Vektoren, so hat jede Basis von
+ $V$ genau $n$ Vektoren.
+5. Jede linear unabhängige Familie von $n=\mathrm{dim}(V)$ Vektoren ist
+ eine Basis von $V$.
+
+TODO: 11.24?
+
+### Steinitzsches Austauschlemma
+
+Mit der endlichen Basis $\mathcal{B} = (b_1,...,b_n)$ von $V$ und
+$V\ni b \neq 0$ existiert $i\in\{1,...,n\}$, sodass
+$\mathcal{B}' = (b_1,...,b_{i-1}, b, b_{i+1},...,b_n)$ eine Basis von
+$V$ ist.
+
+### Steinitzscher Austauschsatz
+
+Mit der endlichen Basis $\mathcal{B} = (b_1,...,b_n)$ von $V$ und der
+linear unabhängigen Familie $\mathcal{F} = (b'_1,...,b'_m)$ ist
+$m\leq n$ und es gibt $J\subset\{1,...,n\}$ derart, sodass man nach
+Austausch von $(b_i)_{i\in J}$ gegen $\mathcal{F}$ wieder eine Basis von
+$V$ erhält.
+
+## Dimension
+
+::: defi
+Die **Dimension** $\mathrm{dim}_K(V)$ eines Vektorraums $V$ entspricht
+der Anzahl der Vektoren einer Basis von $V$, sofern diese endlich ist,
+und $\mathrm{dim}_K(V) = \infty$, wenn es keine endliche Basis von $V$
+gibt. Wenn aus dem Kontext klar wird, über welchem Körper der Vektorraum
+gebildet ist, dann schreibt man auch
+$\mathrm{dim}(V) = \mathrm{dim}_K(V)$.
+:::
+
+Zusammenfassend gilt:
+
+```{=tex}
+\begin{splitty}
+&V \text{ ist $n$-dimensional}\\
+\iff &\text{Je $n$ linear unabhängige Vektoren bilden eine Basis.}\\
+\iff &\text{Eine (und damit jede) Basis hat $n$ Elemente.}\\
+\iff &\text{Es gibt $n$ linear unabhängige Vektoren mit $V = \mathrm{Lin}(v_1,...,v_n)$.}\\
+\iff &\text{Es gibt $n$ linear unabhängige Vektoren, aber jeweils $n+1$ Vektoren sind linear abhängig.}
+\end{splitty}
+```
+::: bsp
+**Beispiele**:
+
+1. $\mathrm{dim}_K(K^n)=n$.
+2. $\mathrm{dim}_\R(\R)=1,\ \mathrm{dim}_\Q(\R)=\infty$.
+3. $\mathrm{dim}_\R(\C)=2.$
+:::
+
+# Lineare Abbildungen
+
+TUDU.
+
+# Matrizen
+
+TUDU.
+
+------------------------------------------------------------------------
+
+## Blockmatrizen
+
+Eine **$m\times n$-Blockmatrix** $M$ über $K$ mit Blöcken
+(Untermatrizen) $A_{ij} \in K^{m_i\times n_i}$ für $i=1,...,k$ und
+$j=1,...,l$, sodass $m_1 + ... + m_k = m$ und $n_1+...+n_l=n$ ist, ist
+ein rechteckiges Schema der Form
+$$M = \begin{pmatrix}A_{11}&A_{12}&\dots&A_{1l}\\A_{21}&A_{22}&\dots&A_{2l}\\\vdots&\vdots&\ &\vdots\\A_{k1}&A_{k2}&\dots&A_{kl}\end{pmatrix}\in K^{m\times n}$$
+
+::: bsp
+**Beispiel**:
+$$K^{n\times n} \ni M = \begin{pmatrix}A&B\\C&D\end{pmatrix}$$ TODO:
+Elemente klassifizieren
+:::
+
+Mit $$K^{n\times n} \ni M = \begin{pmatrix}A&B\\C&D\end{pmatrix}$$ und
+$$K^{n\times n} \ni M\ = \begin{pmatrix}A'&B'\\C'&D'\end{pmatrix}$$gilt
+$$MM' = \begin{pmatrix}A&B\\C&D\end{pmatrix}\begin{pmatrix}A'&B'\\C'&D'\end{pmatrix} = \begin{pmatrix}AA'+BC'&AB'+BD'\\CA'+DC'&CB'+DD'\end{pmatrix}$$
+
+------------------------------------------------------------------------
+
+Mit $$K^{n\times n} \ni M = \begin{pmatrix}A&B\\C&D\end{pmatrix}$$ und
+$A\in K^{r\times r}$ und $C=0$ gilt:
+$$M \text{ ist invertierbar} \iff A \text{ und } D \text{ sind invertierbar.}$$
+Ist dies der Fall, dann ist
+$$M^{-1} = \begin{pmatrix}A^{-1}&-A^{-1}BD^{-1}\\0&D^{-1}\end{pmatrix}$$
+
+------------------------------------------------------------------------
+
+Die Menge aller invertierbaren Matrizen der Form
+$\mathrm{GL}(n,K)\ni\begin{pmatrix}A&B\\0&D\end{pmatrix}$ mit $A,B,D$
+wie zuvor ist eine Untergruppe von $\mathrm{GL}(n,K)$.
+
+------------------------------------------------------------------------
+
+Sei $A\in K^{n\times n}$ eine **(obere) Dreiecksmatrix**, d.h.
+$$A=(a_{ij})_{ij} = 1,...,n \text{ und } a_{ij}=0\text{ für } i > j.$$
+Genau dann ist $A$ invertierbar, wenn alle $a_{ii} \neq 0, i=1,...,n$
+sind.
+
+Explizit geschrieben wird eine solche Matrix wie folgt:
+$$A=\begin{pmatrix}a_{11}&a_{12}&\dots&a_{1n}\\0&a_{22}&\dots&a_{2n}\\\vdots&\ddots&\ddots&\vdots\\0&\dots&0&a_{mn}\end{pmatrix}$$
+Da $A$ invertirebar ist genau dann, wenn $A^\top$ invertierbar ist, gilt
+die Aussage des vorigen Korollars auch für eine **(untere)
+Dreiecksmatrix**, also der Transponierten der oberen Dreiecksmatrix.
+
+------------------------------------------------------------------------
+
+Eine Diagonalmatrix
+$D=\mathrm{diag}(d_{11},...,d_{nn}) \in K^{n\times n}$ ist genau dann
+invertierbar, wenn $d_{ii} \neq 0$ für alle $i=1,...,n$ gilt. In diesem
+Fall ist $$D^{-1} = \mathrm{diag}()$$ TUDU: REST
+
+------------------------------------------------------------------------
+
+TODO: Lückenhaft
+
+## Elementare Zeilen- und Spaltenoperationen
+
+Eine Matrix $A\in K^{m\times n}$ besitzt **Zeilenstufenform**, wenn $A$
+folgende Form hat: $$A = \begin{pmatrix}
+ 0&\dots&0&a_{1j_1}&\ast&\dots&\ast&\ast&\ast&\dots&\ast&\ast&\ast&\dots&\ast\\
+ 0&\dots&0&0&0&\dots&0&a_{2j_2}&\ast&\dots&\ast&\ast&\ast&\dots&\ast\\
+ &\vdots&&&&\vdots&&&&\ddots&&&&\vdots&\\
+ 0&\dots&0&0&0&\dots&0&0&0&\dots&0&a_{rj_r}&\ast&\dots&\ast\\
+ 0&\dots&0&0&0&\dots&0&0&0&\dots&0&0&0&\dots&0\\
+ &\vdots&&&&\vdots&&&&\vdots&&&&\vdots&\\
+ 0&\dots&0&0&0&\dots&0&0&0&\dots&0&0&0&\dots&0
+\end{pmatrix}$$ wobei $j_1<j_2<...<j_r$ und $0\neq a_{kj_k}\in K$ für
+$k=1,...,r$ gilt und $*$ für ein beliebiges Element in $K$ steht. Die
+Einträge $a_{1j_1},...,a_{rj_r}$ sind die **Pivoteinträge**. Man sagt,
+dass $A$ **normierte Zeilenstufenform** hat, wenn sie Zeilenstufenform
+mit Pivoteinträgen $a_{1j_1} = ... = a_{rj_r} = 1$ besitzt.
+
+------------------------------------------------------------------------
+
+Mit der Matrix $a\in K^{m\times n}$ mit Zeilenvektoren
+$z_1,...,z_m\in K^{1\times n}$. Man unterscheidet drei Typen von
+**elementaren Zeilenoperationen** der Matrix $A$:
+
+1. Addition des $\lambda$-fachen der $j$-ten Zeile zur $i$-ten Zeile
+ wobei $i\neq j$ und $\lambda\in K$:
+ $$Z_{\lambda;j,i}: \begin{pmatrix}z_1\\\vdots\\z_i\\\vdots\\z_j\\\vdots\\z_m\end{pmatrix} \mapsto \begin{pmatrix}z_1\\\vdots\\z_i+\lambda z_j\\\vdots\\z_j\\\vdots\\z_m\end{pmatrix}$$
+2. Vertauschen der $i$-ten mit der $j$-ten Zeile:
+ $$Z_{i,j}: \begin{pmatrix}z_1\\\vdots\\z_i\\\vdots\\z_j\\\vdots\\z_m\end{pmatrix}\mapsto\begin{pmatrix}z_1\\\vdots\\z_j\\\vdots\\z_i\\\vdots\\z_m\end{pmatrix}$$
+3. Multiplikation der $i$-ten Zeile von $A$ mit $0\neq\lambda\in K$:
+ $$Z_{\lambda;i}: \begin{pmatrix}z_1\\\vdots\\z_i\\\vdots\\z_m\end{pmatrix} \mapsto \begin{pmatrix}z_1\\\vdots\\\lambda\cdot z_i\\\vdots\\z_m\end{pmatrix}$$
+
+Dieselben Regeln gelten analog auch für Spaltenvektoren und
+Spaltenoperationen.
+
+------------------------------------------------------------------------
+
+Mit der Matrix $A\in K^{m\times n}$ gelten folgende Aussagen:
+
+1. Man kann $A$ durch endlich viele elementaren Zeilenoperationen vom
+ Typ (i) und (ii) in Zeilenstufenform bringen.
+2. Beistzt $A$ Zeilenstufenform, so kann man $A$ durch endlichviele
+ elementaren Zeilenoperationen vom Typ (iii) in normierte
+ Zeilenstufenform bringen.
+
+## Gaußsches Eliminationsverfahren
+
+Sei $0\neq A\in K^{m\times n}$.
+
+1. Finde die kleinste Zahl $0\leq j_1\leq n$, sodass die $j_1$-te
+ Spalte von $A$ keine Nullspalte ist.
+2. Wähle $0\leq i_1 \leq m$ mit $a_{i_1j_1} \neq 0$ und vertausche die
+ $i_1$-te und die $1$-te Zeile, d.h. wende $Z_{1,i_1}$ auf $A$ an.
+ Die so erhaltene Matrix $B=Z_{1,i_1}(A)$ hat die Form
+ $$B=(b_{ij})=\begin{pmatrix}0&\dots&0&a_{i_1j_1}&\ast&\dots&\ast\\0&\dots&0&\ast&\ast&\dots&\ast\\\vdots&&\vdots&\vdots&\vdots&&\vdots\\0&\dots&0&\ast&\ast&\dots&\ast\end{pmatrix}$$
+ wobei `\enquote{$\ast$}`{=tex} für ein beliebiges Element in $K$
+ steht.
+3. Für $i=2,...,m$ addiere man das $-\frac{b_{ij_1}}{a_{i_1j_1}}$-fache
+ der ersten Zeile zur $i$-ten Zeile, d.h. wende $Z_{\lambda_i;1,i}$
+ mit $\lambda_i = -\frac{b_{ij_1}}{a_{i_1j_1}}$ für $i=2,...,m$
+ sukzessive an. Dadurch ergibt sich eine Matrix
+ $C=(Z_{\lambda_m;1,m}\circ\dots\circ Z_{\lambda_2;1,2})(B)$ der Form
+ $$C = (c_{ij}) = \begin{pmatrix}0&\dots&0&a_{i_1j_1}&\ast&\dots&\ast\\0&\dots&0&0&\bullet&\dots&\bullet\\\vdots&&\vdots&\vdots&\vdots&&\vdots\\0&\dots&0&0&\bullet&\dots&\bullet\end{pmatrix}$$
+ wobei `\enquote{$\ast$}`{=tex} für das gleiche Element wie in der
+ Matrix $B$ steht und TODO für ein beliebiges Element in $K$ steht.
+ Damit hat man für die erste Zeile den gewünschten Zustand erreicht.
+4. Wiederhole Algorithmus auf $D=(c_{(i_1)j})_{i=1,...,m-1;j=1,...,n}$
+ an.
+
+TODO: Beispiel Algorithmus Treppenform
+
+------------------------------------------------------------------------
+
+Sei $A\in K^{m\times n}$ eine Matrix in Zeilenstufenform mit $r$
+Pivotspalten. Dann kann $A$ mittels endlich vieler elementarer
+Spaltenoperationen vom Typ (i) und vom Typ (ii) auf folgende Gestalt
+bringen $$\begin{pmatrix}D&0\\0&0\end{pmatrix}$$ wobei $D$ eine
+$r\times r$-Diagonalmatrix ist. Durch Spaltenoperationen vom Typ (iii)
+erreicht man weiter, dass $D=E_r$ gilt.
+
+## Elementarmatrizen
+
+Die elementaren Zeilenoperationen lassen sich als Matrix-Matrix Produkte
+mit sogenannten **Elementarmatrizen** auffassen.
+
+1. Es gilt:
+ $$Z_{\lambda;i,j}(A) = \underbrace{\begin{pmatrix}1&0&&&&&0\\0&\ddots&&&&\\&&1&&\lambda&&\\&&&\ddots&&&\\&&&&1&&\\&&&&&\ddots&0\\0&&&&&0&1\end{pmatrix}}_{=:E_{m;\lambda_ij,i}\in K^{m\times m}} \cdot A$$
+2. Es gilt:
+ $$Z_{ij}(A) = \underbrace{\begin{pmatrix}1&0&&&&&0\\0&\ddots&&&&&\\&&0&&1&&\\&&&\ddots&&&\\&&1&&0&&\\&&&&&\ddots&0\\0&&&&&0&1\end{pmatrix}}_{=:E_{m;i,j}\in K^{m\times m}}$$
+3. Es gilt:
+ $$Z_{\lambda;i}(A) = \underbrace{\begin{pmatrix}1&0&&&&&0\\0&\ddots&&&&&\\&&1&&&&\\&&&\lambda&&&\\&&&&1&&\\&&&&&\ddots&0\\0&&&&&0&1\end{pmatrix}}_{=:E_{m;\lambda_ij,i}\in K^{m\times m}}$$
+
+(TUDU: nicht ganz fertig)
+
+------------------------------------------------------------------------
+
+Die elementaren Spaltenoperationen lassen sich auch als Matrix-Matrix
+Produkte mit **Elementarmatrizen** auffassen. Operationen der Spalten
+erfordern die Multiplikation mit Matrizen vonrechts, anstatt von links.
+Sei $B\in K^{m\times n}$, dann gilt:
+
+1. $S_{\lambda;i,j}(B) = B\cdot E_{n;\lambda;i,j}$
+2. $S_{ij}(B) = B\cdot E_{n;i,j}$
+3. $S_{\lambda;i}(B) = B\cdot E_{n;\lambda;i}$
+
+------------------------------------------------------------------------
+
+Sei $A\in K^{m\times n}$. Dann gelten folgende Aussagen:
+
+1. Es gibt Elementarmatrizen $S_1,...,S_k\in K^{m\times m}$, sodass
+ $$S_k...S_1\cdot A$$ normierte Zeilenstufenform besitzt.
+2. Besitzt $A$ Zeilenstufenform mit $r$ Pivotspalten, so gibt es
+ Elementarmatrizen $T_1,...,T_l\in K^{n\times n}$ mit
+ $$A\cdot T_1...T_l=\begin{pmatrix}E_r&0\\0&0\end{pmatrix}.$$
+3. Es gibt Elementarmatrizen $S_1,...,S_k\in K^{m\times m}$ und
+ $T_1,...,T_l\in K^{n\times n}$ mit
+ $$S_k...S_1\cdot A\cdot T_1...T_l=\begin{pmatrix}E_r&0\\0&0\end{pmatrix}$$
+
+::: bsp
+**Beispiel**: Bestimmen der Matrizen $S$ und $T$.
+$$A=\begin{pmatrix}1&-1&1\\1&0&-1\end{pmatrix}\in\Q^{2\times3}$$ Nun
+führt man folgende Schritte durch:
+
+```{=tex}
+\begin{splitty}
+&\left( \begin{pmatrix}1&-1&1\\1&0&-1\end{pmatrix},\begin{pmatrix}1&0\\0&1\end{pmatrix},\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix} \right )\\
+\leadsto &\left( \begin{pmatrix}1&-1&1\\0&1&-2\end{pmatrix},\begin{pmatrix}1&0\\-1&1\end{pmatrix},\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix} \right)\\
+\leadsto &\left( \begin{pmatrix}1&0&-1\\0&1&-2\end{pmatrix},\begin{pmatrix}1&0\\-1&1\end{pmatrix},\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix} \right)\\
+TUDU\\
+\end{splitty}
+```
+:::
+
+# Der Rang einer Matrix
+
+::: defi
+Sei $A\in K^{m\times n}$.
+
+1. Der **Spaltenraum** von $A$ ist der durch die Spalten $s_1,...,s_n$
+ von $A$ erzeugte Untervektorraum $\mathrm{Lin}(s_1,...,s_n)$ von
+ $K^m$.
+2. Der **Spaltenrang** von $A$ ist die Dimension des Spaltenraums von
+ $A$:
+ $$\mathrm{rank}_S(A) = \mathrm{dim}(\mathrm{Lin}(s_1,...,s_n))$$
+:::
+
+::: bsp
+**Beispiele**:
+
+1. Der Spaltenrang der Einheitsmatrix in $K^n$ ist
+ $\mathrm{rank}_SE_n=n$. Allgemeiner gilt
+ $$\mathrm{rank}_S \begin{pmatrix}E_r&0\\0&0\end{pmatrix} = r.$$
+2. Mit der Matrix $\begin{pmatrix}1&3&3\\2&6&2\\3&9&1\end{pmatrix}$
+ gilt
+ $\mathrm{Lin} = \left( \begin{pmatrix}1\\2\\3\end{pmatrix} \begin{pmatrix}3\\6\\9\end{pmatrix} \begin{pmatrix}3\\2\\1\end{pmatrix}\right) = \mathrm{Lin}\left(\begin{pmatrix}1\\2\\3\end{pmatrix} \begin{pmatrix}3\\2\\1\end{pmatrix}\right)$
+ TUDU: Gekritzel
+:::
+
+------------------------------------------------------------------------
+
+Mit Matrix $A\in K^{m\times n}$ mit Spalten $s_1,...,s_n$ und
+$\varphi_A: K^n\to K^m, v\mapsto Av$ gilt
+$$\mathrm{im}(\varphi_A) = \mathrm{Lin}(s_1,...,s_n)\quad\text{und}\quad\mathrm{dim}(\mathrm{im}(\varphi_A)) = \mathrm{rank}_S(A)$$
+
+------------------------------------------------------------------------
+
+Mit Matrix $A\in K^{m\times n}$ gilt:
+
+1. Ist $T\in K^{n\times n}$ invertierbar, so gilt
+ $\mathrm{rank}_S(AT) = \mathrm{rank}_S(A)$.
+2. Ist $S\in K^{m\times m}$ invertierbar, so gilt
+ $\mathrm{rank}_S(SA) = \mathrm{rank}_S(A)$.
+
+------------------------------------------------------------------------
+
+Mit Matrix $A\in K^{m\times n}$ und $r\in\N$ sind folgende Aussagen
+äquivalent:
+
+1. $\mathrm{rank}_S(A) = r$.
+2. Es existieren Elementarmatrizen $S_1,...,S_K\in K^{m\times m}$ und
+ $T_1,...,T_1\in K^{n\times n}$ mit
+ $$S_k...S_1\cdot A\cdot T_1...T_l = \begin{pmatrix}E_r&0\\0&0\end{pmatrix}$$
+
+------------------------------------------------------------------------
+
+Sei $A\in K^{m\times n}$. Dann gilt:
+
+1. Der **Zeilenraum** von $A$ ist der durch die Zeilen $z_1,...,z_m$
+ von $A$ erzeugte Untervektorraum $\mathrm{Lin}(z_1,...,z_m)$ von
+ $K^n$.
+2. Der **Zeilenrang** von $A$ ist die Dimension des Zeilenraums von
+ $A$:
+ $$\mathrm{rank}_Z(A) = \mathrm{dim}(\mathrm{Lin}(z_1,...,z_m)).$$
+
+------------------------------------------------------------------------
+
+Sei $A\in K^{m\times n}$. Dann stimmen Zeilen- und Spaltenrang der
+Matrix $A$ überein und man bezeichnet diesen als **Rang** von $A$:
+$$\mathrm{rank}(A) = \mathrm{rank}_Z(A) = \mathrm{rank}_S(A).$$
+
+------------------------------------------------------------------------
+
+Für eine Matrix $A\in K^{n\times n}$ sind folgende Aussagen äquivalent:
+
+1. Die Spalten von $A$ bilden eine Basis des $K^n$.
+2. Die Zeilen von $A$ bilden eine Basis des $K^n$.
+3. Es gilt $\mathrm{rank}(A) = n$.
+4. $A$ ist ein Produkt von Elementarmatrizen.
+5. $A$ ist invertierbar. Insbesondere wird die Gruppe
+ $\mathrm{GL}(n,K)$ von den Elementarmatrizen erzeugt.
+
+::: bsp
+**Beispiel**: Bestimmen dse Inversen zu
+$$A = \begin{pmatrix}0&0&1\\-1&1&0\\1&0&1\end{pmatrix}\in\Q^{3\times 3}.$$
+Dazu bildet man das Tupel $(A,E_3)$: TUDU: Annotationen
+
+```{=tex}
+\begin{splitty}
+\left( \begin{pmatrix}0&0&1\\-1&1&0\\1&0&1\end{pmatrix}, \begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix}\right) &\leadsto \left( \begin{pmatrix}1&0&1\\-1&1&0\\0&0&1\end{pmatrix}, \begin{pmatrix}0&0&1\\0&1&0\\1&0&0\end{pmatrix}\right)\\
+&\leadsto \left( \begin{pmatrix}1&0&0\\-1&1&0\\0&0&1\end{pmatrix}, \begin{pmatrix}-1&0&1\\0&1&0\\1&0&0\end{pmatrix}\right)\\
+&\leadsto \left( \begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix}, \begin{pmatrix}-1&0&1\\-1&1&1\\1&0&0\end{pmatrix}\right)
+\end{splitty}
+```
+Damit erhält man
+$$A^{-1} = \begin{pmatrix}-1&0&1\\-1&1&1\\1&0&0\end{pmatrix}.$$
+:::
+
+# Lineare Gleichungssysteme
+
+::: defi
+Ein **lineares Gleichungssystem** über $K$ in den Variablen
+$x_1,...,x_n$ ist ein Gleichungssystem der Form
+
+```{=tex}
+\begin{splitty}
+a_{11}x_1 + ... + a_{1n}x_n &= b_1,\\
+&\hspace*{2mm}\vdots\\
+a_{m1}x_1 + ... + a_{mn}x_n &= b_m,
+\end{splitty}
+```
+mit Koeffizienten $a_{ij},b_i\in K$. Man nennt das Gleichungssytem
+**homogen**, falls $b_1=...=b_m=0$ gilt, und sonst nennt man es
+**inhomogen**.
+
+Eine **Lösung** des Gleichungssystems ist ein Vektor $u\in K^n$, der
+alle Gleichungen erfüllt. Das System heißt **lösbar**, wenn eine Lösung
+existiert.
+:::
+
+------------------------------------------------------------------------
diff --git a/notes/mathe2/main.pdf b/notes/mathe2/main.pdf
new file mode 100644
index 0000000..7f7ad91
--- /dev/null
+++ b/notes/mathe2/main.pdf
Binary files differ
diff --git a/notes/mathe2/makefile b/notes/mathe2/makefile
new file mode 100644
index 0000000..895c28d
--- /dev/null
+++ b/notes/mathe2/makefile
@@ -0,0 +1,31 @@
+VIEW = zathura
+
+all:
+ @mkdir -p build/
+ @pandoc main.md --filter pandoc-latex-environment --toc -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o $(CURDIR)/build/main.tex --pdf-engine-opt=-shell-escape -H header.tex -B title.tex >/dev/null
+ @(pdflatex -shell-escape -halt-on-error -output-directory $(CURDIR)/build/ $(CURDIR)/build/main.tex | grep '^!.*' -A200 --color=always ||true) &
+ @progress 3 pdflatex
+ @cp build/main.pdf . &>/dev/null
+ @echo done.
+
+exam:
+ @mkdir -p build/
+ @pandoc exam.md --filter pandoc-latex-environment --toc -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o $(CURDIR)/build/exam.tex --pdf-engine-opt=-shell-escape -H header.tex -B examtitle.tex >/dev/null
+ @(pdflatex -shell-escape -halt-on-error -output-directory $(CURDIR)/build/ $(CURDIR)/build/exam.tex | grep '^!.*' -A200 --color=always ||true) &
+ @progress 1 pdflatex
+ @cp build/exam.pdf . &>/dev/null
+ @echo done.
+
+part:
+ @mkdir -p build/
+ @pandoc part.md --filter pandoc-latex-environment -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o $(CURDIR)/build/main.tex --pdf-engine-opt=-shell-escape -H header.tex >/dev/null
+ @(pdflatex -shell-escape -halt-on-error -output-directory $(CURDIR)/build/ $(CURDIR)/build/main.tex | grep '^!.*' -A200 --color=always ||true) &
+ @progress 1 pdflatex
+ @echo done.
+
+clean:
+ @$(RM) -rf build
+
+run: all
+ @clear
+ @$(VIEW) build/main.pdf
diff --git a/notes/mathe2/title.tex b/notes/mathe2/title.tex
new file mode 100644
index 0000000..2a33392
--- /dev/null
+++ b/notes/mathe2/title.tex
@@ -0,0 +1,25 @@
+\begin{titlepage}
+ \begin{center}
+ \vspace*{1cm}
+
+ {\huge\textbf{Mathematik für Informatik 2}}
+
+ \vspace{0.5cm}
+ {\Large Inoffizielles Skript}\\
+ \textbf{Marvin Borner}
+
+ \vfill
+ \includegraphics[width=0.4\textwidth]{ochs_logo}\\
+ \vfill
+
+ Vorlesung gehalten von\\
+ \textbf{Peter Ochs}
+
+ \vspace{0.8cm}
+
+ \includegraphics[width=0.4\textwidth]{uni_logo}\\
+ Sommersemester 2022
+ \end{center}
+\end{titlepage}
+
+\pagebreak\hspace{0pt}\vfill\begin{center}{\Large Dies ist mein Mitschrieb aus den Vorlesungen und ist demnach relativ ähnlich zum offiziellen Skript. Ich schreibe außerdem eine Klausurzusammenfassung, welche auf \url{https://marvinborner.de/mathe2zus.pdf} zu finden ist.}\end{center}\vfill\hspace{0pt}\pagebreak
diff --git a/notes/mathe3/header.tex b/notes/mathe3/header.tex
new file mode 100644
index 0000000..4c487db
--- /dev/null
+++ b/notes/mathe3/header.tex
@@ -0,0 +1,77 @@
+\usepackage{braket}
+\usepackage{polynom}
+\usepackage{amsthm}
+\usepackage{csquotes}
+\usepackage{svg}
+\usepackage{environ}
+\usepackage{mathtools}
+\usepackage{tikz,pgfplots}
+\usepackage{titleps}
+\usepackage[breakable]{tcolorbox}
+\usepackage{enumitem}
+\usepackage{listings}
+\usepackage{stmaryrd}
+\usepackage[X2,T1]{fontenc}
+\usepackage[ddmmyyyy,hhmmss]{datetime}
+
+\pgfplotsset{width=10cm,compat=1.15}
+\usepgfplotslibrary{external}
+\usetikzlibrary{calc,trees,positioning,arrows,fit,shapes}
+%\tikzexternalize
+\setcounter{MaxMatrixCols}{20}
+\graphicspath{{assets}}
+
+\newpagestyle{main}{\sethead{\toptitlemarks\thesection\quad\sectiontitle}{}{\thepage}\setheadrule{.4pt}}
+\pagestyle{main}
+
+\newtcolorbox{proof-box}{title=Beweis,colback=green!5!white,arc=0pt,outer arc=0pt,colframe=green!60!black,breakable}
+\newtcolorbox{bsp-box}{title=Beispiel,colback=orange!5!white,arc=0pt,outer arc=0pt,colframe=orange!60!black,breakable}
+\newtcolorbox{visu-box}{title=Visualisation,colback=cyan!5!white,arc=0pt,outer arc=0pt,colframe=cyan!60!black,breakable}
+\newtcolorbox{bem-box}{title=Bemerkung,colback=gray!5!white,arc=0pt,outer arc=0pt,colframe=gray!60!black,breakable}
+
+\newcommand\toprove{\textbf{Zu zeigen: }}
+
+\newcommand\N{\mathbb{N}}
+\newcommand\R{\mathbb{R}}
+\newcommand\Z{\mathbb{Z}}
+\newcommand\Q{\mathbb{Q}}
+\renewcommand\C{\mathbb{C}}
+\renewcommand\P{\mathbb{P}}
+\newcommand\M{\mathcal{M}}
+\renewcommand\O{\mathcal{O}}
+\newcommand\pot{\mathcal{P}}
+\newcommand{\cupdot}{\mathbin{\mathaccent\cdot\cup}}
+\newcommand{\bigcupdot}{\dot{\bigcup}}
+
+% WTF
+\DeclareTextSymbolDefault{\CYRABHDZE}{X2}
+\newcommand{\Ezh}{\CYRABHDZE}
+\newcommand\yogh{\text\Ezh}
+
+\DeclareMathOperator{\sgn}{sgn}
+\DeclareMathOperator{\ggT}{ggT}
+\DeclareMathOperator{\kgV}{kgV}
+\DeclareMathOperator{\grad}{grad}
+
+\newlist{abc}{enumerate}{10}
+\setlist[abc]{label=(\alph*)}
+
+\newlist{num}{enumerate}{10}
+\setlist[num]{label=\arabic*.}
+
+\newlist{rom}{enumerate}{10}
+\setlist[rom]{label=(\roman*)}
+
+\makeatletter
+\renewenvironment{proof}[1][\proofname] {\par\pushQED{\qed}\normalfont\topsep6\p@\@plus6\p@\relax\trivlist\item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces}{\popQED\endtrivlist\@endpefalse}
+\makeatother
+\def\qedsymbol{\sc q.e.d.} % hmm?
+\def\wtf{\renewcommand*{\qedsymbol}{\sc w.t.f.}\qed} % hmm?
+
+\lstset{
+ basicstyle=\ttfamily,
+ mathescape
+}
+
+% TODO: parenthesis
+\newcommand\pdiv[1]{\text{\quad(div #1)}}
diff --git a/notes/mathe3/main.md b/notes/mathe3/main.md
new file mode 100644
index 0000000..2ac7aaa
--- /dev/null
+++ b/notes/mathe3/main.md
@@ -0,0 +1,1893 @@
+---
+author: Marvin Borner
+date: "`\\today`{=tex}"
+lang: de-DE
+pandoc-latex-environment:
+ bem-box:
+ - bem
+ bsp-box:
+ - bsp
+ proof-box:
+ - proof
+ visu-box:
+ - visu
+toc-title: Inhalt
+---
+
+```{=tex}
+\newpage
+```
+# Ergänzungen zur elementaren Zahlentheorie
+
+## Teiler, Vielfaches
+
+Sei $a,b\in\Z,\ b\neq0$. $b$ heißt Teiler von $A$
+$(b\mid a) \iff \exists q\in\Z: a= qb.$
+
+::: bsp
+$$6 \mid 24$$ $$1 \mid 0$$ $$6 \nmid 5$$
+:::
+
+## Division mit Rest
+
+Sei $a,b\in\Z,\ b\neq0$. Es gibt eindeitig bestimmbare $q,r\in\Z$ mit
+
+1. $a = qb + r$
+2. $0 \leq r < |b|.$
+
+::: bem
+$q$ heißt Quotient, $r$ heißt Rest.
+:::
+
+::: proof
+```{=tex}
+\begin{proof}
+Folgerung aus Fundamentalsatz der Arithmetik. Siehe Mathe 2.
+\end{proof}
+```
+:::
+
+::: bsp
+1. $a=22$, $b=5$ $$22\pdiv{5}=4,\quad22\pmod{5}=2$$
+2. $a=-22$, $b=5$ $$-22\pdiv{5}=-5,\quad-22\pmod{5}=3$$
+3. Für $a\in\R$ und $b\in\Z$ gilt mit $q\in\Z$ und $r\in\R$ gilt z.B.:
+ $$a=\frac{8}{3},\ b=1\quad\implies\quad\frac{8}{3} = 2\cdot1+\frac{2}{3}$$
+:::
+
+## Zyklische Strukturen in Planetenbewegungen
+
+Für die langfristige Stabilität der Planetenbewegungen sind
+Konjunktions- und Oppostionsstellungen von Bedeutung:
+
+::: visu
+```{=tex}
+\begin{minipage}{.45\textwidth}
+\begin{center}\begin{tikzpicture}[bullet/.style={circle, fill, inner sep=1pt}]
+\node[draw=black,inner sep=20mm,circle] {};
+\node[draw=black,inner sep=10mm,circle] {};
+\node[bullet,label=-90:$S$] (0) at (0:0mm) {};
+\node[bullet,label=-120:$P_1$] (1) at (0:14.2mm) {};
+\node[bullet,label=-120:$P_2$] (2) at (0:28.3mm) {};
+\node (a) at (3.3,0) {};
+\node (b) at (2.5,2) {};
+\draw (0)--(1);
+\draw (1)--(2);
+\draw [->] (a) to [out=90,in=-45] (b);
+\end{tikzpicture}\end{center}
+Konjunktion der Planeten $P_1, P_2$: Von $P_1,P_2$ geht gemeinsam größt mögliche gravitative Kraft aus.
+\end{minipage}%
+\hfill%
+\begin{minipage}{.45\textwidth}
+\begin{center}\begin{tikzpicture}[bullet/.style={circle, fill, inner sep=1pt}]
+\node[draw=black,inner sep=20mm,circle] {};
+\node[draw=black,inner sep=10mm,circle] {};
+\node[bullet,label=-90:$S$] (0) at (0:0mm) {};
+\node[bullet,label=-120:$P_1$] (1) at (0:-14.2mm) {};
+\node[bullet,label=-120:$P_2$] (2) at (0:28.3mm) {};
+\node (a) at (3.3,0) {};
+\node (b) at (2.5,2) {};
+\draw (0)--(1);
+\draw (1)--(2);
+\draw [->] (a) to [out=90,in=-45] (b);
+\end{tikzpicture}\end{center}
+Opposition von $P_1,P_2$: Die gravitativen Kräfte von $P_1,P_2$ gleichen sich einigermaßen aus.
+\end{minipage}
+```
+:::
+
+Saturn und Jupiter sind mit Abstand die beiden massereichsten Planeten
+des Sonnensystems. Stehen Jupiter und Saturn in Konjunktion, so
+vollzieht sich eine Ausgleichgsbewegung, bei der die Sonne um ihren
+eigenen Durchmesser aus dem Baryzentrum wandert. Insgesamt sind die
+Konjunktionstermine aller Planeten so verteilt, dass das Sonnensystem
+stabil bleibt.
+
+Betrachte exemplarisch Venus und Erde. Es gilt:
+$$8\text{ Erdjahre} \approx 13 \text{ Venusjahre}.$$ Genauer:
+$8:13,0042.$ Abweichung von $8:13$ um ca. $0.032%$. Nehme zunächst an,
+dass das Verhältnis von $8:13$ exakt ist. In 8 Jahren überholt die Venus
+die Erde fünfmal.
+
+$\implies$ In 8 Jahren finden 5 Konjunktionen zwischen Venus und Erde
+statt.
+
+$\implies$ Findet zum Zeitpunkt $t=0$ eine Konjunktion statt, so findet
+nach $\frac{8}{5}=1\frac{3}{5}$ Jahren die nächste Konjunktion statt. In
+$\frac{8}{5}$ Erdjahren finden $\frac{13}{5}=2\frac{3}{5}$ Venusjahre
+statt. Beide Planeten befinden sich demzufolge bei $\frac{3}{5}$ ihrer
+Umlaufbahn:
+
+::: visu
+Positionen der Erde zu Konjunktionsterminen mit Venus (chronologisch
+verbunden).
+
+```{=tex}
+\begin{center}\begin{tikzpicture}[bullet/.style={circle, fill, inner sep=1pt}]
+ \foreach \lab [count=\c, evaluate=\c as \ang using {18+72*\c}]
+ in {0,\frac{4}{5},\frac{3}{5},\frac{2}{5},\frac{1}{5}} {
+ \node[bullet] (\c) at (\ang:20mm) {};
+ \node at (\ang:23mm){$\lab$};
+ }
+ \draw(1)--(4);
+ \draw(4)--(2);
+ \draw(2)--(5);
+ \draw(5)--(3);
+ \draw(3)--(1);
+ \node[draw=black,inner sep=14.2mm,circle] {};
+\end{tikzpicture}\end{center}
+```
+$$0 \xrightarrow{+\frac{8}{5}\pmod{1}} \frac{3}{5} \xrightarrow{+\frac{8}{5}\pmod{1}} \frac{1}{5} \xrightarrow{+\frac{8}{5}\pmod{1}} \frac{4}{5} \xrightarrow{+\frac{8}{5}\pmod{1}} \frac{2}{5} \xrightarrow{+\frac{8}{5}\pmod{1}} 0$$
+:::
+
+Man kann bei allen Zahlen den Nenner weglassen und stattdessen mod 5
+rechnen. Es ist außerdem $8\equiv3\pmod{5}.$
+
+$$0 \xrightarrow{+3\pmod{5}} 3 \xrightarrow{+3\pmod{5}} 1 \xrightarrow{+3\pmod{5}} 4 \xrightarrow{+3\pmod{5}} 2 \xrightarrow{+3\pmod{5}} 0$$
+
+Die Abfolge der Konjunktion wird demnach durch die zyklische Gruppe
+$\braket{3}$ beschrieben, $3\in(\Z_5, \oplus)$, vgl. Mathe 2.
+
+::: bem
+Das Pentagramm entstünde bei einem exakten Verhältnis von $8:13$.
+Tatsächliche Figur:
+`\begin{center}\includegraphics[scale=.2]{saturnearth.png}\end{center}`{=tex}
+:::
+
+## Größte/kleinste gemeinsame Teiler
+
+Seien $a_1,...,a_r\in\Z$.
+
+1. Ist mindestens ein $a_i\neq0$, so ist der größte gemeinsame Teiler
+ die größte natürliche Zahl, die alle $a_i$ teilt. Schreibweise:
+ $\ggT(a_1,...,a_r)$
+2. Sind alle $a_i\neq0$, so ist das kleinste gemeinsame Vielfache die
+ kleinste natürliche Zahl, die von allen $a_i$ geteilt wird.
+ Schreibweise: $\kgV(a_1,...,a_r)$.
+3. Ist $\ggT(a_1,...,a_r)=1$, so heißen $a_1,...,a_r$ teilerfremd. Ist
+ $\ggT(a_i,a_j)=1\ \forall i\neq j$, so heißen $a_1,...,a_r$
+ paarweise teilerfremd.
+
+::: bsp
+Im 3. Punkt stärkere Bedingung: $\ggT(3,7,9)=1$, aber $\ggT(3,9)=3$
+:::
+
+## Euklidischer Algorithmus zur Berechnung des ggT
+
+### Herleitung
+
+::: proof
+```{=tex}
+\toprove Seien $q,v,w\in\Z,\ v\neq0$. Dann: $$t\mid v \land t\mid w \iff t \mid v \land t \mid qv + w$$
+
+\begin{proof}
+Der vorigen Aussage.
+\begin{align*}
+\implies:\quad & t\mid v \land t\mid w \implies \exists k_1,k_2\in\Z: v = tk_1,\ w=k_2t\\
+&\implies qv + w = qtk1 + tk_2 = t(\underbrace{qk_1 + k_2}_{\in\Z}) \implies t\mid qv+w\\
+\impliedby:\quad & t\mid v \land t\mid qv+w \implies \exists k_1,k_2\in\Z: v = k_1t,\ qv+w=k_2t\\
+&\implies w = k_2t - qv = t(\smash{\underbrace{k_2-qk_1}_{\in\Z}}) \implies t\mid w
+\end{align*}
+\end{proof}
+```
+:::
+
+Es folgt $\ggT(v,w) = \ggT(v,q+v+w)$. damit lässt sich der euklidische
+Algorithmus formulieren. Seien $a,b\in\Z,\ b\neq0,\ b\nmid a$.
+**Frage**: Wie findet man $\ggT(a,b)$?
+
+**Idee**: Verwende Division mit Rest und
+`\begin{alignat*}{2}a_0 &= a, a_1 = b&&\\a_0 &= q_1a_1 + a_2\qquad&&|a_2|<|a_1|\\a_1 &= q_2a_2 + a_3\qquad&&|a_3|<|a_2|\\&\vdots&&\\a_{n-1} &= q_na_n + \underbrace{0}_{\mathclap{\text{erstmals Rest 0}}}\qquad&&|a_n|<|a_{n-1}|\end{alignat*}`{=tex}
+Es folgt:
+`\begin{align*} \ggT(a,b) &= \ggT(a_1,a_0) = \ggT(a_1,q_1a_1+a_2)\\ &= \ggT(a_1,a_2) = \ggT(a_2,\smash{\underbrace{q_2a_2+a_3}_{=a_1}})\\ &= \ggT(a_2,a_3)\\ &\quad\vdots\\ &= \ggT(\underbrace{a_{n-1}}_{q_na_n}, a_n) = a_n\end{align*}`{=tex}
+
+## Euklidischer Algorithmus
+
+```{=tex}
+\begin{lstlisting}
+Eingabe: $a,b\in\Z$, nicht beide =0
+if b=0 then y=|a| endif
+if b|a then y=|b| endif
+if b$\neq$0 and $b\nmid a$ then
+ x = a, y = b
+ while (x mod y)$\neq$0 do
+ r=(x mod y), x=y, y=r
+ endwhile
+endif
+Ausgabe: y (=ggT(a,b))
+\end{lstlisting}
+```
+::: bsp
+EA mit $a=48$ und $b=-30$:
+
+ x y r
+ ----- ------- ----
+ 48 -30 18
+ -30 18 6
+ 18 **6** 0
+
+Damit ist der größte gemeinsame Teiler mit 6 gefunden.
+:::
+
+## Satz von Méziriac
+
+$a,b\in\Z$, nicht beide $=0 \implies \exists s,t\in\Z:\ggT(a,b)=sa+tb$
+
+::: proof
+```{=tex}
+\begin{proof}
+\begin{align*}
+b = 0:\quad&\ggT(a,b) = |a| = sa+0b,\quad s=\mathrm{sgn}(a)\\
+b\ne0,\ b\mid a:\quad&\ggT(a,b)=|b|=0a+tb,\quad t=\mathrm{sgn}(b)\\
+b\ne0,\ b\nmid a:\quad&a_0:=a,a_1:=b\implies\mathrm{EA}\implies\ggT(a,b)=a_n,\quad n\ge2\\
+&\text{Zeige mit vollst. Induktion: }\exists s_j,t_j\in\Z: a_j=s_ja_0+t_ja_1\quad\forall j=0,..,n
+\end{align*}
+\end{proof}
+```
+:::
+
+## Erweiterter Euklidischer Algorithmus (EEA)
+
+Dient der Berechnung von $s,t$ im *Satz des Méziriac*.
+
+```{=tex}
+\begin{lstlisting}
+Eingabe: $a,b\in\Z$, nicht beide $=0$
+if b=0 then y=|a|, t=0
+ if a>0 then s=1 else s=-1 endif
+endif
+if b$\mid$a then y=|b|, s=0
+ if b>0 then t=1 else t=-1 endif
+endif
+if b$\ne$0 and b$\nmid$a then x=a, y=b
+ $s_1$=1, $s_2$=0
+ $t_1$=0, $t_2$=1
+ while (x mod y)$\ne$0 do
+ q=(x div y), r=(x mod y)
+ s=($s_1$-q$s_2$), t=$t_1$-q$t_2$
+ $s_1$=$s_2$, $s_2$=s
+ $t_1$=$t_2$, $t_2$=t
+ x=y, y=r
+ endwhile
+endif
+Ausgabe y (=ggT(a,b)), s,t (y=sa+tb)
+\end{lstlisting}
+```
+::: bsp
+$a=48$, $b=-30$
+
+ $x$ $y$ $s_1$ $s_2$ $s$ $t_1$ $t_2$ $t$ $q$ $r$
+ ----- ----- ------- ------- ----- ------- ------- ----- ----- -----
+ 48 -30 1 0 / 0 1 / / /
+ -30 18 0 1 1 1 1 1 -1 18
+ 18 6 / / 2 / / 3 -2 6
+
+$\implies\ggT(48,-30)=6=2\cdot48+4\cdot(-30)$
+:::
+
+::: bem
+Darstellung des ggT nicht eindeutig, z.B. ist auch
+$\ggT(48,-38)=6=7\cdot48+11\cdot(-30)$
+:::
+
+## Die Gruppe $(\Z_n^*, \odot)$
+
+Ist $(\Z_n^*, \odot)$ eine Gruppe? $(\Z_n,\odot)$
+
+- ist abgeschlossen: $a,b\in\Z_n\implies a\odot b\in\Z_n$
+- ist assoziativ
+- besitzt Neutralelement: $a\odot1=1\odot a=a\quad\forall a\in\Z_n$
+- enthält im Allgemeinen keine Inversen, z.B. hat $0$ keine Inverse
+
+**Welche Elemente haben Inversen?**
+
+::: bsp
+$5\in\Z_{10}$ hat keine Inverse, da
+$t\cdot x\pmod{10}=\begin{cases}0&x\text{ gerade}\\5&x\text{ ungerade}\end{cases}$,
+d.h. $5\odot x\ne1\quad\forall x\in\Z_{10}$
+
+Dagegen hat $3\in\Z_{10}$ Inverse $x=7$.
+:::
+
+**Aus Mathe 2**: $a\in\Z_n$ invertierbar $\iff \ggT(a,n)=1$
+
+Es ist $Z_n^*=\{a\in\Z_n\mid\ggT(a,n)=1\}$ die Menge aller
+invertierbaren Elemente in $\Z_n$ und ist bezüglich $\odot$ eine Gruppe.
+$\varphi(n)=|\Z_n^*|$ heißt Eulersche Phi-Funktion.
+
+Berechnung von $a^{-1}\in\Z_n$: Wegen EEA gibt es
+$s,t\in\Z: sa+tn=1 \implies sa\equiv1\pmod{n} \implies a^{-1}\equiv s\pmod{n}$
+
+::: bsp
+Inverse von $5\in\Z_{21}$ durch EEA: $(-4)\cdot5 + 1\cdot21=1$
+
+$\implies 5^{-1}\equiv-4\equiv17\pmod{21}$
+:::
+
+Falls man $s,t\in\Z$ nicht unmittelbar sieht: EEA.
+
+### Korollar
+
+$a,b\in\Z$, nicht beide $=0,\ c\in\Z$
+
+1. $\ggT(a,b)=1 \iff \exists s,t\in\Z: sa+tb = 1$
+2. $\ggT(a,b)=1 \implies \text{falls } a\mid bc$, dann $a\mid c$
+
+::: proof
+```{=tex}
+\begin{proof}
+In beide Richtungen:
+\begin{itemize}
+ \item \enquote{$\implies$}:\quad Gelte $sa+tb=1$. Annahme: $\ggT(a,b)>1$\\$d:=\ggT(a,b)\implies d\mid a,\quad d\mid b$ $\implies \exists k_1,k_2\in\Z:a=k_1d,\ b=k_2d$ $\implies sa+tb=d(sk_1+tk_2)\ne1$, da $d>1\ \lightning$, also $d=1$
+ \item \enquote{$\impliedby$}:\quad $\exists s,t\in\Z: 1=sa+tb\implies c=sac+tbc$, also $a\mid a$ und $a\mid bc$ $\implies a\mid(\underbrace{sac+tbc}_{=c})$
+\end{itemize}
+\end{proof}
+```
+:::
+
+## Primzahlen
+
+$p\in\N,\ p\ge2$ heißt Primzahl, wenn $1$ und $p$ die einzigen
+gemeinsamen Teiler von $p$ sind, d.h.
+$\ggT(k,p)=1\quad\forall k\in\{1,...,p-1\}$
+
+### Lemma von Euklid
+
+Sei $p\in\P,\ a_1,...,a_k\in\Z$.
+
+$p\mid a_1,...,a_n \implies \exists j\in\{1,...,k\}: p\mid a_j$
+
+Gegenbeispiel: $6$ keine Primzahl: $6\mid3\cdot4$, aber
+$6\nmid3\land6\nmid4$
+
+::: proof
+```{=tex}
+\begin{proof}
+Durch vollständige Induktion über $k$:
+
+IA: $k=1: p\mid a_1\implies p\mid a_1$
+
+IV: Lemma gelte für $k-1$ beliebige, ganzzahlige Faktoren
+
+IS: $k-1\to k$: \toprove Lemma gilt für $k$ Faktoren $a_1,...,a_k$.
+
+Fallunterscheidung:
+\begin{align*}
+p\mid a_k:\quad&\implies\text{fertig}\\
+p\nmid a_k:\quad&\implies\ggT(g,a_k)=1\text{, da } p\in\P\\
+&\implies p\mid a_1,...,a_{k-1}\\
+&\implies \exists j\in\{1,...,k-1\}:p\mid a_j
+\end{align*}
+\end{proof}
+```
+:::
+
+## Fundamentalsatz der elementaren Zahlentheorie
+
+Zu jeder natürlichen Zahl $n\ge2$ gibt es endlich viele paarweise
+verschiedene Primzahlen $p_1,...,p_k$ und natürliche Zahlen
+$e_1,...,e_k$ mit $$n = p_1^{e_1} \cdot ... \cdot p_k^{e_k}.$$ Die $p_i$
+heißen Primfaktoren von $n$. Die Darstellung von $n$ als Produkt von
+Primzahlen ist bis auf die Reihenfolge eindeutig.
+
+::: proof
+```{=tex}
+\begin{proof}
+~\\
+\begin{itemize}
+\item \textbf{Existenz:} Durch vollständige Induktion.
+\begin{align*}
+ \text{IA:}\quad&n=2\in\P\\
+ \text{IV:}\quad&\text{Aussage gelte für }2,...,n\\
+ \text{IS:}\quad&2,3,...,n\to n+1: \toprove\text{Aussage gilt dann auch für $n+1$}\\
+ &\text{Ist }n+1\in\P\implies\text{fertig.}\\
+ &\text{Ist }n+1\notin\P\implies n+1=a\cdot b,\quad a,b\in\{2,...,n\}\\
+ &\implies a,b\text{ Produkte von Primfaktoren}
+\end{align*}
+\item \textbf{Eindeutigkeit:} Sei $n\ge2$.
+\begin{rom}
+ \item Falls $n\in\P:\quad$Behauptung erfüllt.
+ \item Falls $n\notin\P:\quad$sei $n$ die kleinste natürliche Zahl mit $2$ verschiedenen Zerlegungen $n=p_1^{e_1}\cdot...\cdot p_k^{e_k}=q_1^{f_1}\cdot...\cdot q_e^{f_e}$\\
+ \toprove$\{p_1,...,p_k\}\cap\{q_1,...,q_e\}=\emptyset$\\
+ Angenommen nicht: O.B.d.a. $p_1=q_1$\\
+ $\frac{n}{p_1}<n\text{ und }\frac{n}{p_1}$ hat $2$ verschiedene Zerlegungen $\lightning$
+ \item $p_1\mid q_1^{f_1},...,q_e^{f_e} \implies \exists j\in\{1,...,k\}: p_i\mid q_j \implies p_1=q_j\text{, da }p_1\ne1\land q_j\in\P\lightning$
+\end{rom}
+\end{itemize}
+\end{proof}
+```
+:::
+
+## Euklid
+
+Es gibt unendlich viele Primzahlen.
+
+::: proof
+```{=tex}
+\begin{proof}
+Angenommen es gibt nur endlich viele Primzahlen
+$p_1,...,p_n$. Sei $a=p_1\cdot...\cdot p_n+1$
+
+$\implies\exists q\in\P: q\mid a$
+
+$\implies q=p_i$ für ein $i\in\{1,...,n\}$
+
+$\implies q\mid (\underbrace{a-p_1,...,p_n}_1)$ $\lightning$ (da
+$q>1$)
+\end{proof}
+```
+:::
+
+## Chinesischer Restsatz
+
+Gegeben: $m_1,...,m_n\in\N,\quad a\in\Z$ und $M=m_1\cdot...\cdot m_n.$
+Dann:
+$(\underbrace{a\pmod{M}}_{=r})\pmod{m_i}=a\pmod{m_i}\quad\forall i$
+
+::: proof
+```{=tex}
+\begin{proof}
+\toprove $r\equiv a\pmod{m_i}$.
+
+Division mit Rest: $\exists q\in\Z: a=qM+r=q\underbrace{\left(\frac{M}{m_i}\right)}_{\in\Z}m_i + r$
+
+$\implies a\equiv r\pmod{m_i}$
+\end{proof}
+```
+:::
+
+Gegeben:
+
+- $m_1,...,m_n\in\N$ paarweise teilerfremd,
+- $M=m_1\cdot...\cdot m_n$
+- $a_1,...,a_n\in\Z$
+
+Dann existiert $0\leq x<M$ mit *simultaner Kongruenz*
+$$x\equiv\begin{cases}a_1\pmod{m_1}\\\vdots\\a_n\pmod{m_n}\end{cases}$$
+
+::: proof
+```{=tex}
+\begin{proof}
+Setze $M_i:=\frac{M}{m_i}\in\Z\implies\ggT(m_i,M_i)=1\quad\forall i=1,...,n$
+
+$\implies \exists s_i,t_i\in\Z: s_i\cdot m_i + t_iM_i = 1$
+
+Setze $e_i:=t_iM_i\implies e_i\equiv\begin{cases}0\pmod{m_j}&j\ne i\\1\pmod{m_i}\end{cases}$
+
+$\implies x = \left(\sum_{i=1}^n a_ie_i\right)\pmod{M}$ Lösung, da:
+
+\begin{align*}
+x\pmod{m_j} &= \left(\left(\sum_{i=1}^n a_ie_i\right)\pmod{M}\right)\pmod{m_j}\\
+&= \left(\sum_{i=1}^n a_ie_i\right)\pmod{m_j}\\
+&= a_j \pmod{m_j}
+\end{align*}
+\end{proof}
+```
+:::
+
+::: bsp
+1. Finde $0\leq x<M$ mit $m_1=3,\ m_2=4,\ m_3=5\implies M=60$.
+ $M_1=\frac{M}{m_1}=20,\ M_2=\frac{60}{4}=15,\ M_3=\frac{60}{5}=12\\$**EEA**:`\begin{align*}7\cdot 3-20&=1\\4\cdot4-15&=1\\5\cdot5-2\cdot12&=1\end{align*}`{=tex}
+ $x=(2\cdot(-20)+3\cdot(-15)+2\cdot(-24))\pmod{60}=47$
+2. Was ist $2^{1000}\pmod{1155}$? Primfaktorzerlegung:
+ $1155=3\cdot5\cdot7\cdot11$
+ 1. Berechne $2^{1000}\pmod{3,5,7,11}$:
+ - $2^{1000}\pmod{3}=(-1)^{1000}\pmod{3}=1$
+ - $2^{1000}\pmod{5}=4^{500}\pmod{5}=(-1)^{500}\pmod{5}=1$
+ - $2^{1000}\pmod{7}=(8^{333}\cdot2)\pmod{7}=2$
+ - $2^{1000}\pmod{11}=(2^5)^{200}\pmod{11}=1$
+ 2. Suche $0\leq x<1155$ mit
+ $$x\equiv\begin{cases}1\pmod{3}\\1\pmod{5}\\2\pmod{7}\\1\pmod{11}\end{cases}$$
+ Chinesischer Restsatz liefert $x=331$
+:::
+
+Die Lösung $x$ aus vorigem Beispiel ist eindeutig.
+
+::: proof
+```{=tex}
+\begin{proof}
+Betrachte die Abbildung $\psi: \Z_M\to(\Z_{m_1}\times...\times\Z_{m_n})$, $x\mapsto(x\pmod{m_1},...,x\pmod{m_n})$. Der chinesische Restsatz besagt: Für jedes $n$-Tupel $(a_1,...,a_n)\in\Z_{m_1}\times...\times\Z_{m_n}$ gibt es ein $x\in\Z_M$ mit $\psi(x)=(a_1,...,a_n)$.
+
+$\implies\psi$ ist surjektiv.
+
+\toprove $\psi$ bijektiv, d.h. es gibt nur genau ein $x$, mit $\psi(x)=(a_1,,,.,a_n),\quad x\in\Z_M$. Da $M=m_1\cdot...\cdot m_n$ ist $|\Z_M|=|\Z_{m_1}\times...\times\Z_{m_n}|$
+
+$\implies$ Jedes Element von $\Z_{m_1}\times...\times\Z_{m_n}$ wird nur von genau einem $x$ getroffen
+
+$\implies \psi$ bijektiv
+\end{proof}
+```
+:::
+
+::: bsp
+Aus *Meister Suns Rechenhandbuch* von Sun Zi Suan Jing:
+
+"Es gibt eine unbekannte Zahl von Dingen. Wenn mit drei gezählt wird,
+haben sie einen Rest von zwei; wird mit fünf gezählt, einen Rest von
+drei, mit sieben einen Rest von zwei. Rate die Zahl."
+
+Formal: Suche $x$ mit
+$$x\equiv\begin{cases}2\pmod{3}\\3\pmod{5}\\2\pmod{7}\end{cases}$$
+
+TU DU!
+:::
+
+## Strukturgleichheit von Ringen
+
+Seien $(R, +, \cdot)$ und $(R',\oplus,\odot)$ Ringe.
+
+1. $\psi: R\to R'$ heißt (Ring-)Homomorphismus, falls
+ $\forall x,y\in R$ gilt $$\psi(x+y)=\psi(x)\oplus\psi(y)$$
+ $$\psi(x\cdot y)=\psi(x)\odot\psi(y)$$
+2. Wenn $\psi$ bijektiv, heißt $\psi$ (Ring-)Isomorphismus. In diesem
+ Fall heißen $R,R'$ isomorph (d.h. sie sind strukturgleich). Man
+ schreibt $R\cong R'$.
+
+::: bsp
+1. Boolesche Algebra:
+ $$(\{f,w\}, \texttt{XOR}, 1)\cong ({0,1},\oplus,\odot)$$
+ $\psi(f)=0,\psi(w)=1$. $\psi$ Isomorphismus, falls
+ Verknüpfungstafeln übereinstimmen
+ `\begin{center}\begin{tabular}{c||c c}\texttt{XOR}&f&w\\\hline f&f&w\\w&w&f\end{tabular}\end{center}`{=tex}
+ bzw.
+ `\begin{center}\begin{tabular}{c||c c}$\oplus$&0&1\\\hline0&0&1\\1&1&0\end{tabular}\end{center}`{=tex}
+2. Homomorphismus:
+ $$\psi(\Z,+,\cdot)\to(\Z_n,\oplus,\odot),\quad x\mapsto x\pmod{n}$$
+:::
+
+::: bem
+Seien $(R,+,\cdot)$ und $(R',\oplus, \odot)$ Ringe und $\psi:R\to R'$
+ein Isomorphismus.
+
+1. $\psi(1)$ ist Eins in $R'$: $\forall a\in R$, d.h. $\psi(a)\in R'$
+ gilt:
+ $$\psi(1)\odot\psi(a)=\psi(1\cdot a)=\psi(a)=\psi(a\cdot1)=\psi(a)\odot\psi(1).$$
+2. $a\in R$ invertierbar $\iff\psi(a)\in R'$ invertierbar.
+ `\begin{align*}a\in R\text{ invertierbar}&\iff\exists b\in R: ab=1\\&\iff\psi(ab)=\psi(1)\\&\iff\psi(a)\odot\psi(b)=\psi(1)\\&\iff\psi(a)\text{ invertierbar}\end{align*}`{=tex}
+:::
+
+## Berechnung der Eulerschen $\varphi$-Funktion
+
+Über chinesischen Restsatz.
+
+$M=m_1\cdot...\cdot m_n,\quad m_i\in\N$ paarweise teilerfremd.
+
+$\implies \varphi(M)=\varphi(m_1)\cdot...\cdot\varphi(m_n)$
+
+Insbesondere durch Primfaktorzerlegung:
+$M=p_1^{a_1}\cdot...\cdot p_k^{a_k}$
+
+$\implies\varphi(M)=(p_1-1)p_1^{a_1-1}\cdot...\cdot(p_k-1)p_k^{a_k-1}$
+
+::: proof
+```{=tex}
+\begin{proof}
+Es gilt $Z_M\cong Z_{m_1}\times...\times Z_{m_n}$ mittels $\psi$ aus voriger Bemerkung. Dann gilt
+\begin{align*}
+ x\in\Z_M\text{ invertierbar}&\iff\psi(x)=(x\bmod{m_1},...,x\bmod{m_n})\text{ invertierbar}\\
+ &\iff x\bmod{m_i}\text{ invertierbar},\quad\forall i\in\{1,...,n\}
+\end{align*}
+$\implies\varphi(M)=\varphi(m_1)\cdot...\cdot\varphi(m_n)$
+
+Angenommen $M=p_1^{a_1}\cdot...\cdot p_k^{a_k}$ ist Primfaktorzerlegung. Es genügt zu zeigen, dass mit $p\in\P$ gilt $\varphi(p^a)=(p-1)p^{a-1}=p^a-p^{a-1}$. $\Z_{p^a}$ enthält $p^a$ Elemente. Dabei sind die Elemente $kp$ für $0\le k\le p^{a-1}-1$ nicht teilerfremd zu $p^a$. Davon gibt es $p^{a-1}$ Stück.
+\end{proof}
+```
+:::
+
+::: bsp
+$\varphi(100)=\varphi(4\cdot5^2)=\varphi(4)\cdot\varphi(5^2)=2\cdot(5-1)\cdot5^{2-1}=40$
+:::
+
+## Euklidischer Algorithmus in Polynomringen über einem Körper $K$
+
+### $\ggT$ und $\kgV$ in $K[x]$
+
+1. $f,g\in K[x],\ f\ne0,\ f\mid g \iff \exists q\in K[x]: g=qf\\\text{Gradformel}\implies\grad(f)\le\grad(g),\ \text{falls }g\ne 0$
+2. $f=\sum_{i=1}^na_ix^i\in K[x]$ heißt *normiert*, falls der
+ Leitkoeffizient $a_n=1$.
+3. $g,h\in K[x]$, beide $=0$, $f=\ggT(g,h)$ falls $f$ *normiertes*
+ Polynom von maximalem Grad, das $g$ und $h$ teilt.
+4. $g,h\in K[x]\setminus\{0\}$, $f=\kgV(g,h)$, falls $f$ *normiertes*
+ Polynom von minimalem Grad, das von $g$ und $h$ geteilt wird.
+
+::: bem
+Sei $f=\sum_{i=1}^na_ix^i$, $a_n\ne0$. Dann ist $a_n^{-1}\cdot f$
+normiert, z.B. $f=3x^2+x+7$
+
+- $f\in\R[x]: \frac{1}{3}f=x^2+\frac{x}{3}+\frac{7}{3}$
+- $f\in\Z_{11}[x]: 4f=x^2+4x+6$
+:::
+
+In $K[x]$ kann der $\ggT$ zweier Polynome mit einer Rekursionsvorschrift
+analog zu $\ggT$ in $\Z$ berechnet werden. Man verwendet dazu
+Polynomdivision mit Rest (siehe Mathe 2).
+
+### Satz von Bézout
+
+Analog zum Satz von Méziriac gilt: $g,h\in K[x]$, nicht beide $=0$
+$\implies\exists s,t\in K[x]$: $\ggT(g,h)=sg+th$.
+
+### EEA in K\[x\]
+
+Wie in $(\Z,+,\cdot)$ kann auch für $(K[x],+,\cdot)$ der EEA formuliert
+werden, um $s,t$ im Satz des Bézout zu berechnen. Damit kann jener Satz
+auch für $K[x]$ bewiesen werden.
+
+::: bsp
+Seien $g=x^4+x^3+2x^2+1$ und $k=x^3+2x^2+2$ in $\Z_3[x]$
+
+ $x$ $y$ $s_1$ $s_2$ $s$ $t_1$ $t_2$ $t$ $q$ $r$
+ --------- --------- ------- ------- -------- ------- -------- -------- ------- ---------
+ g h 1 0 / 0 1 / / /
+ h $x^2+x$ 0 1 1 1 $2x+2$ $2x+1$ $x+2$ $x^2+x$
+ $x^2+x$ $2x+2$ / / $2x+2$ / / $x^2$ $x+1$ $2x+2$
+
+Normieren: $\ggT(g,h)=2^{-1}(2x+2)=x+1$
+
+$$s=2^{-1}(2x+2)=x+1$$ $$t=2^{-1}(x^2)=2x^2$$
+:::
+
+::: bem
+Sowohl in $\Z$ als auch in $K[x]$ müssen eigentlich Existenz und
+Eindeutigkeit der $\ggT$ und $\kgV$ gezeigt werden. Beweise trivial
+offensichtlich. $\wtf$
+:::
+
+## Primelemente in $K[x]$
+
+```{=tex}
+\begin{center}\textit{Primelemente sind irreduzible Polynome.}\end{center}
+```
+$p\in K[x]$ mit $\grad\ge1$ irreduzibel $\iff f,g\in K[x]$ mit
+$p=f\cdot g\implies \grad(f)=0\lor\grad(g)=0$
+
+::: bsp
+1. $ax+b,\ a\ne0$ irreduzibel in $K[x]$
+2. $x^2-2\in\Q[x]$ irreduzibel, aber in $\R[x]$ reduzibel
+3. $x^2+1\in\R[x]$ irreduzibel, aber in $\Z_5[x]$ reduzibel
+:::
+
+### Lemma von Euklid in $K[x]$
+
+$f\in K[x]$, $\grad(f)\ge1$. Dann sind folgende Aussagen äquivalent:
+
+1. $f$ irreduzibel
+2. $g,h\in K[x]$, $f\mid g\cdot h\implies f\mid g\lor f\mid h$
+
+::: proof
+```{=tex}
+\begin{proof}
+~\\
+\begin{itemize}
+\item (1) $\implies$ (2): Analog zu Lemma von Euklid in $\Z$.
+\item (2) $\implies$ (1): Angenommen es existiert Polynom $g$ mit $g\mid f$.\\$\implies\exists g,h\in K[x]: f=gh$. Wir zeigen: $\grad(h)=0$ (d.h. $f$ irreduzibel). $f=gh\implies f\mid g\lor f\mid h$. O.B.d.A. $f\mid g$. $\grad(f)\le\grad(g)\le\grad(g)+\grad(h)=\grad(g\cdot h)=\grad(f)\\\implies\grad(h)=0,\ \grad(f)=\grad(g)$
+\end{itemize}
+\end{proof}
+```
+:::
+
+::: bem
+Für $\Z$ gilt (2) $\implies$ (1) ebenfalls. Anstatt der Gradformel im
+vorigen Beweis schreibt man für
+$f,g,h\in\Z,\ f\ge2: 2\le f\le|g|\le gh=f\implies f=|g|\land|h|=1\implies f\in\P$.
+:::
+
+## Primfaktorzerlegung in $K[x]$
+
+Sei $f\in K[x]$ mit Leitkoeffizient $a_n\ne0,n\ge1$. Dann: Es gibt
+eindeutige irreduzible Polynome $p_1,...,p_e\in K[x]$ und
+$m_1,...,m_l\in\N$ mit $f=a_np_1^{m_1}\cdot...\cdot p_e^{m_e}$.
+
+## Korollar
+
+$f\in K[x]$, $\grad(f)=n\ge1$. Dann:
+
+1. $f$ hat max. $n$ Nullstellen $a_1,...,a_k\in K$.
+2. $f=(x-a_1)\cdot...\cdot(x-a_k)\cdot \bar{f}$ mit
+ $\grad(\bar{f})=\grad(f-k)$.
+
+::: proof
+```{=tex}
+\begin{proof}
+~\\
+\begin{itemize}
+\item $n=1$: $f=ax+b$ hat Nullstelle $-a^{-1}b$.
+\item $n>1$: Hat $f$ keine Nullstelle $\implies$ fertig.
+
+Sonst: Sei $a\in K$ Nullstelle $\implies f=(x-a)\cdot g,\ \grad(g)=n-1$.
+
+Sei $b\in K$ weitere Nullstelle, $b\ne a$: $\implies (x-b)\mid(x-a)\cdot g\implies (x-b)\mid g$, da $(x-b)$ irreduzibel.
+
+$\implies b$ Nullstelle von $g$. Per Induktion hat $g$ maximal $n-1$ Nullstellen.
+\end{itemize}
+\end{proof}
+```
+:::
+
+::: bem
+$(\Z_n,\oplus,\odot)$ Körper $\iff n\in\P$. Analog in $K[x]$: Sei
+$f\in K[x],\ \grad(f)=n$. Dann ist $(K[x]_n,+,\odot_f)$ mit
+
+- $K[x]_n=\{g\in K[x]\mid\grad(g)<n\}$
+- $g\odot_f h := g\cdot h\pmod{f}$
+
+ein kommutativer Ring mit Eins.
+
+Invertierbare Elemente bezüglich $\odot_f$:
+$K[x]_n^*:=\{g\in K[x]_n\mid\ggT(g,f)=1\}$ (Beweis wie für $\Z_n^*$). Es
+folgt $\exists s,t\in K[x]: sg+tf=1\implies s\cdot g\equiv1\pmod{f}$ und
+$g^{-1}\equiv s\pmod{f}$. Damit erhält man $(K[x]_n,+,\odot_f)$ Körper
+$\iff f$ irreduzibel.
+
+Für $K=\Z_p$ lässt sich zeigen:
+
+1. $\Z_p[x]_n$ Körper der Ordnung $p^n\iff f$ irreduzibel, $p\in\P$
+2. Jeder endliche Körper hat Primzahlpotenzordnung und ist durch seine
+ Ordnung bis auf Isomorphie eindeutig festgelegt.
+:::
+
+## Anwendungsbeispiel aus der Kryptologie
+
+Die ältesten Verfahren zur Verschlüsselung von Nachrichten sind
+symmetrisch, d.h. Sender und Empfänger verwenden denselben Schlüssel zur
+Ver- und Entschlüsselung einer Nachricht (z.B. Cäsar-Chiffre, ENIGMA,
+...). Problem: Sender und Empfänger müssen Schlüssel auf sicherem Weg
+austauschen.
+
+Zur Lösung des Problems wurden asymmetrische Verfahren entwickelt, bei
+denen kein Schlüssel getauscht werden muss (z.B. public-key-Verfahren,
+Diffie-Hellman, ...):
+
+- Bob will Nachricht empfangen. Er erzeugt 2 Schlüssel:
+ - public key, wird veröffentlicht
+ - private key, geheim
+- Alice verschlüsselt Nachricht an Bob mit public key
+- Bob entschlüsselt mit private key
+
+Eine der wichtigsten Realisationen: RSA-Verfahren. Verwende dazu
+Einwegfunktionen, d.h. Funktionen, die praktisch unmöglich umzukehren
+sind. Kanditaten dafür sind Potenzfunktionen in $\Z_n$, wobei
+$n=pq,\ p,q\in\P$: $x^e\pmod{n}$.
+
+- Es ist praktisch unmöglich, $n$ zu faktorisieren, wenn $n$ sehr
+ groß: Angenommen $n$ ist 2000-Bit-Zahl und angenommen pro Sekunde
+ kann man bei $10^9$ Zahlen testen, ob sie teilerfremd zu $n$ sind.
+ Dazu bräuchte man
+ $$\frac{2^{1000}}{10^9}s=\frac{(2^{10})^{100}s}{(10^3)^3}\approx10^{291}s\approx3\cdot10^{285}\text{ Jahre}.$$
+ Faktorisierung von $n\approx2^{1000}$ mit schnellsten Rechnern der
+ Welt derzeit mehr als $10^{100}$ Jahre.
+- Wurzelziehen in $\Z_n$ schwierig. Z.B. $x^3\pmod{7}=6\implies x=3$.
+- Man kann zeigen: Wählt man $e$ teilerfremd zu
+ $\varphi(n)=(p-1)(q-1)$, so ist $x^e\pmod{n}$ bijektiv.
+- Es gibt eine geheime Zahl $d$, mit der die Operation umgekehrt
+ werden kann. Eine solche Einwegfaktorisierung heißt
+ Trapdoorfunktion.
+
+## RSA-Verfahren
+
+Bob (Schlüsselerzeugung)
+
+1. wählt zwei große $p,q\in\P: p\ne q$ und bildet $n=pq$
+2. berechnet $\varphi(n)=(p-1)(q-1)$
+3. wählt $e$ teilerfremd zu $\varphi(n)$
+4. bestimmt $0<d<\varphi(n)$ mit $e\cdot d\pmod{\varphi(n)}=1$.
+ Verwendet dazu EEA: $ed\pmod{\varphi(n)}$
+5. Public key: $(e,n)$. Private key: d
+
+Alice (Verschlüsselung)
+
+1. kodiert Nachricht als Zahl und zerlegt sie anschließend in Blöcke
+ gleicher Länge, sodass jeder Block $m_i$ als Zahl $0\le m_i<n$ ist.
+ Blöcke werden einzeln verschlüsselt. Sei $m$ ein solcher Block.
+2. berechnet $c=m^e\pmod{n}$
+3. sendet $c$ an Bob.
+
+Bob (Entschlüsselung)
+
+1. berechnet $c^d\pmod{n}=m$ für alle Blöcke
+
+### Korrektheit des Verfahrens:
+
+::: proof
+`\toprove`{=tex}$c^d\pmod{n}=m$. Daraus folgt insbesondere, dass die
+Faktorisierung $m^e\pmod{n}$ bijektiv ist und Nachrichten korrekt
+entschlüsselt werden können.
+$$c^d\equiv (m^e)^d\equiv m^{ed}\equiv m^{k\varphi(n)+1}\equiv m(m^{\varphi(n)})^k\pmod{n}$$
+
+```{=tex}
+\begin{proof}
+Durch Fallunterscheidung:
+\begin{num}
+ \item Fall: $m=0\iff c=0$, d.h. 0 wird durch 0 verschlüsselt.
+ \item Fall: $\ggT(m,n)=1\implies m^{\varphi(n)}\equiv1\pmod{n}\implies c^d\equiv m\pmod{n}$
+ \item Fall $p\mid m$ und $m\ne0\implies m=ap,\ a\in\{1,...,q-1\}\implies \ggT(q,m^j)=1\forall j\in\N$, insbesondere für $j=\varphi(n)\implies m\pmod{p}=0\land m^{\varphi(n)\pmod{q}}=1$. Chinesischer Restsatz: $m_1=p,M_1=q,m_2=q,M_2=p$. EEA: $\exists s,t\in\Z:sp+tq=1\implies c^d\equiv tqm+spm\equiv(tq+sp)m\pmod{n}$
+ \item Fall: $q\mid m$ und $m\ne0$ analog zu Fall 3.
+\end{num}
+\end{proof}
+```
+:::
+
+::: bsp
+Gegeben $(n,e)=(33,3)$ public key
+
+1. Verschlüsseln Sie die Nachricht $m=6$.`\newline`{=tex}
+ $c=m^e\pmod{n}=6^3\pmod{33}=3\cdot 6=18$
+2. Faktorisieren Sie $n=33$, berechnen Sie $\varphi(n)$ und
+ $d$.`\newline`{=tex} $\varphi(n)=2\cdot10=20$, $ed\pmod{20=1}$. Man
+ erkennt $d=7$.
+3. Entschlüsseln Sie die Nachricht $c=2$:
+ $m=c^d\pmod{n}=2^7\pmod{33}=2^5\cdot2^2\pmod{33}=-4\pmod{33}=29$.
+:::
+
+# Funktionen und Stetigkeit im $\R^n$
+
+## Wiederholung
+
+- Standardskalarprodukt auf $\R^n$:
+ $$x=\begin{pmatrix}x_1\\\vdots\\x_n\end{pmatrix},\ y=\begin{pmatrix}y_1\\\vdots\\y_n\end{pmatrix}$$
+ $$
+ \implies(x|y)=x_1y_1+...+x_ny_n$$
+- Winkelberechnung: $\cos(\alpha)=\frac{(x|y)}{\|x\|\cdot\|y\|}$
+- Längenberechnung: $\|x\|=\sqrt{(x|x)}=\sqrt{x_1^2+...+x_n^2}$
+- Abstand: $d(x,y)=\|x-y\|$
+- Norm: $\|\cdot\|:\R^n\to\R$
+
+## Konvergenz von Folgen
+
+Sei $(x_k)_{k\in\N}$ eine Folge im $\R^n$. $(x_k)_{k\in\N}$ konvergiert
+gegen $a\in\R^n$ ($x_k\to a$ oder $\lim_{k\to\infty}x_k=a$) wenn gilt
+$$\forall\varepsilon>0\ \exists N\in\N\ \forall k\ge N:\|x_k-a\|<\varepsilon.$$
+
+::: bem
+`\begin{align*}&x_k=\begin{pmatrix}x_1^{(k)}\\\vdots\\x_n^{(k)}\end{pmatrix}\to a \begin{pmatrix}a_1\\\vdots\\a_n\end{pmatrix}\\\iff&x_i^{(k)}\to a_i\quad\forall i\in\{1,...,n\}\end{align*}`{=tex}
+Die Rechenregeln für Folgen in $\R$ gelten analog im $\R^n$.
+:::
+
+::: bsp
+- $\begin{pmatrix}x_k\\y_k\end{pmatrix}=\frac{1}{\sqrt{k+1}}\begin{pmatrix}\cos(\frac{k\pi}{4})\\\sin(\frac{k\pi}{4})\end{pmatrix}\\\left\|\begin{pmatrix}x_k\\y_k\end{pmatrix}\right\|=\frac{1}{\sqrt{k+1}}\to0$
+:::
+
+## Offene, abgeschlossene, kompakte Mengen
+
+- Sei $x_0\in\R^n,\ \varepsilon>0$.
+ $K_\varepsilon(x_0)=\{x\in\R^n\mid\|x-x_0\|<\varepsilon\}$ heißt
+ offene $\varepsilon$-Kugel um $x_0$
+- $U\subseteq\R^n$ offen
+ $:\iff\forall x\in U\exists\varepsilon>0:K_\varepsilon(x)\subseteq U$
+- $U$ heißt Umgebung von $x\in D\subseteq\R^n:\iff U$ offen und
+ $x\in U$ und $U\subseteq D$
+- $A\subseteq\R^n$ abgeschlossen $:\iff A^C=\R^n\setminus A$ offen
+
+## Rand
+
+$x\in\R^n$ Randpunkt von
+$D\subseteq\R^n:\iff K_\varepsilon(x)\cap D\ne\emptyset$ und
+$K_\varepsilon(x)\cap D^C\ne\emptyset\quad\forall\varepsilon>0$.
+
+$\partial D$ ist die Menge aller Randpunkte von $D$.
+
+::: bsp
+- $K_1\left(\begin{pmatrix}0\\2\end{pmatrix}\right)\subseteq\R^2$
+ offen
+- Allgemein: $K_\varepsilon(x_0)\subseteq\R^n$ offen
+- $U=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid x+y>1\right\}$
+ offen
+:::
+
+## Charakterisiserung abgeschlossener Mengen
+
+Sei $(x_k)$ Folge in $A\subseteq\R^n$ mit Grenzwert $a\in\R^n$.
+
+$A$ abgeschlossen $\iff a\in A$.
+
+::: proof
+```{=tex}
+\begin{proof}
+In beide Richtungen:
+\begin{itemize}
+\item \enquote{$\implies$}\quad Sei $A$ abgeschlossen und
+ $x_k\to a\in\R^n$. Angenommen $a\notin A$:
+ \begin{align*}&\implies a\in A^C\\&\implies\exists\varepsilon>0:K_\varepsilon(a)\subseteq A^C\\&\implies\exists N\in\N\forall k\ge N:\|x_k-a\|<\varepsilon\\&\implies x_k\in K_\varepsilon(a)\quad\forall k\ge N\quad\lightning\end{align*}
+\item \enquote{$\impliedby$}\quad Durch Kontraposition: $A\subseteq\R^n$ nicht abgeschlossen $\implies$ Es gibt Folge $(x_k)$ in $A$ mit Grenzwert $a\in A^C$. $A$ nicht abgeschlossen $\implies A^C$ nicht offen.
+ \begin{align*}&\implies\exists a\in A^C:K_\varepsilon(a)\not\subseteq A^C\quad\forall\varepsilon>0\\&\implies K_\varepsilon(a)\cap A\ne\emptyset\quad\forall\varepsilon>0\end{align*} Wähle $x_k\in K_{1/k}(a)\cap A,\quad k\in\N$ \begin{align*}&\implies\|x_k-a\|<\frac{1}{k}\\&\implies x_k\to a\text{ für $k\to\infty$ und $x_k\in A$}\end{align*}
+\end{itemize}
+\end{proof}
+```
+:::
+
+::: bsp
+$M=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid0\le x<1\right\}$
+weder offen noch abgeschlossen:
+
+- nicht offen, da z.B.
+ $K_\varepsilon(0)\cap M^C\ne\emptyset\quad\forall\varepsilon>0$
+- nicht abgeschlossen, da z.B.
+ $x_k=\begin{pmatrix}1-1/k\\0\end{pmatrix}\in M$, aber
+ $x_k\to\begin{pmatrix}1\\0\end{pmatrix}\notin M$
+:::
+
+## Vereinigung und Schnitt offener Mengen
+
+Sei $\{U_i\}_{i\in\N}$ ein System offener Mengen. Dann:
+
+- $\bigcup_{i=1}^\infty U_i$ offen
+- $U_1\cap U_2$ offen
+
+::: proof
+```{=tex}
+\begin{proof}
+~\\
+\begin{abc}
+ \item Sei $x\in\bigcup_{i=1}^\infty U_i$
+ \begin{align*}&\implies\exists i\in\N:x\in U_i\\&\implies\exists\varepsilon>0:K_\varepsilon(x)\subseteq U_i\text{, da $U_i$ offen}\\&\implies K_\varepsilon(x)\subseteq\bigcup_{i=1}^\infty U_i\\&\implies\bigcup_{i=1}^\infty U_i\text{ offen}\end{align*}
+ \item $x\in U_1\cap U_2$
+ \begin{align*}&\implies\exists\varepsilon_1,\varepsilon_2>0:K_{\varepsilon_1}(x)\subseteq U_1,\ K_{\varepsilon_2}(x)\subseteq U_2\\&\varepsilon:=\min\{\varepsilon_1,\varepsilon_2\}\\&\implies K_\varepsilon(x)\subseteq K_{\varepsilon_1}(x)\subseteq U_1\land K_\varepsilon(x)\subseteq K_{\varepsilon_2}(x)\subseteq U_2\\&\implies K_\varepsilon(x)\subseteq U_1\cap U_2\end{align*}
+\end{abc}
+\end{proof}
+```
+:::
+
+## Folgerung
+
+Sei $\{A_i\}_{i=1}^\infty$ ein System abgeschlossener Mengen. Dann:
+
+- $\bigcap_{i=1}^\infty A_i$ abgeschlossen
+- $A_1\cup A_2$ abgeschlossen
+
+::: proof
+```{=tex}
+\begin{proof}
+~\\
+\begin{itemize}
+ \item $(\bigcap_{i=1}^\infty A_i)^C=\bigcup_{i=1}^\infty A_i^C$ offen
+ \item $(A_1\cup A_2)^C=A_1^C\cap A_2^C$ offen
+\end{itemize}
+\end{proof}
+```
+:::
+
+## Abschluss, Inneres
+
+Sei $D\subseteq\R^n$.
+
+- $\bar{D}=D\cup\partial D$ ist abgeschlossen und heißt Abschluss von
+ $D$.
+- $\mathring{D}:=D\setminus\partial D$ ist offen und heißt Inneres von
+ $D$.
+- $\partial D$ ist abgeschlossen
+
+::: proof
+```{=tex}
+\begin{proof}
+~\\
+\begin{itemize}
+ \item Sei $(x_k)$ Folge in $\bar{D}$ mit Grenzwert $a\in\R^n$.\\Annahme: $a\notin\bar{D}$, d.h. insbesondere $a\notin\partial D$\\$\implies\exists\varepsilon>0:K_\varepsilon(a)\cap D=\emptyset$ und $K_\varepsilon(a)\cap\partial D=\emptyset$.\\Widerspruch, da $\exists N\in\N\forall n\ge N: x_n\in K\varepsilon(a)$.
+ \item \begin{rom}
+ \item Es ist $\partial D=\partial(D^C)$: $x\in\partial(D^C)\\\iff K_\varepsilon(x)\cap D^C\ne\emptyset$ und $K_\varepsilon\cap(D^C)^C\ne\emptyset\quad\forall\varepsilon>0\\\iff x\in\partial D$
+ \item $(D^C\cup\partial D)^C=D\cap(\partial D)^C=D\setminus\partial D\implies\mathring{D}$ offen
+ \end{rom}
+\end{itemize}
+\end{proof}
+```
+:::
+
+::: bsp
+- $\bar{K_\varepsilon}(x_0)=\{x\in\R^n\mid\|x\|\le\varepsilon\}$
+ abgeschlossene $\varepsilon$-Kugel um $x_0\in\R^n$
+- `\begin{align*}M&=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid0\le x<1\right\}\\\partial M&=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid x=0\lor x=1\right\}\\\bar{M}&=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid0\le x\le1\right\}\\\mathring{M}&=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid0<x<1\right\}\end{align*}`{=tex}
+:::
+
+## Beschränkte/kompakte Mengen
+
+- $D\subseteq\R^n$ beschränkt
+ $:\iff\exists K>0:\|x\|<K\quad\forall x\in D$
+- $D\subseteq\R^n$ kompakt $:\iff$ Jede Folge in $D$ besitzt eine in
+ $D$ konvergente Teilfolge.
+
+## Charakterisierung kompakter Mengen
+
+$D\subseteq\R^n$ kompakt $\iff D$ beschränkt und abgeschlossen.
+
+::: proof
+```{=tex}
+\begin{proof}
+TODO.
+\end{proof}
+```
+:::
+
+::: bsp
+- $\bar{K}_\varepsilon(x_0)$ kompakt, da beschränkt und abgeschlossen
+- $A=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid y=x^2,\ y\le1\right\}$
+ abgeschlossen und beschränkt, also kompakt
+:::
+
+## Mehrdimensionale reele Funktionen und Stetigkeit
+
+- Eine reele Funktion von mehreren Veränderlichen ist eine Abbildung
+ `\begin{align*}f:D\subseteq\R^n&\to\R^m\\x=\begin{pmatrix}x_1\\\vdots\\x_n\end{pmatrix}&\to f(x)=\begin{pmatrix}f_1(x)\\\vdots\\f_m(x)\end{pmatrix}\end{align*}`{=tex}
+- Man unterscheidet folgende Fälle:
+ `\begin{alignat*}{2}m=1:\quad&f:D\subseteq\R^n\to\R\quad&&\text{(skalare Funktion)}\\m>1:\quad&f:D\subseteq\R^n\to\R^m\quad&&\text{(vektorwertige Funktion)}\\n=1:\quad&f:D\subseteq\R\to\R^m\quad&&\text{(parameterisierte Kurve)}\end{alignat*}`{=tex}
+
+::: bsp
+- Skalare Funktionen mit $D\subseteq\R^2$ lassen sich grafisch
+ darstellen:
+ - $\mathrm{Graph}(f):=\left\{\begin{pmatrix}x\\y\\z\end{pmatrix}\in\R^3\mid\begin{pmatrix}x\\y\\z\end{pmatrix}\in D,\ z=f(x,y)\right\}$
+ ist eine Fläche im $\R^3\\$ Beispiel: $f(x,y)=5-2xy+x^3+y^2\\$
+ `\begin{tikzpicture}\begin{axis}[xlabel={$y$},ylabel={$x$},zlabel={$z$}]\addplot3[surf, mesh, samples=30]{5-2*x*y+x^3+y^2};\end{axis}\end{tikzpicture}`{=tex}
+ - Höhen-/Niveaulinien:
+ $N_C(f):=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid f(x,y)=c\right\},\quad c\in\R.\\$
+ Beispiel: $f:\R^2\to\R,\ f(x,y)=x^2+y^2\\$
+ `\begin{tikzpicture}\begin{axis}[xlabel={$y$},ylabel={$x$},zlabel={$z$}]\addplot3[surf, mesh, samples=30]{x^2+y^2};\end{axis}\end{tikzpicture}\\`{=tex}
+ `TODO%\begin{tikzpicture}\begin{axis}[view={0}{90},enlarge x limits,xlabel={$y$},ylabel={$x$},zlabel={$z$}]\addplot3[domain=-3:3,domain y=-3:3,contour gnuplot={levels={-1,1}},samples=30]{x^2+y^2};\end{axis}\end{tikzpicture}\\`{=tex}
+- Parameterisierte Kurve
+ - $f:\R\to\R^2,\ x\to\begin{pmatrix}\cos(x)\\\sin(x)\end{pmatrix}$
+ Einheitskreis
+ - Venusbahn geozentrisch: TODO: Graphen.
+ `\begin{align*}D(t)&=V(t)-E(t)\\E(t)&\approx a_E(\cos(8\cdot2\pi t),\ \sin(8\cdot2\pi 2))\\V(t)&\approx a_V(\cos(13\cdot2\pi t),\ \sin(13\cdot2\pi t))\end{align*}`{=tex}
+ Innerhalb einer Zeiteinheit ($0\let\le1$) dreht sich die Erde
+ $8\times\phantom{{}}$ um die Sonne $\implies$ Umlaufzeit Erde:
+ $T_E=\frac{1}{8}\implies$ Umlaufzeit Venus $T_V=\frac{1}{13}$.
+ Aus dem 3. Keplerschen Gesetz folgt:
+ $$T_E^2\sim a_E^3\iff a_E\sim\sqrt[3]{T_E^2}=\sqrt[3]{\frac{1}{64}}=\frac{1}{4}$$
+ und $$a_V\sim\sqrt[3]{\left(\frac{1}{13}\right)^2}.$$ Mit
+ $a_E=\frac{1}{4}$ und
+ $a_V=\sqrt[3]{\left(\frac{1}{13}\right)^2}$ erhält man für
+ $D(t),\ 0\le t\le1$ eine Epitrochoide. TODO: Graphen
+:::
+
+## Stetigkeit
+
+Sei $f:D\subset\R^n\to\R^m$.
+
+- $c\in\R^m$ heißt Grenzwert von $f$ in $a\in\R^n$, falls für jede
+ Folge $(x_k)$ mit $x_k\to a,\ x_k\ne a\quad\forall k\in\N$ gilt:
+ $f(x_k)\to c$. Schreibweise: $\lim_{x\to a}f(x)=c$
+- $f$ stetig in $a\in D :\iff \lim_{x\to a}f(x)=f(a)$
+- $f$ stetig auf $D :\iff f$ stetig in $a\quad\forall a\in D$
+
+::: bem
+- $f:D\subset\R^n\to\R^m$ stetig in
+ $a\in D\iff f_i:D\to\R\text{ stetig}\quad\forall i\in\{1,...,m\}$
+- Summen, Produkte, Quotienten, Kompositionen stetiger Funktionen sind
+ stetig. Rechenregeln für Grenzwerte gelten analog.
+:::
+
+::: bem
+- Stetigkeit wurde anhand des Folgenkriteriums definiert. Analog dazu
+ lässt sich dieses auch anhand des $\varepsilon-\delta$-Kriteriums
+ formulieren:
+ `\begin{align*}f:D\subset\R^n\to\R^m\text{ stetig}&\iff\forall\varepsilon>0\exists\delta>0\forall x\in D:\|x-a\|<\varepsilon\\&\implies\|f(x)-f(a)\|<\varepsilon\end{align*}`{=tex}
+- Anders formuliert:
+ $$\forall\varepsilon>0\exists\delta>0:f(K_\delta(a))\subseteq K_\varepsilon(f(a))$$
+:::
+
+::: bsp
+- $f:\R^n\to\R,\ f(x_1,...,x_n)=x_i$ stetig in $a\in\R^n$:
+ - Es sei $(a_k)_{k\in\N}$ Folge in $\R^n$ mit
+ `\begin{align*}&a_k=\begin{pmatrix}a_1^{(k)}\\\vdots\\a_n^{(k)}\end{pmatrix}\to a=\begin{pmatrix}a_1\\\vdots\\a_n\end{pmatrix}\\\implies&\lim_{k\to\infty}f(a_k)=\lim_{k\to\infty}a_i^{(k)}=a_i\end{align*}`{=tex}
+ - $f(a)=a_i\implies f(a_k)\to f(a)$
+- Es folgt, dass alle Polynome stetig sind
+- Folgende Funktion ist stetig in
+ $\R^2\setminus\left\{\begin{pmatrix}0\\0\end{pmatrix}\right\}$
+ (TODO: Graph)
+ $$f(x,y)=\begin{cases}0&(x,y)=(0,0)\\\frac{3x^2}{x^2+y^2}&\text{ sonst}\end{cases}$$
+ - Sei
+ $a_k:=\begin{pmatrix}1/k\\1/k\end{pmatrix}\in\R^2\setminus\left\{\begin{pmatrix}0\\0\end{pmatrix}\right\}$.
+ Es gilt
+ `\begin{align*}&a_k\to0\\\implies&f(a_k)=\frac{3(1/k)^2}{(1/k)^2+(1/k)^2}=\frac{3}{2}\\\implies&f(a_k)\to\frac{3}{2}\end{align*}`{=tex}
+ - $f(0,0)=0\implies f(a_k)\not\to f(0,0)$ und $f$ unstetig in
+ $\begin{pmatrix}0\\0\end{pmatrix}$
+- Folgende Gleichung muss nicht notwendigerweise erfüllt sein
+ (vorausgesetzt, die entsprechenden Grenzwerte existieren):
+ $$\lim_{x\to a}(\lim_{y\to b}f(x,y))=\lim_{y\to b}(\lim_{x\to a}f(x,y))$$
+:::
+
+Falls einer der Grenzwerte existiert oder sogar die Gleichung erfüllt
+ist, so folgt danach keineswegs, dass $\lim_{(x,y)\to(a,b)}f(x,y)$
+existiert.
+
+::: bsp
+`\begin{align*}f:\ &\R^2\setminus\left\{\begin{pmatrix}0\\0\end{pmatrix}\right\}\to\R\\&f(x,y)=\frac{xy^2}{x^2+y^2}\end{align*}`{=tex}
+
+Da $\lim_{x\to0}f(x,y)=0$ und $\lim_{y\to0}(\lim_{x\to0}f(x,y))=0$.
+
+Analog $\lim_{x\to0}(\lim_{y\to0}f(x,y))=0$.
+
+Aber: $\lim_{(x,y)\to(0,0)}f(x,y)$ existiert nicht, denn
+$$f\left(\frac{1}{k},\frac{1}{k}\right)=\frac{k^2}{1/k^2+1/k^2}=\frac{k}{k^2+1}\to0$$
+$$f\left(\frac{1}{k^2},\frac{1}{k}\right)=\frac{1/k^2}{2/k^2}\to\frac{1}{2}$$
+Insbesondere lässt sich $f$ im Nullpunkt nicht stetig fortsetzen.
+:::
+
+## Stetigkeit und Offenheit
+
+Sei $f:D\subseteq\R^n\to\R^n,\ V\subseteq f(0)$, $V$ offen. Dann:
+$$f\text{ stetig}\iff f^{-1}(V)\text{ offen}$$
+
+::: proof
+```{=tex}
+\begin{proof}
+In beide Richtungen:
+\begin{itemize}
+\item \enquote{$\implies$}:\quad Sei \begin{align*}y\in V&\implies\exists x\in D: f(x)=y\\&\implies\exists\varepsilon>0:K_\varepsilon(y)\subseteq V\\&\implies\exists\delta>0:f(K_\varepsilon(x))\subseteq K_\varepsilon(y)\\&\implies K_\varepsilon(x)\subseteq f^{-1}(K_\varepsilon(y))\subseteq f^{-1}(V)\end{align*}
+\item \enquote{$\impliedby$}:\quad Trivial
+\end{itemize}
+\end{proof}
+```
+:::
+
+## Stetigkeit und Kompaktheit
+
+$f:D\subseteq\R^n\to\R^m$ stetig, $A\subseteq D$ kompakt $\implies f(A)$
+kompakt.
+
+::: proof
+```{=tex}
+\begin{proof}
+Sei $(y_k)$ Folge in $f(A)$. \toprove: $(y_k)$ hat eine in $f(A)$ konvergente Teilfolge.
+
+Sei $(x_k)$ Folge in $A$ mit $f(x_k)=y_k\quad\forall k\in\N$.
+
+$\implies\exists(x_{k_j})\subseteq A$ mit Grenzwert $a\in A$.
+
+$\implies f(x_{k_j})=y_{k_j}$ Teilfolge von $(y_k)$ in $f(A)$ mit Grenzwert $f(a)$
+\end{proof}
+```
+:::
+
+## Beschränktheit von Funktionen
+
+Sei $D=\emptyset$, $f:D\subseteq\R^n\to\R^m$ beschränkt $:\iff f(D)$
+beschränkt.
+
+## Minimax-Theorem von Weierstraß
+
+$f:D\subseteq\R^n\to\R$ stetig, $D$ kompakt.
+
+$\implies\exists x_\star,x^\star\in D: \underbrace{f(x_\star)}_\mathrm{min}\le f(x)\le f(x^\star)_\mathrm{max}\quad\forall x\in D$
+
+::: proof
+```{=tex}
+\begin{proof}
+\toprove $f(D)$ kompakt.
+\begin{itemize}
+\item $f(D)$ beschränkt $\implies\exists\mathrm{inf}f(D),\mathrm{sup}f(D)$
+\begin{align*}\implies\exists(a_k),(b_k)\subseteq f(D):\ &a_k\to\mathrm{inf}f(D)\\&b_k\to\mathrm{sup}f(D)\end{align*}
+\item $f(D)$ abgeschlossen
+\begin{align*}\implies&\mathrm{inf}f(D)=\max f(D)=f(x_*)\\&\mathrm{sup}f(D)=\max f(D)=f(x^*)\end{align*}
+\end{itemize}
+\end{proof}
+```
+:::
+
+::: bsp
+$f:\R^2\to\R$, $f(x,y)=xy$
+
+$S=\left\{\begin{pmatrix}x\\y\end{pmatrix}\in\R^2\mid x^2+y^2=1\right\}$
+
+$\implies f$ hat Maximum und Minimum auf $S$
+:::
+
+## Kontraktion
+
+Sei $A\subseteq\R^n$ abgeschlossen und sei $f:A\to\R^n$. \$fA heißt
+Kontraktion auf $A :\iff$
+
+- $f(A)\subseteq A$
+- $\|f(x)-f(y)\|\le q\|x-y\|,\ q\in[0,1)\quad\forall x,y\in A$
+
+$f$ ist eine stetige Abbildung.
+
+::: bsp
+- $f:\R\to\R,\ f(x)=\frac{1}{2}x\\|f(x)-f(y)|=\frac{1}{2}|x=y|$, d.h.
+ $q=\frac{1}{2}$
+- $f$ Kontraktion auf $A=[0,1]$:
+ $f([0,1])=[0,\frac{1}{2}]\subseteq[0,1]$
+- $f$ keine Kontraktion auf $A=[1,2]$, da
+ $f([1,2])=[\frac{1}{2},1]\not\subseteq[1,2]$
+:::
+
+## Banachscher Fixpunktsatz im $\R^n$
+
+Sei $A\subseteq\R^n$ abgeschlossen und $f:A\to A$ eine Kontraktion auf
+$A$. Dann:
+
+1. $\exists!\bar{x}\in A: A(\bar{x})=\bar{x}$. $\bar{x}$ heißt
+ Fixpunkt.
+2. Für $x_0\in A$ und $x_n:=f(x_{x_n-1}),\ n\in\N$, gilt:
+ $x_n\to\bar{x}$ und $\|x_n-\bar{x}\|\le\frac{qn}{1-q}\|x_1-x_0\|$
+
+::: proof
+```{=tex}
+\begin{proof}
+TODO. Siehe Skript
+\end{proof}
+```
+:::
+
+## Matrixnorm
+
+Sei $A\in\M_{m,n}(\R)$. Die reele Zahl
+$\|A\|=\max\{\|Av\|\mid v\in\R^n,\ \|v\|=1\}$ heißt Operatornorm von
+$A$.
+
+# Differenziation im $\R^n$
+
+## Partielle Ableitung
+
+Sei $D\subseteq\R^n$ offen, $f:D\to\R^m$, $f(x)=(f_1(x),...,f_m(x))$ und
+$a=(a_1,...,a_n)^\top\in D$.
+
+- $f$ heißt an der Stelle $a$ partiell nach $x_j$ differenzierbar,
+ falls für jede der Funktion $f_i: \R^n\to\R$ gilt: Die skalare
+ Funktion $f_i(a_1,...,a_{j-1},x_j,a_{j+1},...,a_n)$ einer
+ Veränderlichen ist an der Stelle $a_j$ differenzierbar, d.h.
+ `\begin{align*}&\lim_{k\to0}\frac{f_i(a_1,...,a_{j-1},a_j+h,a_{j+1},...,a_n)-f_i(a_1,...,a_n)}{h}\\=&\lim_{h\to0}\frac{f_i(a+h\cdot e_j)-f(a)}{h}\end{align*}`{=tex}
+ existiert für alle $1\le i\le m$.
+- Dieser Grenzwert heißt dann partielle Ableitung von $f_i$ nach $x_j$
+ an der Stelle $a$. Sschreibweise:
+ $\frac{\partial f_i}{\partial x_j}(a)$.
+- Sind alle $f_i$ nach allen $x_j$ partiell differenzierbar in $a$, so
+ heißt $f$ partiell differenzierbar und man definiert die
+ Jacobimatrix von $f$ in $a$ durch
+ $$f'(a):=\begin{pmatrix}\frac{\partial f_1}{\partial x_1}(a)&...&\frac{\partial f_1}{\partial x_n}(a)\\\frac{\partial f_m}{\partial x_1}(a)&...&\frac{\partial f_m}{\partial x_n}(a)\\\end{pmatrix}\in\M_{m,n}(\R)$$
+- Für skalare Funktionen besteht $f'(a)$ aus nur einer Zeile. Man
+ bezeichnet den Vektor
+ $$f'(a)^\top=\begin{pmatrix}\frac{\partial f}{\partial x_1}(a)\\\vdots\\\frac{\partial f}{\partial x_n}(a)\end{pmatrix}=:\nabla f(a)=\grad(f(a))\in\R^n$$
+ als Gradienten von $f$ in $a$.
+
+## Geometriche Deutung der partiellen Ableitung
+
+Sei $f:\R^2\to\R,\ a\in\R^2,\ a=\begin{pmatrix}a_1\\a_2\end{pmatrix}$.
+
+TODO: Graph
+
+::: bsp
+- $f:\R^2\to\R,\ f(x,y)=3xy+4y$
+ `\begin{align*}\frac{\partial f}{\partial x}(x,y)&=\lim_{h\to0}\frac{f(x+h,y)-f(x,y)}{h}\\&=\lim_{h\to0}\frac{3(x+h)y+4y-3xy-4y}{h}\\&=\lim_{h\to0}3y\end{align*}`{=tex}
+ D.h.: $y$ wird als Konstante behandelt und nach $x$ wird abgeleitet.
+- $f:\R^3\to\R,\ f(x,y,z)=y^2x+3x^2z^2$
+ `\begin{align*}\frac{\partial f}{\partial x}(x,y,z)&=y^2+6xz^2\\\frac{\partial f}{\partial y}(x,y,z)&=2xy\\\frac{\partial f}{\partial z}(x,y,z)&=6x^2z\end{align*}`{=tex}
+ `\begin{alignat*}{2}\implies&f'(x,y,z)&&=(y^2+6xz^2, 2xy,6x^2z)\\&f'(1,0,1)&&=(6,0,6)\\&\nabla f(x,y,z)&&=\begin{pmatrix}y^2+6xz^2\\2xy\\6x^2z\end{pmatrix}\end{alignat*}`{=tex}
+- $f:\R^3\to\R^2$,
+ $f(x,y,z)=\begin{pmatrix}x+y\\xyz\end{pmatrix}\implies f'(x,y,z)=\begin{pmatrix}1&1&0\\yz&xz&xy\end{pmatrix}$
+:::
+
+::: bem
+- Zeigen später: Der Gradient zeigt in Richtung des steilsten Anstiegs
+ einer Funktion in einem gegebenen Punkt. Er steht senkrecht auf den
+ Niveaulinien.
+- Existieren für $f$ in einem gegebenen Punkt alle partiellen
+ Ableitungen, so muss $f$ nicht automatisch stetig sein.
+:::
+
+## Totale Ableitung
+
+Sei $D\subseteq\R^n$ offen, $a\in D$, $f: D\to\R^m$.
+
+- $f$ heißt in $a\in D$ (total) differenzierbar, wenn $f$ geschrieben
+ werden kann als
+ $$f(x)=\underbrace{f(a)}_{\in\R^m}+\underbrace{A}_{\in\M_{m,n}(\R)}\cdot(\underbrace{x-a}_{\in\R^m})+\underbrace{R(x)}_{\in\R^m},$$
+ wobei $A\in\M_{m,n}(\R)$ und $R: D\to\R^m$ mit
+ $\lim_{x\to a}\frac{R(x)}{\|x-a\|}=0$
+- $f$ heißt (total) differenzierbar, wenn in jedem Punkt von $D$
+ differenzierbar.
+
+::: bem
+- Für $m=n=1$ erhält man die Differenzierbarkeit aus Mathe 1:
+ `\begin{align*}&f(x)=f(a)+A(x-a)+R(x)\\\implies&\frac{f(x)-f(a)}{x-a}=A+\frac{R(x)}{x-a}\to A\\\implies&f'(a)=A\end{align*}`{=tex}
+- $x\to a\iff x-a\to0$. Sei $v=x-a\in\R^n$. Dann kann vorige Gleichung
+ geschrieben werden als
+ $$f(a+v)=f(a)+Av+R(v)\quad\text{mit }\frac{R(v)}{\|v\|}\to0$$
+:::
+
+## Differenzierbarkeit $\implies$ Stetigkeit
+
+$f:D\subseteq\R^n\to\R^m$ differenzierbar in $a\in D$ (D offen).
+
+$\implies f$ stetig in $a$.
+
+::: proof
+```{=tex}
+\begin{proof}
+$$\lim_{x\to a}f(x)=\lim_{x\to a}(f(a)+A(x-a)+R(x))=f(a)$$
+\end{proof}
+```
+:::
+
+## $A=f'(a)$
+
+Sei $f:D\subseteq\R^n\to\R^m$ und differenzierbar in $a\in D$, $D$ offen
+und sei $f(a+v)=f(a)+Av+R(v)$ wie zuvor. Dann ist $f$ in $a$ partiell
+differenzierbar und es gilt $A=f'(a)$. Insbesondere: $A$ eindeutig.
+
+::: proof
+```{=tex}
+\begin{proof}
+Sei $A=(a_{i,j})_{i,j}$, $v=(v_1,...,v_n)^\top\in\R^n$.
+
+Für $i\in\{1,...,m\}$ ist $f_i(a+v)=f_i(a)+\sum_{j=1}^na_{ij}v_j+R_i(v)$.
+
+Setzt man $v=\underbrace{h}_{\in\R}\cdot e_k$, so ist $\|v\|=|h|=\mathrm{sgn}(h)\cdot h$ und \begin{align*}&\frac{f_i(a+v)-f_i(a)}{\|v\|}=\frac{a_{ik}\cdot h}{\|v\|}+\frac{R_i(v)}{\|v\|}\quad\mid\phantom{{}}\cdot\mathrm{sgn}(h)\\\iff&\underbrace{\frac{f_i(a+v)-f_i(a)}{h}}_{\to\frac{\partial f}{\partial x_k}(a)}=a_{ik}\cdot h+\underbrace{\frac{R_i(v)}{\|v\|}\cdot\mathrm{sgn}(h)}_{\to0}\\\implies&a_{ik}=\frac{\partial f_i}{\partial x_k}(a)\end{align*}
+\end{proof}
+```
+:::
+
+::: bsp
+`\textbf{Tangentialebene berechnen}`{=tex}:
+
+- wir wissen, dass $\frac{R(x)}{\|x-a\|}\to0$ gilt und demnach $f(x)$
+ in einer Umgebung von $a$ angenähert werden kann durch
+ $$g(x)=\underbrace{f(a)}_{\text{TODO?}}+\underbrace{f'(a)\cdot(x-a)}_{\text{lineare Abbildung}}$$
+ vorausgesetzt $f$ ist in $a$ differenzierbar. $g$ heißt lineare
+ Approximation/Tangentialebene von $f$ in $a.\\$Z.B.:
+ $f(x_1,x_2)=x_1^2+x_2^2,\quad\begin{pmatrix}x_1\\x_2\end{pmatrix}\in\R^2$
+ Tangentialebene in $(a_1,a_2,f(a_1,a_2))^\top\in\R^3$ für
+ $a=\begin{pmatrix}a_1\\a_2\end{pmatrix}=\begin{pmatrix}1\\2\end{pmatrix}$.
+ `\begin{align*}g(x)&=f(a)+f'(a)(x-a)=5+\begin{pmatrix}2&4\end{pmatrix}\begin{pmatrix}x_1-1\\x_2-2\end{pmatrix}\\&=5+2x_1-2+4x_2-8\\&=-5+2x_1+4x_2\end{align*}`{=tex}
+
+- $f$ differenzierbar in $a\in D\iff f_i$ differenzierbar in
+ $a\in D\quad\forall i\in\{1,...,n\}$.
+
+ ::: proof
+ ```{=tex}
+ \begin{proof}
+ Sei $f'(a)=(a_{ij})$ die Jacobimatrix von $f$ in $a$.\\Dann: \begin{align*}&f(x)=f(a)+f'(a)(x-a)+R(x),\quad\frac{R(x)}{\|x-a\|}\to0\\\iff&f_i(x)=f_i(a)+\underbrace{\sum_{j=1}^na_{ij}(x_j-a_j)}_{f_i'(a)(x-a)}+R_i(x),\quad\forall i\in\{1,...,m\};\ \frac{R(x)}{\|x-a\|}\to0\end{align*}
+ \end{proof}
+ ```
+ :::
+:::
+
+## Ableitungsregeln
+
+### Kettenregel
+
+Seien $U\subseteq\R^n,\ V\subseteq\R^m$ offen, $a\in U$, $f:U\to\R^m$,
+$g:V\to\R^k$ mit $f(U)\subseteq V$.
+
+Ist $f$ differenzierbar in $a\in U$ und $g$ differenzierbar in $f(a)$,
+so ist $g\circ f$ differenzierbar in $a$ und es gilt:
+$$(g\circ f)'(a)=g'(f(a))\cdot f'(a)$$
+
+::: proof
+```{=tex}
+\begin{proof}
+Es seien $L:=f'(a)$, $K:=g'(f(a))$.
+
+D.h.: $K\cdot L=g'(f(a))\cdot f'(a)$.
+
+Setze
+\begin{itemize}
+ \item $R(v)=f(a+v)-f(a)-Lv$
+ \item $S(w)=g(f(a)+w)-g(f(a))-Kw$
+ \item $T(v)=(g\circ f)(a+v)-(g\circ f)(a)-KLv$
+\end{itemize}
+$f,g$ differenzierbar in $a$ bzw. $f(a)$.
+
+$\implies\lim_{v\to0}\frac{R(v)}{\|v\|}=0$, $\lim_{w\to0}\frac{s(w)}{\|w\|}=0$
+
+$\lim_{v\to0}\frac{T(v)}{\|v\|}=0$ folgt durch simples Einsetzen und Umformen.
+
+$\lim_{v\to0}\frac{S(R(v)+Lv)}{\|v\|}=0$ folgt ebenfalls (bisschen komplexer eigentlich).
+
+Daraus folgt für $0<\|v\|<\epsilon$: $$\frac{\|R(v)+Lv\|}{\|v\|}\le\frac{\|R(v)\|}{\|v\|}+\left\|L\cdot\frac{v}{\|v\|}\right\|\le1+c$$
+Damit ergibt sich: $$\frac{S(R(v)+Lv)}{\|v\|}=\frac{S(R(v)+Lv)}{\|R(v)+Lv\|}\cdot\frac{\|R(v)+Lv\|}{\|v\|}\xrightarrow[v\to0]{}0$$
+
+\end{proof}
+```
+:::
+
+::: bsp
+Sei
+$f:\R\to\R^2,\ f(t)=\begin{pmatrix}\cos t\\t\end{pmatrix}\implies f'(t)=\begin{pmatrix}-\sin t\\1\end{pmatrix}$
+
+Sei außerdem
+$g:\R^2\to\R^2,\ g(x,y)=\begin{pmatrix}x^2+3y\\x-y\end{pmatrix}\implies g'(x,y)=\begin{pmatrix}2x&3\\1&-1\end{pmatrix}$
+
+Gesucht ist $(g\circ f)'$.
+
+1. $(g\circ f)'(t)=g'(f(t))\cdot f'(t)=\begin{pmatrix}2\cos t&3\\1&-1\end{pmatrix}\begin{pmatrix}-\sin t\\1\end{pmatrix}=\begin{pmatrix}-2\cos t\cdot\sin t+3\\-\sin t - 1\end{pmatrix}$
+2. $(g\circ f)(t)=g\begin{pmatrix}\cos t\\t\end{pmatrix}=\begin{pmatrix}\cos^2t+3t\\\cos t-t\end{pmatrix}\implies(g\circ f)'(t)=\begin{pmatrix}-2\cos t\cdot\sin t+3\\-\sin t-1\end{pmatrix}$
+:::
+
+### Weitere Ableitungsregeln
+
+Sei $D\subseteq\R^n$ offen, $f,g:D\to\R^m$ differenzierbar in $a\in D$,
+$\lambda\in\R$. Dann sind auch $f+g$, $\lambda f$, $f^\top g$ in $a$
+differenzierbar und es gilt:
+
+- $(f+g)'(a)=f'(a)+g'(a)$
+- $(\lambda f)'(a)=\lambda f'(a)$
+- $(f^\top g)'(a)=f(a)^\top g'(a)+g(a)^\top f'(a)$
+
+::: bsp
+$f,g: \R^2\to\R^2$, $f(x,y)=\begin{pmatrix}x-y\\x\end{pmatrix}$,
+$g(x,y)=\begin{pmatrix}x^2\\y\end{pmatrix}$,
+$f'(x,y)=\begin{pmatrix}1&-1\\1&0\end{pmatrix}$,
+$g'(x,y)=\begin{pmatrix}2x&0\\0&1\end{pmatrix}$
+`\begin{align*}\implies (f^\top g)'(x,y)&=(x-y,x)\begin{pmatrix}2x&0\\0&1\end{pmatrix}+(x^2,y)\begin{pmatrix}1&-1\\1&0\end{pmatrix}\\&=(2x^2-2xy,x)+(x^2+y,-x^2)\\&=(3x^2-2xy+y,x-x^2)\end{align*}`{=tex}
+:::
+
+## Mittelwertsätze
+
+### Mittelwertsatz für skalare Funktionen
+
+Sei $D\subseteq\R^n$ offen, $f:D\to\R$ differenzierbar und $a,b\in D$,
+sodass $$S(a,b):=\{a+t(b-a)\mid t\in(0,1)\}\subseteq D$$ Dann existiert
+ein $\xi\in S(a,b)$, sodass $$f(b)-f(a)=f'(\xi)(b-a)$$
+
+::: proof
+```{=tex}
+\begin{proof}
+Sei $\varphi:[0,1]\to D$ mit $\varphi(t)=a+t(b-a)$, $g:=f\circ\varphi:[0,1]\to\R$. $f$ differenzierbar, $\varphi$ differenzierbar auf $(0,1)$ und stetig auf $[0,1]$.
+
+$\implies g$ differenzierbar auf $(0,1)$ und stetig auf $[0,1]$
+$\implies \exists\vartheta\in(0,1)$ mit $\frac{g(1)-g(0)}{1-0}=g'(\vartheta)$.
+
+Sei $\xi:=\phi(\vartheta)$.
+\begin{align*}
+\implies f(b)-f(a)&=f(\varphi(1))-f(\varphi(0))=g(1)-g(0)\\
+&=g'(\vartheta)=(f\circ\varphi)'(\vartheta)\\
+&=f'(\varphi(\vartheta))\cdot\varphi'(\vartheta)\quad\mid\varphi'(t)=b-a\\
+&=f'(\xi)(b-a)
+\end{align*}
+\end{proof}
+```
+:::
+
+::: bem
+Für vektorwertige Funktionen kann man den vorigen Satz nicht beweisen.
+Z.B.:
+
+Sei
+$f:[0,2\pi]\to\R^2,\ f(t)=\begin{pmatrix}\cos t\\\sin t\end{pmatrix}$.
+
+Gibt $\xi\in(0,2\pi)$ mit $f(2\pi)-f(0)=f'(\xi)(2\pi-0)$?
+
+Nein, da
+$$f(2\pi)-f(0)=\begin{pmatrix}1\\0\end{pmatrix}-\begin{pmatrix}1\\0\end{pmatrix}=0\ne f'(\xi)\cdot2\pi\implies f'(\xi)=(0,0).$$
+
+Aber: $f'(t)=(-\sin t,\cos t)\ne(0,0)\quad\forall t\in(0,2\pi)$.
+
+Es lässt sich jedoch eine Abschätzung mithilfe von Integralen zeigen.
+:::
+
+## Riemann-Integral
+
+### Zerlegung
+
+Sei $[a,b]\subseteq\R$.
+
+- $Z:=\{x_0,x_1,...,x_n\}\subseteq[a,b]$, $a=x_0<x_1<...<x_n=b$ heißt
+ Zerlegung von $[a,b]$
+- $|Z|:=\max_{i=1,...,n}(x_i-x_{i-1})$ heißt Feinheit von $Z$
+- $\sum[a,b]$: Menge aller Zerlegungen von $\yogh[a,b]$
+
+### Riemannsche Summe
+
+Sei $f:[a,b]\to\R$ und $Z=\{x_0,...,x_n\}\in\yogh[a,b]$.
+
+- $\xi:=(\xi_1,...,\xi_n)$, $\xi_i\in[x_{i-1},x_i]$, heißt
+ Zwischenvektor von $Z$
+- $S(f,Z,\xi):=\sum_{i=1}^nf(\xi_i)(x_i-x_{i-1})$ heißt Riemannsche
+ Summe
+
+### Riemann-Integral
+
+$f:[a,b]\to\R$ heißt $R$-integrierbar auf $[a,b] :\iff$ für jede Folge
+$Z_n\in\yogh[a,b]$ mit Zwischenvektor $\xi_n$ und
+$|Z_n|\xrightarrow[n\to\infty]{}0$ konvergiert $S(f,Z_n,\xi_n)$ gegen
+$A\in\R$.
+
+Bezeichnung: $A=\int_a^bf(x)\mathrm dx$
+
+::: bem
+Die Definition ist äquivalent zu derjenigen aus Mathe 1.
+:::
+
+### Riemann-Integral für $f:[a,b]\to\R^m$
+
+Sei $f:[a,b]\to\R^m$.
+
+- Für $Z$, $\xi$ wie zuvor ist
+ $S(f,Z,\xi):=\sum_{i=1}^nf(\xi_i)(x_i-x_{i-1})$
+- Für $Z_n$, $\xi_n$ sei $A\in\R^m$ der Grenzwert von
+ $S(f,Z_n,\xi_n)$, falls existent.$\\$Bezeichnung:
+ $A=\int_a^bf(x)\mathrm dx$
+
+::: bem
+- Offensichtlich gilt:
+ $$f:[a,b]\to\R^m\ R\text{-integrierbar}\iff f_i:[a,b]\to\R\ R\text{-integrierbar}\quad\forall i=1,...,m.$$D.h.
+ $$\int_a^bf(x)\mathrm dx=\begin{pmatrix}\int_a^bf_1(x)\mathrm dx\\\vdots\\\int_a^bf_m(x)\mathrm dx\end{pmatrix}$$
+- Eine Matrix $A(x)\in\M_{m,n}(\R)$ kann man mit einem Vektor
+ $v(x)\in\R^m\cdot n$ identifizieren, indem alle Matrixeingänge in
+ eine Spalte geschrieben werden. Daher kann man
+ definieren:$\\$$\int_a^bA(x)\mathrm dx:=\left(\int_a^ba_{ij}(x)\mathrm dx\right)_{i,j}$
+ und es gilt
+ $$\int_a^bA(x)\cdot h\mathrm dx=\int_a^bA(x)\mathrm dx\cdot h\quad\forall h\in\R^n$$
+:::
+
+### Dreiecksungleichung
+
+$$f:[a,b]\to\R^m\text{ stetig}\implies\left\|\int_a^bf(x)\mathrm dx\right\|\le\int_a^b\left\|f(x)\right\|\mathrm dx$$
+
+::: proof
+```{=tex}
+\begin{proof}
+\begin{align*}
+\|S(f,Z,\xi)\|&=\|\sum_{i=1}^nf(\xi_i)(x_i-x_{i-1})\|\\
+&\le\sum_{i=1}^n\|f(\xi_i)\|\cdot\underbrace{(x_i-x_{i-1})}_{\ge0}\\
+&=S(\underbrace{\|f\|}_{\mathclap{\text{stetig, da $f$ stetig}}},Z,\xi)
+\end{align*}
+\end{proof}
+```
+:::
+
+## Mittelwertsätze für vektorwertige Funktionen
+
+$f:D\subseteq\R^n\to\R^m$ ($D$ offen) sei differenzierbar, sodass alle
+partiellen Ableitungen stetig sind (d.h. $f$ stetig differenzierbar).
+Ferner seien $a,b\in D$, sodass
+$$S=\{a+t(b-a)\mid t\in[0,1]\}\subseteq D.$$
+
+Für $h:=b-a$ folgt:
+
+- $f(b)-f(a)=\underbrace{\int_0^1f'(a+th)\mathrm dt}_{\in\M_{m,n}(\R)}\cdot h\in\R^m$
+- $\|f(b)-f(a)\|\le M\cdot\|h\|$, wobei
+ $M:=\max_{x\in S}\underbrace{\|f'(x)\|}_{\mathclap{\text{stetig, da alle partiellen Ableitungen stetig}}}$
+
+::: proof
+```{=tex}
+\begin{proof}
+\begin{itemize}
+\item $\varphi_j: [0,1]\to\R$, $\varphi_j(t):=f_j(a+t\cdot h)$, $h=b-a$.
+\begin{align*}
+\implies f_j(b)-f_j(a)&=\varphi_j(1)-\varphi_j(0)\\
+&=\int_0^1\varphi_j'(t)\mathrm dt\\
+&=\int_0^1\underbrace{f_j'(a+th)}_{\mathclap{\text{stetig, d.h. $R$-integrierbar}}}\cdot h\mathrm dt
+\end{align*}
+\begin{align*}
+\implies f(b)-f(a)&=\begin{pmatrix}\int_0^1f_1'(a+th)\cdot h\mathrm dt\\\vdots\\\int_0^1f_m'(a+th)\cdot h\mathrm dt\end{pmatrix}\\
+&=\int_0^1f'(a+th)\cdot h\mathrm dt\\
+&=\int_0^1f'(a+th)\mathrm dt\cdot h
+\end{align*}
+\item $\|f(b)-f(a)\|=\left\|\int_0^1f'(a+th)\mathrm dt\cdot h\right\|\le\int_0^1\underbrace{\|f'(a+th)\|}_{\le M}\mathrm dt\cdot\|h\|$
+\end{itemize}
+\end{proof}
+```
+:::
+
+::: bem
+- Differenzierbarkeit $\implies$ partielle Differenzierbarkeit
+- Umkehrung gilt nicht
+:::
+
+## Partielle und totale Differenzierbarkeit
+
+Seien $D\subseteq\R^n$ offen, $a\in D$ und $f:D\to\R$ partiell
+differenzierbar in $a$. Sind alle partiellen Ableitungen
+$\frac{\partial f}{\partial x_i}$ ($i=1,...,n$) stetig in $a$, so ist
+$f$ total differenzierbar in $a$.
+
+::: proof
+TODO.
+:::
+
+::: bem
+- Partielle Differenzierbarkeit gilt auch für vektorwertige Funktionen
+ $f:D\subseteq\R^n\to\R^m$ ($D$ offen)
+- Die Stetigkeit der paritellen Ableitung ist ein hinreichendes, aber
+ kein notwendiges Kriterium für Differenzierbarkeit
+- Alle Polynome sind differenzierbar, da die partiellen Ableitungen
+ alle stetig sind
+:::
+
+## Richtungsableitung
+
+Sei $D\subseteq\R^n$ offen, $f:D\to\R$, $v\in\R^n$ mit $\|v\|=1$.
+
+$f$ heißt in $a\in D$ differenzierbar in Richtung $v$, falls
+$\lim_{h\to0}\frac{f(a+hv)-f(a)}{h}$ exisitert. Der Grenzwert heißt
+Richtungsableitung von $f$ in Richtung $v$ in $a$,
+$\frac{\partial f}{\partial v}(a)$.
+
+::: bsp
+- $\frac{\partial f}{\partial e_i}(a)=\lim_{h\to0}\frac{f(a+he_i)-f(a)}{h}=\frac{\partial f}{\partial x_i}(a)$
+- $f:\R^2\to\R$,
+ $f(x,y)=\begin{cases}\frac{xy^2}{x^2+y^4}&(x,y)\ne(0,0)\\0&(x,y)=(0,0)\end{cases}$
+ - Wissen: $f$ unstetig in $0\in\R^2$
+ - $f$ ist in jede Richtung $v\in\R^2$, $\|v\|=1$, ableitbar in 0:
+ Sei
+ $v=(v_1,v_2)^\top\\\implies\frac{f(hv)-f(0,0)}{h}=\frac{h^2v_1v_2^2}{h\cdot h^2(v_1^2+h^2v_2^4)}\implies\frac{\partial f}{\partial v}(0,0)=\begin{cases}v_2^2/v_1&v_1\ne0\\0&v_1=0\end{cases}$
+- $f:\R^2\to\R$, $f(x,y)=x^2+y^2$, $h\to f(a+hv)$ ist eindimensionale
+ Funktion. TODO: Graph
+:::
+
+### Satz
+
+Sei $D\subseteq\R^n$ offen, $f:D\to\R$ differenzierbar. Dann existieren
+alle Richtungsableitungen von $f$ in $a\in D$ und
+$$\frac{\partial f}{\partial v}(a)=f'(a)\cdot v$$
+
+::: proof
+```{=tex}
+\begin{proof}
+\begin{align*}
+&\frac{f(a+hv)-f(a)}{h}-f'(a)\cdot v\\
+=&\|v\|\frac{\overbrace{f(a+hv)-f(a)-f'(a)\cdot v\cdot h}^{R(hv)}}{\|hv\|\cdot\sgn(h)}\xrightarrow{h\to0}0\\
+\implies&\frac{\partial f}{\partial v}(a)=f'(a)v
+\end{align*}
+\end{proof}
+```
+:::
+
+::: bsp
+$$f(x,y)=e^{xy}+x^2\implies f'(x,y)=(ye^{xy}+2x,xe^{xy})$$ Sei
+$v=\frac{1}{\sqrt{2}}(1,1)^\top$
+
+$\implies\frac{\partial f}{\partial v}(x,y)=(ye^{xy+2x,xe^{xy}})\cdot\frac{1}{\sqrt{2}}\begin{pmatrix}1\\1\end{pmatrix}=\frac{1}{\sqrt{2}}(e^{xy}(x+y)+2x)$
+:::
+
+### Satz
+
+Sei $D\subseteq\R^n$ offen, $f:D\to\R$ differenzierbar in $a\in D$ mit
+$f'(a)\ne0$. Dann gilt:
+
+- $\nabla f(a)\in\R^n$ zeigt in Richtung des steilsten Anstiegs von
+ $f$ im Punkt $a$, d.h.: $\frac{\partial f}{\partial v}(a)$ wird für
+ $v=\frac{\nabla f(a)}{\|\nabla f(a)\|}$ am größten.
+- Ist $D\subseteq\R^2$, so steht $\nabla f(a)$ senkrecht auf der
+ Niveaulinie $N_{f(a)}(f)=\{x\in D\mid f(x)=f(a)\}$
+
+::: proof
+```{=tex}
+\begin{proof}
+$\frac{\partial f}{\partial v}(a)=f'(a)\cdot v=(\nabla f(a)\mid v)=\cos\alpha\cdot\|\nabla f(a)\|$, $\alpha\in[0,2\pi)$ der Winkel, der von $\nabla f(a)$ und $v$ eingeschlossen wird.
+
+\begin{abc}
+\item $\cos\alpha$ (und somit $\frac{\partial f}{\partial v}(a)$) maximal für $v=\frac{\nabla f(a)}{\|\nabla f(a)\|}$
+\item Sei $v\in\R^2$, $\|v\|=1$, sodass $(\partial f(a)\mid v)=0\implies\frac{\partial f}{\partial v}(a)=0$, d.h. in Richtung $v$ weißt $f$ keine Steigung auf im Punkt $a$. Somit zeight $v$ in Richtung der Niveaulinie $N_{f(a)}(f)$
+\end{abc}
+\end{proof}
+```
+:::
+
+## Satz von Schwarz
+
+### Stetige Differenzierbarkeit
+
+$D\subseteq\R$ offen, $f:D\to\R$.
+
+- $f$ heißt stetig differenzierbar ($f\in\mathcal{C}^1(D)$), wenn $f$
+ in jedem Punkt von $D$ partiell differenzierbar ist und alle
+ $\frac{\partial f}{\partial x_i}$ ($i\in\{1,...,n\}$) auf $D$ stetig
+ sind
+- $f$ heißt 2-mal stetig differezierbar ($f\in\mathcal{C}^2(D)$), wenn
+ $f\in\mathcal{C}^1(D)$ und alle $\frac{\partial f}{\partial x_j}$
+ ($j\in\{1,...,n\}$) $\in\mathcal{C}^1(D)$. Die partielle Ableitung
+ von $\frac{\partial f}{\partial x_j}$ nach $x_k$ wird mit
+ $\frac{\partial^2f}{\partial x_2\partial x_j}$ bezeichnet (partielle
+ Ableitung zweiter Ordnung). Für $k=j$ schreibt man kurz
+ $\frac{\partial^2f}{\partial x_j^2}$.
+- Analog ist $f$ $s$-mal stetig differenzierbar
+ ($f\in\mathcal{C}^s(D)$), wenn alle partiellen Ableitungen der
+ Ordnung $s$
+ $\frac{\partial^sf}{\partial x_{j_s}...\partial x_{j_1}}$ existieren
+ und stetig sind.
+
+Gleiches gilt auch für vektorwertige Funktionen.
+
+::: bsp
+$f:\R^2\to\R$, $f(x,y)=3y+xy^2$
+
+$\frac{\partial f}{\partial x}(x,y)=y^2$ und
+$\frac{\partial f}{\partial y}(x,y)=3+2xy$.
+
+Dann $\frac{\partial^2f}{\partial x^2}(x,y)=0$,
+$\frac{\partial^2f}{\partial y\partial x}(x,y)=2y=\frac{\partial^2f}{\partial x\partial y}(x,y)$
+sowie $\frac{\partial^2f}{\partial y^2}(x,y)=2x$.
+:::
+
+### Satz
+
+$D\subseteq\R^n$ offen, $f:D\to\R\in\mathcal{C}^2(D)$
+
+$\implies\frac{\partial^2f}{\partial x_k\partial x_j}=\frac{\partial^2f}{\partial x_j\partial x_k}\quad\forall j,k\in\{1,...,n\}$
+
+::: proof
+```{=tex}
+\begin{proof}
+Es genügt, die Behauptung für $D\in\R^2$ zu beweisen.
+
+Sei $a=\begin{pmatrix}a_1\\a_2\end{pmatrix}\in D$.
+
+Zu zeigen: $\frac{\partial^2f}{\partial x\partial y}(a)=\frac{\partial^2f}{\partial y\partial x}(a)$.
+
+Sei $\delta>0$ mit $K_\delta(a)\subseteq D$.
+
+$\implies\exists\epsilon>0,0<k,k<\epsilon$, sodass $(a_1+k,a_2+k)^\top\in K_\delta(a)$.
+
+\begin{abc}
+\item Sei $\varphi: [a_1,a_1+h]\to\R$, $\varphi(t)=f(t,a_2+k)-f(t,a_2)$.
+
+$\implies\exists\xi_1\in(a_1,a_1+h):\varphi(a_1+h)-\varphi(a_1)=h\cdot\varphi'(\xi_1)$
+
+Setze
+\begin{align*}
+F(h,k)&:=\overbrace{f(a_1+h,a_2+k)-f(a_1+h,a_2)}^{\varphi(a_1+h)}-\overbrace{f(a_1,a_2+k)+f(a_1,a_2)}^{\-\varphi(a_1)}\\
+&=h\cdot\varphi'(\xi_1)\\
+&=h\bigg[\underbrace{\frac{\partial f}{\partial x}(\xi_1,a_2+k)-\frac{\partial f}{\partial x}(\xi_1,a_2)}_{\mathclap{=\frac{\partial^2f}{\partial y\partial x}(\xi_1,\vartheta_1)\cdot k\text{ für ein }\vartheta_1\in(a_2,a_2+k)}}\bigg]\\
+&\implies F(h,k)=h\cdot k\frac{\partial^2f}{\partial y\partial x}(\xi_1,\vartheta_1)
+\end{align*}
+\item Analog erhält man für $\psi(t):=f(a_1+h,t)=f(a_1,t)$, dass $F(h,k)=\psi(a_2+k)-\psi(a_2)$ und $F(h,k)=h\cdot k\frac{\partial^2f}{\partial x\partial y}(\xi_2,\vartheta_2)$ für $\xi_2\in(a_1,a_1+h)$, $\vartheta\in(a_2,a_2+k)$.
+\item Insgesamt folgt, da $h,k\ne0$: $\frac{\partial^2f}{\partial y\partial x}(\xi_1,\vartheta_1)=\frac{\partial^2f}{\partial x\partial y}(\xi_2,\vartheta_2)$
+
+$\xRightarrow{h,k\to0}\frac{\partial^2f}{\partial y\partial x}(a_1,a_2)$, da $f\in\mathcal{C}^2(D).$
+\end{abc}
+\end{proof}
+```
+:::
+
+::: bsp
+Ist für folgende Funktion nicht erfüllt:
+$$f(x,y)=\begin{cases}0&(x,y)=(0,0)\\\frac{x^3y-xy^3}{x^2+y^2}&\text{sonst}\end{cases}$$
+:::
+
+## Satz von Taylor
+
+Sei $I\subseteq\R$ ein Intervall, $x_0\in I$, $f:I\to\R$ $(k+1)$-mal
+stetig differenzierbar, $k\in\N_0$. Dann git die folgende
+Taylorentwicklung um $x_0$ für ein $\xi$ zwischen $x$ und $x_0$:
+
+$f(x)=T_k(x)+R_k(x)$ mit
+$T_k(x)=\sum_{j=0}^k\frac{f^{(j)}(x_0)}{j!}(x-x_0)^j$ sowie
+$R_k(x)=\frac{f^{(k+1)}(\xi)}{(k+1)!}(x-x_0)^{x+1}$ (Restglied nach
+Lagrange)
+
+::: bem
+Die Taylorreihe
+$T(x):=\sum_{j=0}^\infty\frac{f^{(j)}(x_0)}{j!}(x-x_0)^j$ konvergiert
+gegen $f(x)\iff\lim_{k\to\infty}R_k(x)=0$. (Vorausgesetzt $f$ ist
+unendlich oft differenzierba.r)
+:::
+
+::: bsp
+Berechne $\sin(1)$ mit Fehlerdifferenz $<10^{-3}!$.
+
+Entwickle dazu $f(x)=\sin(x)$ um $x_0=0$. Suche $k\in\N$, sodass
+$$|R_k(1)|=\frac{|f^{(k+1)}(\xi)|}{(k+1)!}|1-0|^{k+1}<\frac{1}{1000}, \xi\text{ zwischen }0\text{ und } 1.$$
+
+$f(x)=\sin x$, $f'(x)=\cos x$,
+$f''(x)=-\sin x, f'''(x)=-f'(x), f^{(4)}(x)=f(x)$
+
+$\implies f^{(2n)}(x)=(-1)^n\sin(x)$ und $f^{(2n+1)}(x)=(-1)^n\cos(x)$
+für $n\ge0$
+
+$\implies|R_k(1)|\le\frac{1}{(k+1)!}<\frac{1}{1000}$
+
+$\iff (k+1)!>1000\iff k\ge6$
+
+Für $k=6$ ist
+`\begin{align*}\sin(1)\approx T_6(1)&=\frac{\sin0}{0!}(1-0)^0+\frac{\cos0}{1!}(1-0)^1-\frac{\sin0}{2!}(1-0)^2\pm...\pm\frac{\sin0}{6!}(1-0)^6\\&=0+1+0-\frac{1}{6}+0+\frac{1}{120}+0=\frac{101}{120}\\&\approx 0.841\end{align*}`{=tex}
+:::
+
+### Multiindex
+
+$p:=(p_1,...,p_m)\in\N_0^m$ heißt Multiindex.
+
+$|p|:=p_1+...+p_m$ Ordnung von $p$.
+
+$p!:=(p_1!)\cdot...\cdot(p_m!)$
+
+Für $x\in\R^m$, $x=(x_1,...,x_m)^\top$ sei
+$x^P:=x_1^{P_1}\cdot...\cdot x_m^{P_m}.$
+
+Ist $f$ $k$-mal stetig differenzierbar, so sei
+$\partial^Pf:=\frac{\partial^{|P|}f}{\partial x_1^{P_1}...\partial x_m^{P_m}}.$
+
+::: bsp
+- $P=(0,...,0)\implies\partial^Pf=f$
+- $P=(1,0,...,0)\implies\partial^Pf=\frac{\partial f}{\partial x_1}$
+- $P=(1,2,0,...,0)\implies\partial^Pf=\frac{\partial^3f}{\partial x_1\partial x_2^2}$
+:::
+
+### Taylorpolynome
+
+Sei $D\subseteq\R^n$ offen, $a\in D$, $f:D\to\R$ $k$-mal stetig
+differenzierbar.
+
+$T_k:\R^n\to\R$,
+$T_k(x)=\sum_{|P|\le k}\frac{\partial^Pf(a)}{P!}(x-a)^P$ heißt $k$-tes
+Taylorpolynom $f$ in $a$. $R_k(x)=f(x)-T_k(x)$ heißt $k$-tes Restglied
+von $f$ in $a$.
+
+### Hessematrix
+
+Sei $D\subseteq\R^n$ offen, $f:D\to\R$ 2-mal stetig differenzierbar,
+$a\in D$. Dann ist
+
+- $T_1(x)=\underbrace{f(a)}_{|p|=0}+\underbrace{\sum_{i=1}^n\frac{\partial f}{\partial x_i}(x_i-a_i)}_{|p|=1,p=(--\underbrace{1}_i--)}=f(a)+f'(a)(x-a)$
+ lineare Approximation in $a$
+- $T_2(x)=f(a)+f'(a)(x-a)+\frac{1}{2!}\sum_{i,j=1}^n\frac{\partial^2f}{\partial x_i\partial x_j}(a)(x_i-a_i)(x_j-a_j)$
+ und $H_f(a):=(a_{ij})\in\M_n(\R)$,
+ $a_{ij}=\frac{\partial^2f}{\partial x_i\partial x_j}(a)$ ist die
+ sogenannte Hessematrix von $f$ in $a$. Damit erhält man
+ $$T_2(x)f(a)+f'(a)(x-a)+\frac{1}{2}(x-a)^\top H_f(a)(x-a)$$
+
+::: bsp
+$f:\R^2\to\R$, $f(x,y)=e^x=xy$
+
+$f'(x,y)=(e^x+y,x)$.
+
+$H_f(x,y)=\begin{pmatrix}\frac{\partial^2f}{\partial x^2}(x,y)&\frac{\partial^2f}{\partial x\partial y}(x,y)\\\frac{\partial^2f}{\partial y\partial x}(x,y)&\frac{\partial^2f}{\partial y^2}(x,y)\end{pmatrix}=\begin{pmatrix}e^x&1\\1&0\end{pmatrix}.$
+
+Sei $a=\begin{pmatrix}0\\1\end{pmatrix}$.
+`\begin{align*} \implies T_2(x,y)&=f(0,1)+f'(0,1)\begin{pmatrix}x-0\\y-1\end{pmatrix}+\frac{1}{2}(x-0,y-1)H_f(0,1)\begin{pmatrix}x-0\\y-1\end{pmatrix}\\ &=1+(2,0)\begin{pmatrix}x\\y-1\end{pmatrix}+\frac{1}{2}(x,y-1)\begin{pmatrix}1&1\\1&0\end{pmatrix}\begin{pmatrix}x\\y-1\end{pmatrix}\\ &=1+2x+\frac{1{2}}(x^2+2(y-1)x)\\ &=1+x+\frac{1}{2}x^2+xy \end{align*}`{=tex}
+:::
+
+## Satz von Taylor für mehrdimensionale Funktionen
+
+Sei $D\subseteq\R^n$ offen, $f\in\mathcal{C}^{k+1}(D,\R)$ und seien
+$a,x\in D$, sodass $S(a,x)=\{a+t(x-a)\mid t\in(0,1)\}\subseteq D$. Dann
+existiert ein $\xi\in S(a,x)$ mit
+$$R_k(x)=\sum_{|p|=k+1}\frac{\partial^Pf(\xi)}{P!}(x-a)^P.$$
+$$\text{Lagrange-Form des Restgliedes}$$
+
+::: proof
+```{=tex}
+\begin{proof}
+Sei $v=x-a$. Dann ist $S(a,x)=\{a+tv\mid t\in(0,1)\}$.
+
+Setze $\varphi:[0,1]\to\R$, $\varphi(t):=f(a+tv)$.
+\begin{align*}
+\implies\varphi'(t)&=f'(a+tv)\cdot v\\
+&=\sum_{i=1}^n\frac{\partial f}{\partial x_i}(a+tv)v_i\\
+&=\sum_{|P|=1}\partial^Pf(a+tv)v^P.\\
+\varphi''(t)&=\sum_{i,j=1}^n\frac{\partial^2f}{\partial x_j\partial x_i}(a+tv)v_iv_j\\
+&=2\sum_{|p|=2}\frac{\partial^Pf(a+tv)}{P!}v^P\\
+&\vdots\\
+\varphi^{(k+1)}(t)&=\sum_{i_1,...,i_{k+1}=1}^n\frac{\partial^{k+1}f}{\partial x_{i_1}\dots\partial x_{i_{k+1}}}(a+tv)v_{i_1}\dots v_{i_{k+1}}\\
+&=(k+1)!\sum_{|P|=k+1}\frac{\partial^Pf(a+tv)}{P!}v^P
+\end{align*}
+
+$\implies\exists\vartheta\in(0,1)$ mit
+\begin{align*}
+R_k^\varphi(1)&=\frac{\varphi^{(k+1)}(\vartheta)}{(k+1)!}(1-0)^{k+1}\\
+&=\frac{\varphi^{(k+1)}(\vartheta)}{(k+1)!}
+\end{align*}
+Sei $\xi:=\varphi(\vartheta)=a+\vartheta v\in S(a,x)$
+\begin{align*}
+\implies R_k^\varphi(1)&=\sum_{|p|=k+1}\frac{\partial^Pf(\overbrace{a+\vartheta v}^{\mathclap{\xi}})}{P!}\underbrace{v^P}_{\mathclap{=(x-a)^P}}\\
+&=R_k(x)
+\end{align*}
+
+Es ist
+\begin{align*}
+T_k^\varphi(1)&=\sum_{i=0}^k\frac{\varphi^{(i)}(0)}{i!}(1-0)^i\\
+&=\sum_{i=0}^k\sum_{|P|=i}\frac{\partial^Pf(a)}{P!}v^P\\
+&=T_k(x)
+\end{align*}
+$\implies\varphi(1)=R_k^\varphi(1)+T_k^\varphi(1)\iff f(\underbrace{a+v}_{\mathclap{=x}})=R_k(x)+T_k(x)$
+\end{proof}
+```
+:::
diff --git a/notes/mathe3/main.pdf b/notes/mathe3/main.pdf
new file mode 100644
index 0000000..3df36b6
--- /dev/null
+++ b/notes/mathe3/main.pdf
Binary files differ
diff --git a/notes/mathe3/makefile b/notes/mathe3/makefile
new file mode 100644
index 0000000..36d0026
--- /dev/null
+++ b/notes/mathe3/makefile
@@ -0,0 +1,23 @@
+VIEW = zathura
+
+all:
+ @mkdir -p build/
+ @pandoc main.md --filter pandoc-latex-environment --toc -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o $(CURDIR)/build/main.tex --pdf-engine-opt=-shell-escape -H header.tex -B title.tex >/dev/null
+ @(pdflatex -shell-escape -halt-on-error -output-directory $(CURDIR)/build/ $(CURDIR)/build/main.tex | grep '^!.*' -A200 --color=always ||true) &
+ @progress 5 pdflatex
+ @cp build/main.pdf . &>/dev/null
+ @echo done.
+
+part:
+ @mkdir -p build/
+ @pandoc part.md --filter pandoc-latex-environment -N -V fontsize=11pt -V geometry:a4paper -V geometry:margin=2.5cm -o $(CURDIR)/build/main.tex --pdf-engine-opt=-shell-escape -H header.tex >/dev/null
+ @(pdflatex -shell-escape -halt-on-error -output-directory $(CURDIR)/build/ $(CURDIR)/build/main.tex | grep '^!.*' -A200 --color=always ||true) &
+ @progress 1 pdflatex
+ @echo done.
+
+clean:
+ @$(RM) -rf build
+
+run: all
+ @clear
+ @$(VIEW) build/main.pdf
diff --git a/notes/mathe3/title.tex b/notes/mathe3/title.tex
new file mode 100644
index 0000000..a10f295
--- /dev/null
+++ b/notes/mathe3/title.tex
@@ -0,0 +1,25 @@
+\begin{titlepage}
+ \begin{center}
+ \vspace*{1cm}
+
+ {\huge\textbf{Mathematik für Informatik 3}}
+
+ \vspace{0.5cm}
+ {\Large Inoffizielles Skript}\\
+ \textbf{Marvin Borner}
+
+ \vfill
+ {\Large \textbf{WARNUNG WIP: Fehler zu erwarten!}\\\textbf{Stand: \today, \currenttime}}\\
+ {\large Bitte meldet euch bei mir, falls ihr Fehler findet.}
+ % \includegraphics[width=0.4\textwidth]{zeller_logo}\\
+ \vfill
+
+ Vorlesung gehalten von\\
+ \textbf{Rüdiger Zeller}
+
+ \vspace{0.8cm}
+
+ \includegraphics[width=0.4\textwidth]{uni_logo}\\
+ Wintersemester 2022/23
+ \end{center}
+\end{titlepage}
diff --git a/sync.sh b/sync.sh
new file mode 100755
index 0000000..389216d
--- /dev/null
+++ b/sync.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+path="$HOME/studium"
+
+rm -rf notes/
+
+# mathe
+for i in $(seq 3); do
+ mkdir -p "notes/mathe$i/" && find "$path/SM$i/mathe$i/vorbereitung/" -maxdepth 1 -type f \( -name "main.md" -o -name "main.pdf" -o -name "exam.md" -o -name "*.tex" -o -name "makefile" \) -exec cp {} "notes/mathe$i/" \;
+done
+
+# algo
+mkdir -p "notes/algo/" && find "$path/SM3/algo/vorbereitung/" -maxdepth 1 -type f \( -name "main.md" -o -name "main.pdf" -o -name "*.tex" -o -name "makefile" \) -exec cp {} "notes/algo/" \;
+
+git add .
+git status
+echo "Commit?"