--- description: math runway, jephian, nsysu, 林晉宏 tags: talk, learning-together, math-runway --- $\newcommand{\trans}{^\top} \newcommand{\adj}{^{\rm adj}} \newcommand{\cof}{^{\rm cof}} \newcommand{\inp}[2]{\left\langle#1,#2\right\rangle} \newcommand{\dunion}{\mathbin{\dot\cup}} \newcommand{\bzero}{\mathbf{0}} \newcommand{\bone}{\mathbf{1}} \newcommand{\ba}{\mathbf{a}} \newcommand{\bb}{\mathbf{b}} \newcommand{\bc}{\mathbf{c}} \newcommand{\bd}{\mathbf{d}} \newcommand{\be}{\mathbf{e}} \newcommand{\bh}{\mathbf{h}} \newcommand{\bp}{\mathbf{p}} \newcommand{\bq}{\mathbf{q}} \newcommand{\br}{\mathbf{r}} \newcommand{\bx}{\mathbf{x}} \newcommand{\by}{\mathbf{y}} \newcommand{\bz}{\mathbf{z}} \newcommand{\bu}{\mathbf{u}} \newcommand{\bv}{\mathbf{v}} \newcommand{\bw}{\mathbf{w}} \newcommand{\tr}{\operatorname{tr}} \newcommand{\nul}{\operatorname{null}} \newcommand{\rank}{\operatorname{rank}} %\newcommand{\ker}{\operatorname{ker}} \newcommand{\range}{\operatorname{range}} \newcommand{\Col}{\operatorname{Col}} \newcommand{\Row}{\operatorname{Row}} \newcommand{\spec}{\operatorname{spec}} \newcommand{\vspan}{\operatorname{span}} \newcommand{\Vol}{\operatorname{Vol}} \newcommand{\sgn}{\operatorname{sgn}} \newcommand{\idmap}{\operatorname{id}} \newcommand{\am}{\operatorname{am}} \newcommand{\gm}{\operatorname{gm}} \newcommand{\mult}{\operatorname{mult}} \newcommand{\iner}{\operatorname{iner}}$ # How to write a good proof? ## 不同版本的證明 Prove the Cauchy–Schwarz inequality: For any vectors $\bx$ and $\by$ in $\mathbb{R}^n$, $$ \inp{\bx}{\by} \leq \|\bx\|\|\by\|. $$ :::warning **老師上課版** :male-teacher: Case 1: $\bx = \bzero$ or $\by = \bzero$. :male-teacher: Obvious, think about why. Case 2: Both $\bx$ and $\by$ are nonzero vectors with length $1$. :male-teacher: We have the following inequality. $\|\bx - \by\|^2 \geq 0$ :male-teacher: Recall that the square of the norm is the inner product of the vector with itself, we have ... $\inp{\bx - \by}{\bx - \by} \geq 0$ :male-teacher: This means ... $\|\bx\|^2 + \|\by\|^2 - 2\inp{\bx}{\by} \geq 0$ :male-teacher: Note that we have ... Note: $\|\bx\| = \|\by\| = 1$. :male-teacher: so ... $2 - 2\inp{\bx}{\by} \geq 0$ $\implies 2\inp{\bx}{\by} \leq 2$ $\implies \inp{\bx}{\by} \leq 1 = \|\bx\|\|\by\|$ Case 3: Both $\bx$ and $\by$ are nonzero vectors. :male-teacher: You may replace $\bx$ with $\frac{\bx}{\|\bx\|}$ and $\by$ with $\frac{\by}{\|\by\|}$. Then apply the previous case. This is left as your homework. ::: :::spoiler 優缺點 :+1: 屬於證明的導讀,著重證明的直覺。 :-1: 很多都只有講沒有寫下來。 :-1: 一堆細節都說 --- 這個回家當練習。 ::: :::danger **寫在你筆記上的版本** :notebook: Case 1: $\bx = \bzero$ or $\by = \bzero$. Obvious. Case 2: Both $\bx$ and $\by$ are nonzero vectors with length $1$. $\|\bx - \by\|^2 \geq 0$ $\inp{\bx - \by}{\bx - \by} \geq 0$ $\|\bx\|^2 + \|\by\|^2 - 2\inp{\bx}{\by} \geq 0$ Note: $\|\bx\| = \|\by\| = 1$. $2 - 2\inp{\bx}{\by} \geq 0$ $\implies 2\inp{\bx}{\by} \leq 2$ $\implies \inp{\bx}{\by} \leq 1 = \|\bx\|\|\by\|$ Case 3: Both $\bx$ and $\by$ are nonzero vectors. Homework. ::: --- :::success **課本版** :book: We first consider the case when either $\bx = \bzero$ or $\by = \bzero$. In this case, we have $\inp{\bx}{\by} = 0$ and $\|\bx\|\|\by\| = 0$, so the inequality is true. Then we consider a special case when both $\bx$ and $\by$ are unit vectors. Observe that $\|\bx - \by\|^2 \geq 0$. The left hand side can be written as the inner product $$ \begin{aligned} \|\bx - \by\|^2 &= \|\bx\|^2 + \|\by\|^2 - 2\inp{\bx}{\by} \\ &= 2 - 2\inp{\bx}{\by}. \end{aligned} $$ Note the second equality is because $\|\bx\| = \|\by\| = 1$. Thus, we have $2 - 2\inp{\bx}{\by} \geq 0$, which implies $\inp{\bx}{\by}\leq 1 = \|\bx\|\|\by\|$, so the inquality holds for this case. Finally, when $\bx$ and $\by$ are both nonzero vector, we may apply the second case the the normalized vectors $\frac{\bx}{\|\bx\|}$ and $\frac{\by}{\|\by\|}$, which are unit vectors. This gives us $$ \inp{\frac{\bx}{\|\bx\|}}{\frac{\by}{\|\by\|}} \leq \left\|\frac{\bx}{\|\bx\|}\right\|\left\|\frac{\by}{\|\by\|}\right\| = 1. $$ Since $$ \inp{\frac{\bx}{\|\bx\|}}{\frac{\by}{\|\by\|}} = \frac{1}{\|\bx\|\|\by\|}\inp{\bx}{\by}, $$ this leads to the desired inequality $\inp{\bx}{\by} \leq \|\bx\|\|\by\|$. This completes the proof. ::: :::spoiler 優缺點 :+1: 非常完整。 :+1: 正式寫作規格。 :-1: 好長。 :-1: 英文字好多。 ::: --- ## 寫一個好證明的重點 1. 想清楚每一個細節,看著你的筆記腦補完整的證明。 2. 懂了 $=$ ==能夠寫下來== $+$ 解釋給別人聽。 3. 分清楚直覺或是邏輯,想一下定義是什麼。 :x: Since $\inp{\bx}{\by} = \|\bx\|\|\by\|\cos\theta$ and $|\cos\theta| \leq 1$, we have $\inp{\bx}{\by} = \|\bx\|\|\by\|\cos\theta$. (為什麼內積會是 $\|\bx\|\|\by\|\cos\theta$?高維度的 $\theta$ 又是什麼?) 3. 句字要完整,連接用語跟數學式等同重要。 [Common English usage in Mathematics](https://hackmd.io/@jephianlin/eng-in-math): 一些基本證明的範例。 [風格指引](https://sagelabtw.github.io/LA-Tea/style.html): 正式寫作的一些建議。 ## 練習 Play the [Kahoot!](https://create.kahoot.it/details/26e8163e-ebfb-441a-93a5-12622721c8dc) game if you wish. :smiley: :::success **Exercise 1 (集合寫法)**: Write down the the set of all multiple of $6$. 1. $6k$ 2. $6k$, $k\in\mathbb{Z}$ 3. $\{6k: k\in\mathbb{Z}\}$ 4. $(6, 12, 18, \ldots)$ ::: :::success **Exercise 2 (集合寫法)**: Which one is a set of vectors? 1. $\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}$ 2. $\begin{bmatrix} 1 \\ 4 \end{bmatrix}$, $\begin{bmatrix} 2 \\ 5 \end{bmatrix}$, $\begin{bmatrix} 3 \\ 6 \end{bmatrix}$ 3. $c_1\begin{bmatrix} 1 \\ 4 \end{bmatrix} + c_2\begin{bmatrix} 2 \\ 5 \end{bmatrix} + c_3\begin{bmatrix} 3 \\ 6 \end{bmatrix}$ for some $c_1,c_2,c_3\in\mathbb{R}$ 4. $\left\{\begin{bmatrix} 1 \\ 4 \end{bmatrix}, \begin{bmatrix} 2 \\ 5 \end{bmatrix}, \begin{bmatrix} 3 \\ 6 \end{bmatrix}\right\}$ ::: :::success **Exercise 3 (集合包含)**: Let $A$ and $B$ be two sets. Which statement is equivalent to $A\subseteq B$. 1. For any $x\in A$, we have $x\in B$. 2. For any $x\in B$, we have $x\in A$. 3. For some $x\in A$, we have $x\in B$. 4. For some $x\in B$, we have $x\in A$. ::: :::success **Exercise 4 (一對一)**: Let $f: \mathbb{R} \rightarrow \mathbb{R}$ be a function defined by $f(x) = x^3$. Show that $f$ is injective. 1. $x\neq y$ and $f(x)\neq f(y)$ 2. $x\neq y$, $f(x) \neq f(y)$ 3. We know $x \neq y$ implies $f(x) \neq f(y)$. 4. Suppose $x \neq y$. .... Then $f(x) \neq f(y)$. ::: :::success **Exercise 5 (映成)**: Let $f: \mathbb{R} \rightarrow \mathbb{R}$ be a function defined by $f(x) = x^3$. Show that $f$ is surjective. 1. Let $y\in\mathbb{R}$. ... We found some $x$ such that $f(x) = y$. 2. For some $x$ and $y$, we have $f(x) = y$. 3. For some $y\in\mathbb{R}$, we can find an $x$ such that $f(x) = y$. 4. We know that $f(x) = y$. ::: :::success **Exercise 6 (線性獨立)**: Let $\bv_1,\ldots,\bv_n$ be vectors. How to show "If $c_1\bv_1 + \ldots + c_n\bv_n = \bzero$ for some $c_1,\ldots, c_n\in\mathbb{R}$, then $c_1 = \cdots = c_n = 0$."? 1. Suppose $c_1\bv_1 + \ldots + c_n\bv_n = \bzero$ for some $c_1,\ldots, c_n\in\mathbb{R}$. ... Therefore, $c_1 = \cdots = c_n = 0$. 2. Let $c_1 = \cdots = c_n = 0$. ... 3. If $c_1 = \cdots = c_n = 0$, then $c_1\bv_1 + \ldots + c_n\bv_n = \bzero$. 4. $c_1\bv_1 + \ldots + c_n\bv_n = \bzero$, $c_1 = \cdots = c_n = 0$ ::: :::success **Exercise 7 (極限)**: How to show "For any $\epsilon > 0$, there is $\delta > 0$ such that XXX."? 1. Let $\epsilon = 0.00001$. We may find $\delta$ ... 2. $\epsilon > 0$, $\delta > 0$, XXX 3. Let $\epsilon > 0$. Suppose $\delta > 0$ ... 4. Let $\epsilon > 0$. We may find $\delta$ ... ::: ## 你在公 :shark: 小系列 :::danger :bulb: 寫證明不是在應付論文比對 $\bx = \bzero$ or $\by = \bzero$ is obvious. We know $\bx$ and $\by$ has length $1$. $\|\bx - \by\|^2 \geq 0$ $\bx^2 + \by^2 - 2\bx\by \geq 0$ $\implies \inp{\bx}{\by} \leq 1 = \|\bx\|\|\by\|$ ::: :::danger :bulb: 不要只有數學式 $\bx = \bzero$ $\by = \bzero$ Obvious. $\|\bx\| = \|\by\| = 1$ $\|\bx - \by\|^2 \geq 0$ $\inp{\bx - \by}{\bx - \by} \geq 0$ $\|\bx\|^2 + \|\by\|^2 - 2\inp{\bx}{\by} \geq 0$ $2 - 2\inp{\bx}{\by} \geq 0$ $\implies 2\inp{\bx}{\by} \leq 2$ $\implies \inp{\bx}{\by} \leq 1 = \|\bx\|\|\by\|$ ::: :::danger :bulb: 舉例 $\neq$ 證明 Let $\bx = (1,1,1,1)$ and $\by = (1,5,1,3)$. $\inp{\bx}{\by} = 1 + 5 + 1 + 3$ $\|\bx\|\|\by\| = 2\cdot 6$ so $\inp{\bx}{\by} \leq \|\bx\|\|\by\|$. ::: :::danger :bulb: 感受一下題目的重點 Suppose $\bx = (x_1, \ldots, x_n)$ and $\by = (y_1, \ldots, y_n)$. Then we would like to show $$ (x_1y_1 + \cdots + x_ny_n)^2 \leq (x_1^2 + \cdots + x_n^2)(y_1^2 + \cdots + y_n^2). $$ We know this inequality is true in high school, so $\inp{\bx}{\by} \leq \|\bx\|\|\by\|$. :::