id
stringlengths
17
29
nl_statement
stringlengths
43
377
nl_proof
stringlengths
0
3.81k
lean4_src_header
stringclasses
14 values
lean4_formalization
stringlengths
50
426
Ireland-Rosen|exercise_4_5
Consider a prime $p$ of the form $4 t+3$. Show that $a$ is a primitive root modulo $p$ iff $-a$ has order $(p-1) / 2$.
\begin{proof} Let $a$ a primitive root modulo $p$. As $a^{p-1} \equiv 1(\bmod p), p \mid\left(a^{(p-1) / 2}-1\right)\left(a^{(p-1) / 2}+1\right)$, so $p \mid a^{(p-1) / 2}-1$ or $p \mid$ $a^{(p-1) / 2}+1$. As $a$ is a primitive root modulo $p, a^{(p-1) / 2} \not \equiv 1(\bmod p)$, so $$ a^{(p-1) / 2} \equiv-1 \quad(\bmod p) . $$ Hence $(-a)^{(p-1) / 2}=(-1)^{2 t+1} a^{(p-1) / 2} \equiv(-1) \times(-1)=1(\bmod p)$. Suppose that $(-a)^n \equiv 1(\bmod p)$, with $n \in \mathbb{N}$. Then $a^{2 n}=(-a)^{2 n} \equiv 1(\bmod p)$, so $p-1\left|2 n, \frac{p-1}{2}\right| n$. So $-a$ has order $(p-1) / 2$ modulo $p$. Conversely, suppose that $-a$ has order $(p-1) / 2=2 t+1$ modulo $p$. Let $2, p_1, \ldots p_k$ the prime factors of $p-1$, where $p_i$ are odd. $a^{(p-1) / 2}=a^{2 t+1}=-(-a)^{2 t+1}=-(-a)^{(p-1) / 2} \equiv-1$, so $a^{(p-1) / 2} \not \equiv 1(\bmod 2)$. As $p-1$ is even, $(p-1) / p_i$ is even, so $a^{(p-1) / p_i}=(-a)^{(p-1) / p_i} \not \equiv 1(\bmod p)($ since $-a$ has order $p-1)$. So the order of $a$ is $p-1$ (see Ex. 4.8) : $a$ is a primitive root modulo $p$. \end{proof}
import Mathlib open Real open scoped BigOperators
theorem exercise_4_5 {p t : β„•} (hp0 : p.Prime) (hp1 : p = 4*t + 3) (a : ZMod p) : IsPrimitiveRoot a p ↔ ((-a) ^ ((p-1)/2) = 1 ∧ βˆ€ (k : β„•), (0 < k ∧ k < (p-1)/2) β†’ (-a)^k β‰  1) :=
Ireland-Rosen|exercise_4_8
Let $p$ be an odd prime. Show that $a$ is a primitive root modulo $p$ iff $a^{(p-1) / q} \not \equiv 1(p)$ for all prime divisors $q$ of $p-1$.
\begin{proof} $\bullet$ If $a$ is a primitive root, then $a^k \not \equiv 1$ for all $k, 1\leq k < p-1$, so $a^{(p-1)/q} \not \equiv 1 \pmod p$ for all prime divisors $q$ of $p - 1$. $\bullet$ In the other direction, suppose $a^{(p-1)/q} \not \equiv 1 \pmod p$ for all prime divisors $q$ of $p - 1$. Let $\delta$ the order of $a$, and $p-1 = q_1^{a_1}q_2^{a_2}\cdots q_k^{a_k}$ the decomposition of $p-1$ in prime factors. As $\delta \mid p-1, \delta = q_1^{b_1}p_2^{b_2}\cdots q_k^{b_k}$, with $b_i \leq a_i, i=1,2,\ldots,k$. If $b_i < a_i$ for some index $i$, then $\delta \mid (p-1)/q_i$, so $a^{(p-1)/q_i} \equiv 1 \pmod p$, which is in contradiction with the hypothesis. Thus $b_i = a_i$ for all $i$, and $\delta = q-1$ : $a$ is a primitive root modulo $p$. \end{proof}
import Mathlib open Real open scoped BigOperators
theorem exercise_4_8 {p : β„•} {a : ZMod p} (hp : Odd p) (hp' : p.Prime) : IsPrimitiveRoot a p ↔ (βˆ€ q : β„•, q ∣ (p-1) β†’ q.Prime β†’ Β¬ a^((p-1)/q) = 1) :=
Ireland-Rosen|exercise_5_13
Show that any prime divisor of $x^{4}-x^{2}+1$ is congruent to 1 modulo 12 .
\begin{proof} \newcommand{\legendre}[2]{\genfrac{(}{)}{}{}{#1}{#2}} $\bullet$ As $a^6 +1 = (a^2+1)(a^4-a^2+1)$, $p\mid a^4 - a^2+1$ implies $p \mid a^6 + 1$, so $\legendre{-1}{p} = 1$ and $p\equiv 1 \pmod 4$. $\bullet$ $p \mid 4a^4 - 4 a^2 +4 = (2a-1)^2 + 3$, so $\legendre{-3}{p} = 1$. As $-3 \equiv 1 \pmod 4$, $\legendre{-3}{p} = \legendre{p}{3}$, so $\legendre{p}{3} = 1$, thus $p \equiv 1 \pmod 3$. $4 \mid p-1$ and $3 \mid p-1$, thus $12 \mid p-1$ : $$p \equiv 1 \pmod {12}.$$ \end{proof}
import Mathlib open Real open scoped BigOperators
theorem exercise_5_13 {p x: β„€} (hp : Prime p) (hpx : p ∣ (x^4 - x^2 + 1)) : p ≑ 1 [ZMOD 12] :=
Ireland-Rosen|exercise_5_37
Show that if $a$ is negative then $p \equiv q(4 a)$ together with $p\not | a$ imply $(a / p)=(a / q)$.
\begin{proof} \newcommand{\legendre}[2]{\genfrac{(}{)}{}{}{#1}{#2}} Write $a = -A, A>0$. As $p \equiv q \pmod {4a}$, we know from Prop. 5.3.3. (b) that $(A/p) = (A/q)$. Moreover, \begin{align*} \legendre{a}{p}&= \legendre{-A}{p} = (-1)^{(p-1)/2} \legendre{A}{p}\\ \legendre{a}{q}&= \legendre{-A}{q} = (-1^{(q-1)/2} \legendre{A}{q} \end{align*} As $p \equiv q \pmod {4a}$, $ p = q + 4ak, k\in \mathbb{Z}$, so $$(-1)^{(p-1)/2} = (-1)^{(q+4ak-1)/2} = (-1)^{(q-1)/2},$$ so $(a/p) = (a/q)$. \end{proof}
import Mathlib open Real open scoped BigOperators
theorem exercise_5_37 {p q : β„•} [Fact (p.Prime)] [Fact (q.Prime)] {a : β„€} (ha : a < 0) (h0 : p ≑ q [ZMOD 4*a]) (h1 : Β¬ ((p : β„€) ∣ a)) : legendreSym p a = legendreSym q a :=
Ireland-Rosen|exercise_18_4
Show that 1729 is the smallest positive integer expressible as the sum of two different integral cubes in two ways.
\begin{proof} Let $n=a^3+b^3$, and suppose that $\operatorname{gcd}(a, b)=1$. If a prime $p \mid a^3+b^3$, then $$ \left(a b^{-1}\right)^3 \equiv_p-1 $$ Thus $3 \mid \frac{p-1}{2}$, that is, $p \equiv_6 1$. If we have $n=a^3+b^3=c^3+d^3$, then we can factor $n$ as $$ \begin{aligned} & n=(a+b)\left(a^2-a b+b^2\right) \\ & n=(c+d)\left(c^2-c d+d^2\right) \end{aligned} $$ Thus we need $n$ to have atleast 3 disctinct prime factors, and so the smallest taxicab number is on the form $$ n=(6 k+1)(12 k+1)(18 k+1) $$ \end{proof}
import Mathlib open Real open scoped BigOperators
theorem exercise_18_4 : 1729 = sInf (fun (n : β„•) => βˆƒ x y z w : β„€, x^3 + y^3 = n ∧ z^3 + w^3 = n ∧ x β‰  z ∧ x β‰  w ∧ y β‰  z ∧ y β‰  w) :=
Munkres|exercise_13_1
Let $X$ be a topological space; let $A$ be a subset of $X$. Suppose that for each $x \in A$ there is an open set $U$ containing $x$ such that $U \subset A$. Show that $A$ is open in $X$.
\begin{proof} Since, from the given hypothesis given any $x \in A$ there exists an open set containing $x$ say, $U_x$ such that $U_x \subset A$. Thus, we claim that $$ A=\bigcup_{x \in A} U_x $$ Observe that if we prove the above claim, then $A$ will be open, being a union of arbitrary open sets. Since, for each $x \in A, U_x \subset A \Longrightarrow \cup U_x \subset A$. For the converse, observe that given any $x \in A, x \in U_x$ and hence in the union. Thus we proved our claim, and hence $A$ is an open set. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_13_1 (X : Type*) [TopologicalSpace X] (A : Set X) (h1 : βˆ€ x ∈ A, βˆƒ U : Set X, x ∈ U ∧ IsOpen U ∧ U βŠ† A) : IsOpen A :=
Munkres|exercise_13_4a1
If $\mathcal{T}_\alpha$ is a family of topologies on $X$, show that $\bigcap \mathcal{T}_\alpha$ is a topology on $X$.
\begin{proof} Since $\emptyset$ and $X$ belong to $\mathcal{T}_\alpha$ for each $\alpha$, they belong to $\bigcap_\alpha \mathcal{T}_\alpha$. Let $\left\{V_\beta\right\}_\beta$ be a collection of open sets in $\bigcap_\alpha \mathcal{T}_\alpha$. For any fixed $\alpha$ we have $\cup_\beta V_\beta \in \mathcal{T}_\alpha$ since $\mathcal{T}_\alpha$ is a topology on $X$, so $\bigcup_\beta V_\beta \in \bigcap_\alpha \mathcal{T}_\alpha$. Similarly, if $U_1, \ldots, U_n$ are elements of $\bigcap_\alpha \mathcal{T}_\alpha$, then for each $\alpha$ we have $\bigcup_{i=1}^n U_i \in \mathcal{T}_\alpha$ and therefore $\bigcup_{i=1}^n U_i \in \bigcap_\alpha \mathcal{T}_\alpha$. It follows that $\bigcap_\alpha \mathcal{T}_\alpha$ is a topology on $X$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
def is_topology (X : Type*) (T : Set (Set X)) := univ ∈ T ∧ (βˆ€ s t, s ∈ T β†’ t ∈ T β†’ s ∩ t ∈ T) ∧ (βˆ€s, (βˆ€t ∈ s, t ∈ T) β†’ sUnion s ∈ T) theorem exercise_13_4a1 (X I : Type*) (T : I β†’ Set (Set X)) (h : βˆ€ i, is_topology X (T i)) : is_topology X (β‹‚ i : I, T i) :=
Munkres|exercise_13_4b1
Let $\mathcal{T}_\alpha$ be a family of topologies on $X$. Show that there is a unique smallest topology on $X$ containing all the collections $\mathcal{T}_\alpha$.
\begin{proof} (b) First we prove that there is a unique smallest topology on $X$ containing all the collections $\mathcal{T}_\alpha$. Uniqueness of such topology is clear. For each $\alpha$ let $\mathcal{B}_\alpha$ be a basis for $\mathcal{T}_\alpha$. Let $\mathcal{T}$ be the topology generated by the subbasis $\mathcal{S}=\bigcup_\alpha \mathcal{B}_\alpha$. Then the collection $\mathcal{B}$ of all finite intersections of elements of $\mathcal{S}$ is a basis for $\mathcal{T}$. Clearly $\mathcal{T}_\alpha \subset \mathcal{T}$ for all $\alpha$. We now prove that if $\mathcal{O}$ is a topology on $X$ such that $\mathcal{T}_\alpha \subset \mathcal{O}$ for all $\alpha$, then $\mathcal{T} \subset \mathcal{O}$. Given such $\mathcal{O}$, we have $\mathcal{B}_\alpha \subset \mathcal{O}$ for all $\alpha$, so $\mathcal{S} \subset \mathcal{O}$. Since $\mathcal{O}$ is a topology, it must contain all finite intersections of elements of $\mathcal{S}$, so $\mathcal{B} \subset \mathcal{O}$ and hence $\mathcal{T} \subset \mathcal{O}$. We conclude that the topology $\mathcal{T}$ generated by the subbasis $\mathcal{S}=\cup_\alpha \mathcal{B}_\alpha$ is the unique smallest topology on $X$ containing all the collections $\mathcal{T}_\alpha$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
def is_topology (X : Type*) (T : Set (Set X)) := univ ∈ T ∧ (βˆ€ s t, s ∈ T β†’ t ∈ T β†’ s ∩ t ∈ T) ∧ (βˆ€s, (βˆ€t ∈ s, t ∈ T) β†’ sUnion s ∈ T) theorem exercise_13_4b1 (X I : Type*) (T : I β†’ Set (Set X)) (h : βˆ€ i, is_topology X (T i)) : βˆƒ! T', is_topology X T' ∧ (βˆ€ i, T i βŠ† T') ∧ βˆ€ T'', is_topology X T'' β†’ (βˆ€ i, T i βŠ† T'') β†’ T' βŠ† T'' :=
Munkres|exercise_13_5a
Show that if $\mathcal{A}$ is a basis for a topology on $X$, then the topology generated by $\mathcal{A}$ equals the intersection of all topologies on $X$ that contain $\mathcal{A}$.
\begin{proof} Let $\mathcal{T}$ be the topology generated by $\mathcal{A}$ and let $\mathcal{O}$ be the intersection of all topologies on $X$ that contains $\mathcal{A}$. Clearly $\mathcal{O} \subset \mathcal{T}$ since $\mathcal{T}$ is a topology on $X$ that contain $\mathcal{A}$. Conversely, let $U \in \mathcal{T}$, so that $U$ is a union of elements of $\mathcal{A}$. Since each of this elements is also an element of $\mathcal{O}$, their union $U$ belongs to $\mathcal{O}$. Thus $\mathcal{T} \subset \mathcal{O}$ and the equality holds. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
def is_topology (X : Type*) (T : Set (Set X)) := univ ∈ T ∧ (βˆ€ s t, s ∈ T β†’ t ∈ T β†’ s ∩ t ∈ T) ∧ (βˆ€s, (βˆ€t ∈ s, t ∈ T) β†’ sUnion s ∈ T) theorem exercise_13_5a {X : Type*} [TopologicalSpace X] (A : Set (Set X)) (hA : IsTopologicalBasis A) : generateFrom A = generateFrom (sInter {T | is_topology X T ∧ A βŠ† T}) :=
Munkres|exercise_13_6
Show that the lower limit topology $\mathbb{R}_l$ and $K$-topology $\mathbb{R}_K$ are not comparable.
\begin{proof} Let $\mathcal{T}_{\ell}$ and $\mathcal{T}_K$ denote the topologies of $\mathbb{R}_{\ell}$ and $\mathbb{R}_K$ respectively. Given the basis element $[0,1)$ for $\mathcal{T}_{\ell}$, there is no basis element for $\mathcal{T}_K$ containing 0 and contained in $[0,1)$, so $\mathcal{T}_{\ell} \not \subset \mathcal{T}_K$. Similarly, given the basis element $(-1,1) \backslash K$ for $\mathcal{T}_K$, there is no basis element for $\mathcal{T}_{\ell}$ containing 0 contained in $(-1,1) \backslash K$, so $\mathcal{T}_K \not \subset \mathcal{T}_{\ell}$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
def lower_limit_topology (X : Type) [Preorder X] := generateFrom {S : Set X | βˆƒ a b, a < b ∧ S = Ico a b} def Rl := lower_limit_topology ℝ def K : Set ℝ := {r | βˆƒ n : β„•, r = 1 / n} def K_topology := generateFrom ({S : Set ℝ | βˆƒ a b, a < b ∧ S = Ioo a b} βˆͺ {S : Set ℝ | βˆƒ a b, a < b ∧ S = Ioo a b \ K}) theorem exercise_13_6 : Β¬ (βˆ€ U, Rl.IsOpen U β†’ K_topology.IsOpen U) ∧ Β¬ (βˆ€ U, K_topology.IsOpen U β†’ Rl.IsOpen U) :=
Munkres|exercise_13_8b
Show that the collection $\{(a,b) \mid a < b, a \text{ and } b \text{ rational}\}$ is a basis that generates a topology different from the lower limit topology on $\mathbb{R}$.
\begin{proof} (b) $\mathcal{C}$ is a basis for a topology on $\mathbb{R}$ since the union of its elements is $\mathbb{R}$ and the intersection of two elements of $\mathcal{C}$ is either empty or another element of $\mathcal{C}$. Now consider $[r, s)$ where $r$ is any irrational number and $s$ is any real number greater than $r$. Then $[r, s)$ is a basis element for the topology of $\mathbb{R}_{\ell}$, but $[r, s)$ is not a union of elements of $\mathcal{C}$. Indeed, suppose that $[r, s)=\cup_\alpha\left[a_\alpha, b_\alpha\right)$ for rationals $a_\alpha, b_\alpha$. Then $r \in\left[a_\alpha, b_\alpha\right)$ for some $\alpha$. Since $r$ is irrational we must have $a_\alpha<r$, but then $a_\alpha \notin[r, s)$, a contradiction. It follows that the topology generated by $\mathcal{C}$ is strictly coarser than the lower limit topology on $\mathbb{R}$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
def lower_limit_topology (X : Type) [Preorder X] := generateFrom {S : Set X | βˆƒ a b, a < b ∧ S = Ico a b} theorem exercise_13_8b (T : Set (Set ℝ)) (hT : T = {S : Set ℝ | βˆƒ a b : β„š, a < b ∧ S = Ioo ↑a ↑b}) : IsTopologicalBasis T ∧ generateFrom T β‰  lower_limit_topology ℝ :=
Munkres|exercise_16_4
A map $f: X \rightarrow Y$ is said to be an open map if for every open set $U$ of $X$, the set $f(U)$ is open in $Y$. Show that $\pi_{1}: X \times Y \rightarrow X$ and $\pi_{2}: X \times Y \rightarrow Y$ are open maps.
\begin{proof} Exercise 16.4. Let $U \times V$ be a (standard) basis element for $X \times Y$, so that $U$ is open in $X$ and $V$ is open in $Y$. Then $\pi_1(U \times V)=U$ is open in $X$ and $\pi_2(U \times V)=V$ is open in $Y$. Since arbitrary maps and unions satisfy $f\left(\bigcup_\alpha W_\alpha\right)=\bigcup_\alpha f\left(W_\alpha\right)$, it follows that $\pi_1$ and $\pi_2$ are open maps. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_16_4 {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] (π₁ : X Γ— Y β†’ X) (Ο€β‚‚ : X Γ— Y β†’ Y) (h₁ : π₁ = Prod.fst) (hβ‚‚ : Ο€β‚‚ = Prod.snd) : IsOpenMap π₁ ∧ IsOpenMap Ο€β‚‚ :=
Munkres|exercise_17_4
Show that if $U$ is open in $X$ and $A$ is closed in $X$, then $U-A$ is open in $X$, and $A-U$ is closed in $X$.
\begin{proof} Since $$ X \backslash(U \backslash A)=(X \backslash U) \cup A \text { and } \quad X \backslash(A \backslash U)=(X \backslash A) \cup U, $$ it follows that $X \backslash(U \backslash A)$ is closed in $X$ and $X \backslash(A \backslash U)$ is open in $X$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_17_4 {X : Type*} [TopologicalSpace X] (U A : Set X) (hU : IsOpen U) (hA : IsClosed A) : IsOpen (U \ A) ∧ IsClosed (A \ U) :=
Munkres|exercise_18_8b
Let $Y$ be an ordered set in the order topology. Let $f, g: X \rightarrow Y$ be continuous. Let $h: X \rightarrow Y$ be the function $h(x)=\min \{f(x), g(x)\}.$ Show that $h$ is continuous.
\begin{proof} Let $A=\{x \mid f(x) \leq g(x)\}$ and $B=\{x \mid g(x) \leq f(x)\}$. Then $A$ and $B$ are closed in $X$ by (a), $A \cap B=\{x \mid f(x)=g(x)\}$, and $X=A \cup B$. Since $f$ and $g$ are continuous, their restrictions $f^{\prime}: A \rightarrow Y$ and $g^{\prime}: B \rightarrow Y$ are continuous. It follows from the pasting lemma that $$ h: X \rightarrow Y, \quad h(x)=\min \{f(x), g(x)\}= \begin{cases}f^{\prime}(x) & \text { if } x \in A \\ g^{\prime}(x) & \text { if } x \in B\end{cases} $$ is continuous \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_18_8b {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [LinearOrder Y] [OrderTopology Y] {f g : X β†’ Y} (hf : Continuous f) (hg : Continuous g) : Continuous (Ξ» x => min (f x) (g x)) :=
Munkres|exercise_19_6a
Let $\mathbf{x}_1, \mathbf{x}_2, \ldots$ be a sequence of the points of the product space $\prod X_\alpha$. Show that this sequence converges to the point $\mathbf{x}$ if and only if the sequence $\pi_\alpha(\mathbf{x}_i)$ converges to $\pi_\alpha(\mathbf{x})$ for each $\alpha$.
\begin{proof} For each $n \in \mathbb{Z}_{+}$, we write $\mathbf{x}_n=\left(x_n^\alpha\right)_\alpha$, so that $\pi_\alpha\left(\mathbf{x}_n\right)=x_n^\alpha$ for each $\alpha$. First assume that the sequence $\mathbf{x}_1, \mathbf{x}_2, \ldots$ converges to $\mathbf{x}=\left(x_\alpha\right)_\alpha$ in the product space $\prod_\alpha X_\alpha$. Fix an index $\beta$ and let $U$ be a neighbourhood of $\pi_\beta(\mathbf{x})=x_\beta$. Let $V=\prod_\alpha U_\alpha$, where $U_\alpha=X_\alpha$ for each $\alpha \neq \beta$ and $U_\beta=U$. Then $V$ is a neighbourhood of $\mathbf{x}$, so there exists $N \in \mathbb{Z}_{+}$such that $\mathbf{x}_n \in V$ for all $n \geq N$. Therefore $\pi_\beta\left(\mathbf{x}_n\right)=x_n^\beta \in U$ for all $n \geq N$. Since $U$ was arbitrary, it follows that $\pi_\beta\left(\mathbf{x}_1\right), \pi_\beta\left(\mathbf{x}_2\right), \ldots$ converges to $\pi_\beta(\mathbf{x})$. Since $\beta$ was arbitrary, this holds for all indices $\alpha$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_19_6a {ΞΉ : Type*} {f : ΞΉ β†’ Type*} {x : β„• β†’ Ξ a, f a} (y : Ξ i, f i) [Ξ a, TopologicalSpace (f a)] : Tendsto x atTop (𝓝 y) ↔ βˆ€ i, Tendsto (Ξ» j => (x j) i) atTop (𝓝 (y i)) :=
Munkres|exercise_21_6a
Define $f_{n}:[0,1] \rightarrow \mathbb{R}$ by the equation $f_{n}(x)=x^{n}$. Show that the sequence $\left(f_{n}(x)\right)$ converges for each $x \in[0,1]$.
\begin{proof} If $0 \leq x<1$ is fixed, then $f_n(x) \rightarrow 0$ as $n \rightarrow \infty$. As $f_n(1)=1$ for all $n, f_n(1) \rightarrow 1$. Thus $\left(f_n\right)_n$ converges to $f:[0,1] \rightarrow \mathbb{R}$ given by $f(x)=0$ if $x=0$ and $f(1)=1$. The sequence \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_21_6a (f : β„• β†’ Icc 0 1 β†’ ℝ) (h : βˆ€ x n, f n x = ↑x ^ n) : βˆ€ x, βˆƒ y, Tendsto (Ξ» n => f n x) atTop (𝓝 y) :=
Munkres|exercise_21_8
Let $X$ be a topological space and let $Y$ be a metric space. Let $f_{n}: X \rightarrow Y$ be a sequence of continuous functions. Let $x_{n}$ be a sequence of points of $X$ converging to $x$. Show that if the sequence $\left(f_{n}\right)$ converges uniformly to $f$, then $\left(f_{n}\left(x_{n}\right)\right)$ converges to $f(x)$.
\begin{proof} Let $d$ be the metric on $Y$. Let $V$ be a neighbourhood of $f(x)$, and let $\varepsilon>0$ be such that $f(x) \in B_d(f(x), \varepsilon) \subset V$. Since $\left(f_n\right)_n$ converges uniformly to $f$, there exists $N_1 \in \mathbb{Z}_{+}$such that $d\left(f_n(x), f(x)\right)<\varepsilon / 2$ for all $x \in X$ and all $n \geq N_1$, so that $d\left(f_n\left(x_n\right), f\left(x_n\right)\right)<\varepsilon / 2$ for all $n \geq N_1$. Moreover, $f$ is continuous, so there exists $N_2 \in \mathbb{Z}_{+}$such that $d\left(f\left(x_n\right), f(x)\right)<\varepsilon / 2$ for all $n \geq N_2$. Thus, if $N>\max \left\{N_1, N_2\right\}$, then $$ d\left(f_n\left(x_n\right), f(x)\right) \leq d\left(f_n\left(x_n\right), f\left(x_n\right)\right)+d\left(f\left(x_n\right), f(x)\right)<\frac{\varepsilon}{2}+\frac{\varepsilon}{2}=\varepsilon $$ for all $n \geq N$, so $f_n\left(x_n\right) \in V$ for all $n \geq N$. It follows that $\left(f_n\left(x_n\right)\right)_n$ converges to $f(x)$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_21_8 {X : Type*} [TopologicalSpace X] {Y : Type*} [MetricSpace Y] {f : β„• β†’ X β†’ Y} {x : β„• β†’ X} (hf : βˆ€ n, Continuous (f n)) (xβ‚€ : X) (hx : Tendsto x atTop (𝓝 xβ‚€)) (fβ‚€ : X β†’ Y) (hh : TendstoUniformly f fβ‚€ atTop) : Tendsto (Ξ» n => f n (x n)) atTop (𝓝 (fβ‚€ xβ‚€)) :=
Munkres|exercise_22_2b
If $A \subset X$, a retraction of $X$ onto $A$ is a continuous map $r: X \rightarrow A$ such that $r(a)=a$ for each $a \in A$. Show that a retraction is a quotient map.
\begin{proof} The inclusion map $i: A \rightarrow X$ is continuous and $r \circ i=1_A$ is the identity. Thus $r$ is a quotient map by (a). \end{proof}
import Mathlib open Filter Set TopologicalSpace Topology
theorem exercise_22_2b {X : Type*} [TopologicalSpace X] {A : Set X} (r : X β†’ A) (hr : Continuous r) (h : βˆ€ x : A, r x = x) : QuotientMap r :=
Munkres|exercise_23_2
Let $\left\{A_{n}\right\}$ be a sequence of connected subspaces of $X$, such that $A_{n} \cap A_{n+1} \neq \varnothing$ for all $n$. Show that $\bigcup A_{n}$ is connected.
\begin{proof} Suppose that $\bigcup_n A_n=B \cup C$, where $B$ and $C$ are disjoint open subsets of $\bigcup_n A_n$. Since $A_1$ is connected and a subset of $B \cup C$, by Lemma $23.2$ it lies entirely within either $B$ or $C$. Without any loss of generality, we may assume $A_1 \subset B$. Note that given $n$, if $A_n \subset B$ then $A_{n+1} \subset B$, for if $A_{n+1} \subset C$ then $A_n \cap A_{n+1} \subset B \cap C=\emptyset$, in contradiction with the assumption. By induction, $A_n \subset B$ for all $n \in \mathbb{Z}_{+}$, so that $\bigcup_n A_n \subset B$. It follows that $\bigcup_n A_n$ is connected. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_23_2 {X : Type*} [TopologicalSpace X] {A : β„• β†’ Set X} (hA : βˆ€ n, IsConnected (A n)) (hAn : βˆ€ n, A n ∩ A (n + 1) β‰  βˆ…) : IsConnected (⋃ n, A n) :=
Munkres|exercise_23_4
Show that if $X$ is an infinite set, it is connected in the finite complement topology.
\begin{proof} Suppose that $A$ is a non-empty subset of $X$ that is both open and closed, i.e., $A$ and $X \backslash A$ are finite or all of $X$. Since $A$ is non-empty, $X \backslash A$ is finite. Thus $A$ cannot be finite as $X \backslash A$ is infinite, so $A$ is all of $X$. Therefore $X$ is connected. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology set_option checkBinderAnnotations false
theorem exercise_23_4 {X : Type*} [TopologicalSpace X] [CofiniteTopology X] (s : Set X) : Infinite s β†’ IsConnected s :=
Munkres|exercise_23_9
Let $A$ be a proper subset of $X$, and let $B$ be a proper subset of $Y$. If $X$ and $Y$ are connected, show that $(X \times Y)-(A \times B)$ is connected.
\begin{proof} This is similar to the proof of Theorem 23.6. Take $c \times d \in(X \backslash A) \times(Y \backslash B)$. For each $x \in X \backslash A$, the set $$ U_x=(X \times\{d\}) \cup(\{x\} \times Y) $$ is connected since $X \times\{d\}$ and $\{x\} \times Y$ are connected and have the common point $x \times d$. Then $U=\bigcup_{x \in X \backslash A} U_x$ is connected because it is the union of the connected spaces $U_x$ which have the point $c \times d$ in common. Similarly, for each $y \in Y \backslash B$ the set $$ V_y=(X \times\{y\}) \cup(\{c\} \times Y) $$ is connected, so $V=\bigcup_{y \in Y \backslash B} V_y$ is connected. Thus $(X \times Y) \backslash(A \times B)=U \cup V$ is connected since $c \times d$ is a common point of $U$ and $V$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_23_9 {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] (A₁ Aβ‚‚ : Set X) (B₁ Bβ‚‚ : Set Y) (hA : A₁ βŠ‚ Aβ‚‚) (hB : B₁ βŠ‚ Bβ‚‚) (hA : IsConnected Aβ‚‚) (hB : IsConnected Bβ‚‚) : IsConnected ({x | βˆƒ a b, x = (a, b) ∧ a ∈ Aβ‚‚ ∧ b ∈ Bβ‚‚} \ {x | βˆƒ a b, x = (a, b) ∧ a ∈ A₁ ∧ b ∈ B₁}) :=
Munkres|exercise_24_2
Let $f: S^{1} \rightarrow \mathbb{R}$ be a continuous map. Show there exists a point $x$ of $S^{1}$ such that $f(x)=f(-x)$.
\begin{proof} Let $f: S^1 \rightarrow \mathbb{R}$ be continuous. Let $x \in S^1$. If $f(x)=f(-x)$ we are done, so assume $f(x) \neq f(-x)$. Define $g: S^1 \rightarrow \mathbb{R}$ by setting $g(x)=f(x)-f(-x)$. Then $g$ is continuous. Suppose $f(x)>f(-x)$, so that $g(x)>0$. Then $-x \in S^1$ and $g(-x)<0$. By the intermediate value theorem, since $S^1$ is connected and $g(-x)<0<g(x)$, there exists $y \in S^1$ such that $g(y)=0$. i.e, $f(y)=f(-y)$. Similarly, if $f(x)<f(-x)$, then $g(x)<0<g(-x)$ and again the intermediate value theorem gives the result. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_24_2 {f : (Metric.sphere 0 1 : Set ℝ) β†’ ℝ} (hf : Continuous f) : βˆƒ x, f x = f (-x) :=
Munkres|exercise_25_4
Let $X$ be locally path connected. Show that every connected open set in $X$ is path connected.
\begin{proof} Let $U$ be a open connected set in $X$. By Theorem 25.4, each path component of $U$ is open in $X$, hence open in $U$. Thus, each path component in $U$ is both open and closed in $U$, so must be empty or all of $U$. It follows that $U$ is path-connected. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_25_4 {X : Type*} [TopologicalSpace X] [LocPathConnectedSpace X] (U : Set X) (hU : IsOpen U) (hcU : IsConnected U) : IsPathConnected U :=
Munkres|exercise_26_11
Let $X$ be a compact Hausdorff space. Let $\mathcal{A}$ be a collection of closed connected subsets of $X$ that is simply ordered by proper inclusion. Then $Y=\bigcap_{A \in \mathcal{A}} A$ is connected.
\begin{proof} Since each $A \in \mathcal{A}$ is closed, $Y$ is closed. Suppose that $C$ and $D$ form a separation of $Y$. Then $C$ and $D$ are closed in $Y$, hence closed in $X$. Since $X$ is compact, $C$ and $D$ are compact by Theorem 26.2. Since $X$ is Hausdorff, by Exercise 26.5, there exist $U$ and $V$ open in $X$ and disjoint containing $C$ and $D$, respectively. We show that $$ \bigcap_{A \in \mathcal{A}}(A \backslash(U \cup V)) $$ is not empty. Let $\left\{A_1, \ldots, A_n\right\}$ be a finite subcollection of elements of $\mathcal{A}$. We may assume that $A_i \subsetneq A_{i+1}$ for all $i=1, \ldots, n-1$. Then $$ \bigcap_{i=1}^n\left(A_i \backslash(U \cup V)\right)=A_1 \backslash(U \cup V) \text {. } $$ Suppose that $A_1 \backslash(U \cup V)=\emptyset$. Then $A_1 \subset U \cup V$. Since $A_1$ is connected and $U \cap V=\emptyset, A_1$ lies within either $U$ or $V$, say $A_1 \subset U$. Then $Y \subset A_1 \subset U$, so that $C=Y \cap C \subset Y \cap V=\emptyset$, contradicting the fact that $C$ and $D$ form a separation of $Y$. Hence, $\bigcap_{i=1}^n\left(A_i \backslash(U \cup V)\right)$ is non-empty. Therefore, the collection $\{A \backslash(U \cup V) \mid A \in \mathcal{A}\}$ has the finite intersection property, so $$ \bigcap_{A \in \mathcal{A}}(A \backslash(U \cup V))=\left(\bigcap_{A \in \mathcal{A}} A\right) \backslash(U \cup V)=Y \backslash(U \cup V) $$ is non-empty. So there exists $y \in Y$ such that $y \notin U \cup V \supset C \cup D$, contradicting the fact that $C$ and $D$ form a separation of $Y$. We conclude that there is no such separation, so that $Y$ is connected. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_26_11 {X : Type*} [TopologicalSpace X] [CompactSpace X] [T2Space X] (A : Set (Set X)) (hA : βˆ€ (a b : Set X), a ∈ A β†’ b ∈ A β†’ a βŠ† b ∨ b βŠ† a) (hA' : βˆ€ a ∈ A, IsClosed a) (hA'' : βˆ€ a ∈ A, IsConnected a) : IsConnected (β‹‚β‚€ A) :=
Munkres|exercise_27_4
Show that a connected metric space having more than one point is uncountable.
\begin{proof} The distance function $d: X \times X \rightarrow \mathbb{R}$ is continuous by Exercise 20.3(a), so given $x \in X$, the function $d_x: X \rightarrow \mathbb{R}$ given by $d_x(y)=d(x, y)$ is continuous by Exercise 19.11. Since $X$ is connected, the image $d_x(X)$ is a connected subspace of $\mathbb{R}$, and contains 0 since $d_x(x)=0$. Thus, if $y \in X$ and $y \neq x$, then $d_x(X)$ contains the set $[0, \delta]$, where $\delta=d_x(y)>0$. Therefore $X$ must be uncountable. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_27_4 {X : Type*} [MetricSpace X] [ConnectedSpace X] (hX : βˆƒ x y : X, x β‰  y) : Β¬ Countable (univ : Set X) :=
Munkres|exercise_28_5
Show that X is countably compact if and only if every nested sequence $C_1 \supset C_2 \supset \cdots$ of closed nonempty sets of X has a nonempty intersection.
\begin{proof} We could imitate the proof of Theorem 26.9, but we prove directly each direction. First let $X$ be countable compact and let $C_1 \supset C_2 \supset \cdots$ be a nested sequence of closed nonempty sets of $X$. For each $n \in \mathbb{Z}_{+}, U_n=X \backslash C_n$ is open in $X$. Then $\left\{U_n\right\}_{n \in \mathbb{Z}_{+}}$is a countable collection of open sets with no finite subcollection covering $X$, for if $U_{i_1} \cup \cdots \cup U_{1_n}$ covers $X$, then $C_{i_1} \cap \cdots \cap C_{i_n}$ is empty, contrary to the assumption. Hence $\left\{U_n\right\}_{n \in \mathbb{Z}_{+}}$does not cover $X$, so there exist $x \in X \backslash \bigcup_{n \in \mathbb{Z}_{+}} U_n=\bigcap_{n \in Z_{+}}\left(X \backslash U_n\right)=\bigcap_{n \in Z_{+}} C_n$. Conversely, assume that every nested sequence $C_1 \supset C_2 \supset \cdots$ of closed non-empty sets of $X$ has a non-empty intersection and let $\left\{U_n\right\}_{n \in \mathbb{Z}_{+}}$be a countable open covering of $X$. For each $n$, let $V_n=U_1 \cup \cdots \cup U_n$ and $C_n=X \backslash V_n$. Suppose that no finite subcollection of $\left\{U_n\right\}_{n \in \mathbb{Z}_{+}}$covers $X$. Then each $C_n$ is non-empty, so $C_1 \supset C_2 \supset \cdots$ is a nested sequence of non-empty closed sets and $\bigcap_{n \in \mathbb{Z}_{+}} C_n$ is non-empty by assumption. Then there exists $x \in \bigcap_{n \in \mathbb{Z}_{+}} C_n$, so that $x \notin V_n$ for all $n$, contradicting the fact that $\left\{U_n\right\}_{n \in \mathbb{Z}_{+}}$covers $X$. It follows that there exists $N \in \mathbb{Z}_{+}$such that $C_N=\emptyset$, so that $X=V_N$ and hence some finite subcollection of $\left\{U_n\right\}_{n \in \mathbb{Z}_{+}}$covers $X$. We deduce that $X$ is countable compact. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
def countably_compact (X : Type*) [TopologicalSpace X] := βˆ€ U : β„• β†’ Set X, (βˆ€ i, IsOpen (U i)) ∧ ((univ : Set X) βŠ† ⋃ i, U i) β†’ (βˆƒ t : Finset β„•, (univ : Set X) βŠ† ⋃ i ∈ t, U i) theorem exercise_28_5 (X : Type*) [TopologicalSpace X] : countably_compact X ↔ βˆ€ (C : β„• β†’ Set X), (βˆ€ n, IsClosed (C n)) ∧ (βˆ€ n, C n β‰  βˆ…) ∧ (βˆ€ n, C (n + 1) βŠ† C n) β†’ βˆƒ x, βˆ€ n, x ∈ C n :=
Munkres|exercise_29_1
Show that the rationals $\mathbb{Q}$ are not locally compact.
\begin{proof} First, we prove that each set $\mathbb{Q} \cap[a, b]$, where $a, b$ are irrational numbers, is not compact. Indeed, since $\mathbb{Q} \cap[a, b]$ is countable, we can write $\mathbb{Q} \cap[a, b]=\left\{q_1, q_2, \ldots\right\}$. Then $\left\{U_i\right\}_{i \in \mathbb{Z}_{+}}$, where $U_i=\mathbb{Q} \cap\left[a, q_i\right)$ for each $i$, is an open covering of $\mathbb{Q} \cap[a, b]$ with no finite subcovering. Now let $x \in \mathbb{Q}$ and suppose that $\mathbb{Q}$ is locally compact at $x$. Then there exists a compact set $C$ containing a neighbourhood $U$ of $x$. Then $U$ contains a set $\mathbb{Q} \cap[a, b]$ where $a, b$ are irrational numbers. Since this set is closed and contained in the compact $C$, it follows $\mathbb{Q} \cap[a, b]$ is compact, a contradiction. Therefore, $\mathbb{Q}$ is not locally compact. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_29_1 : Β¬ LocallyCompactSpace β„š :=
Munkres|exercise_29_10
Show that if $X$ is a Hausdorff space that is locally compact at the point $x$, then for each neighborhood $U$ of $x$, there is a neighborhood $V$ of $x$ such that $\bar{V}$ is compact and $\bar{V} \subset U$.
\begin{proof} Let $U$ be a neighbourhood of $x$. Since $X$ is locally compact at $x$, there exists a compact subspace $C$ of $X$ containing a neighbourhood $W$ of $x$. Then $U \cap W$ is open in $X$, hence in $C$. Thus, $C \backslash(U \cap W)$ is closed in $C$, hence compact. Since $X$ is Hausdorff, there exist disjoint open sets $V_1$ and $V_2$ of $X$ containing $x$ and $C \backslash(U \cap W)$ respectively. Let $V=V_1 \cap U \cap W$. Since $\bar{V}$ is closed in $C$, it is compact. Furthermore, $\bar{V}$ is disjoint from $C \backslash(U \cap W) \supset C \backslash U$, so $\bar{V} \subset U$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_29_10 {X : Type*} [TopologicalSpace X] [T2Space X] (x : X) (hx : βˆƒ U : Set X, x ∈ U ∧ IsOpen U ∧ (βˆƒ K : Set X, U βŠ† K ∧ IsCompact K)) (U : Set X) (hU : IsOpen U) (hxU : x ∈ U) : βˆƒ (V : Set X), IsOpen V ∧ x ∈ V ∧ IsCompact (closure V) ∧ closure V βŠ† U :=
Munkres|exercise_30_13
Show that if $X$ has a countable dense subset, every collection of disjoint open sets in $X$ is countable.
\begin{proof} Let $\mathcal{U}$ be a collection of disjoint open sets in $X$ and let $A$ be a countable dense subset of $X$. Since $A$ is dense in $X$, every $U \in \mathcal{U}$ intesects $S$. Therefore, there exists a point $x_U \in U \cap S$. Let $U_1, U_2 \in \mathcal{U}, U_1 \neq U_2$. Then $x_{U_1} \neq x_{U_2}$ since $U_1 \cap U_2=\emptyset$. Thus, the function $\mathcal{U} \rightarrow S$ given by $U \mapsto x_U$ is injective and therefore, since $S$ is countable, it follows that $\mathcal{U}$ is countable. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_30_13 {X : Type*} [TopologicalSpace X] (h : βˆƒ (s : Set X), Countable s ∧ Dense s) (U : Set (Set X)) (hU : βˆ€ (x y : Set X), x ∈ U β†’ y ∈ U β†’ x β‰  y β†’ x ∩ y = βˆ…) (hUopen : βˆ€ (u : Set X), u ∈ U β†’ IsOpen u) : Countable U :=
Munkres|exercise_31_2
Show that if $X$ is normal, every pair of disjoint closed sets have neighborhoods whose closures are disjoint.
\begin{proof} Let $A$ and $B$ be disjoint closed sets. Then there exist disjoint open sets $U$ and $V$ containing $A$ and $B$ respectively. Since $X \backslash V$ is closed and contains $U$, the closure of $U$ is contained in $X \backslash V$ hence $B$ and closure of $U$ are disjoint. Repeat steps 1 and 2 for $B$ and $\bar{U}$ instead of $A$ and $B$ respectively and you will have open set $V^{\prime}$ which contains $B$ and its closure doesn't intersect with $\bar{U}$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_31_2 {X : Type*} [TopologicalSpace X] [NormalSpace X] {A B : Set X} (hA : IsClosed A) (hB : IsClosed B) (hAB : Disjoint A B) : βˆƒ (U V : Set X), IsOpen U ∧ IsOpen V ∧ A βŠ† U ∧ B βŠ† V ∧ closure U ∩ closure V = βˆ… :=
Munkres|exercise_32_1
Show that a closed subspace of a normal space is normal.
\begin{proof} Let $X$ be a normal space and $Y$ a closed subspace of $X$. First we shows that $Y$ is a $T_1$-space. Let $y \in Y$ be any point. Since $X$ is normal, $X$ is also a $T_1$ space and therefore $\{y\}$ is closed in $X$. Then it follows that $\{y\}=\{y\} \cap Y$ is closed in $Y$ (in relative topology). Now let's prove that $X$ is a $T_4$-space. Let $F, G \subseteq Y$ be disjoint closed sets. Since $F$ and $G$ are closed in $Y$ and $Y$ is closed in $X$, it follows that $F$ and $G$ are closed in $X$. Since $X$ is normal, $X$ is also a $T_4$-space and therefore there exist disjoint open sets $U, V \subseteq$ $X$ such that $F \subseteq U$ and $G \subseteq V$. However, then $U \cap Y$ and $V \cap Y$ are open disjoint sets in $Y$ (in relative topology) which separate $F$ and $G$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_32_1 {X : Type*} [TopologicalSpace X] (hX : NormalSpace X) (A : Set X) (hA : IsClosed A) : NormalSpace {x // x ∈ A} :=
Munkres|exercise_32_2b
Show that if $\prod X_\alpha$ is regular, then so is $X_\alpha$. Assume that each $X_\alpha$ is nonempty.
\begin{proof} Suppose that $X=\prod_\beta X_\beta$ is regular and let $\alpha$ be any index. We have to prove that $X_\alpha$ satisfies the $T_1$ and the $T_3$ axiom. Since $X$ is regular, it follows that $X$ is Hausdorff, which then implies that $X_\alpha$ is Hausdorff. However, this implies that $X_\alpha$ satisfies the $T_1$ axiom. Let now $F \subseteq X_\alpha$ be a closed set and $x \in X_\alpha \backslash F$ a point. Then $\prod_\beta F_\beta$, where $F_\alpha=F$ and $F_\beta=X_\beta$ for $\beta \neq \alpha$, is a closed set in $X$ since $\left(\prod_\beta F_\beta\right)^c=\prod_\beta U_\beta$, where $U_\alpha=F^c$ and $U_\beta=X_\beta$ for $\beta \neq \alpha$, which is an open set because it is a base element for the product topology. Since all $X_\beta$ are nonempty, there exists a point $\mathbf{x} \in X$ such that $x_\alpha=x$. Then $\mathbf{x} \notin \prod_\beta F_\beta$. Now since $X$ is regular (and therefore satisfies the $T_3$ axiom), there exist disjoint open sets $U, V \subseteq X$ such that $\mathbf{x} \in U$ and $\prod_\beta F_\beta \subseteq V$. Now for every $\beta \neq \alpha$ we have that $x_\beta \in X_\beta=\pi_\beta(V)$. However, since $x_\beta \in \pi_\beta(U)$, it follows that $\pi_\beta(U) \cap \pi_\beta(V) \neq \emptyset$. Then $U \cap V=\emptyset$ implies that $\pi_\alpha(U) \cap \pi_\alpha(V)=\emptyset$.. Also, $x \in \pi_\alpha(U)$ and $F \subseteq \pi_\alpha(V)$ and $\pi_\alpha(U), \pi_\alpha(V)$ are open sets since $\pi_\alpha$ is an open map. Therefore, $X_\alpha$ satisfies the $T_3$ axiom. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_32_2b {ΞΉ : Type*} {X : ΞΉ β†’ Type*} [βˆ€ i, TopologicalSpace (X i)] (h : βˆ€ i, Nonempty (X i)) (h2 : RegularSpace (Ξ  i, X i)) : βˆ€ i, RegularSpace (X i) :=
Munkres|exercise_32_3
Show that every locally compact Hausdorff space is regular.
\begin{proof} Let $X$ be a LCH space. Then it follows that for every $x \in X$ and for every open neighborhood $U \subseteq X$ of $x$ there exists an open neighborhood $V \subseteq X$ of $x$ such that $\bar{V} \subseteq U$ (and $\bar{V}$ is compact, but this is not important here). Since $X$ is a Hausdorff space, it satisfies the $T_1$ axiom. Then it follows that $X$ is regular. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_32_3 {X : Type*} [TopologicalSpace X] (hX : LocallyCompactSpace X) (hX' : T2Space X) : RegularSpace X :=
Munkres|exercise_33_8
Let $X$ be completely regular, let $A$ and $B$ be disjoint closed subsets of $X$. Show that if $A$ is compact, there is a continuous function $f \colon X \rightarrow [0, 1]$ such that $f(A) = \{0\}$ and $f(B) = \{1\}$.
\begin{proof} Since $X$ is completely regular $\forall a \in A, \exists f_a: X \rightarrow[0,1]: f_a(a)=0$ and $f_a(B)=\{1\}$. For some $\epsilon_a \in(0,1)$ we have that $U_a:=f_a^{-1}([0, \epsilon))$ is an open neighborhood of $a$ that does not intersect $B$. We therefore have an open covering $\left\{U_a \mid a \in A\right\}$ of $A$, so since $A$ is compact we have a finite subcover $\left\{U_{a_i} \mid 1 \leq i \leq m\right\}$. For each $1 \leq i \leq m$ define $$ \begin{aligned} \tilde{f}_{a_i}: X & \rightarrow[0,1] \\ x & \mapsto \frac{\max \left(f_{a_i}(x), \epsilon_{a_i}\right)-\epsilon_{a_i}}{1-\epsilon_{a_i}} \end{aligned} $$ so that $\forall x \in U_{a_i}: \tilde{f}_{a_i}(x)=0$ and $\forall x \in B, \forall 1 \leq i \leq m: \tilde{f}_{a_i}(x)=1$, and define $f:=$ $\prod_{i=1}^m \tilde{f}_{a_i}$. Then since $A \subset \cup_{i=1}^m U_{a_i}$ we have that $f(A)=\{0\}$ and also we have $f(B)=\{1\}$. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_33_8 (X : Type*) [TopologicalSpace X] [CompletelyRegularSpace X] (A B : Set X) (hA : IsClosed A) (hB : IsClosed B) (hAB : Disjoint A B) (hAc : IsCompact A) : βˆƒ (f : X β†’ Icc 0 1), Continuous f ∧ f '' A = {0} ∧ f '' B = {1} :=
Munkres|exercise_38_6
Let $X$ be completely regular. Show that $X$ is connected if and only if the Stone-Čech compactification of $X$ is connected.
\begin{proof} The closure of a connected set is connected, so if $X$ is connected so is $\beta(X)$ Suppose $X$ is the union of disjoint open subsets $U, V \subset X$. Define the continuous map $$ \begin{aligned} & f: X \rightarrow\{0,1\} \\ & x \mapsto \begin{cases}0, & x \in U \\ 1, & x \in V\end{cases} \end{aligned} $$ By the fact that $\{0,1\}$ is compact and Hausdorff we can extend $f$ to a surjective map $\bar{f}: \beta(X) \rightarrow\{0,1\}$ such that $\bar{f}^{-1}(\{0\})$ and $\bar{f}^{-1}(\{1\})$ are disjoint open sets that cover $\beta(X)$, which makes this space not-connected. \end{proof}
import Mathlib open Filter Set TopologicalSpace open scoped Topology
theorem exercise_38_6 {X : Type*} [TopologicalSpace X] [CompletelyRegularSpace X] : IsConnected (univ : Set X) ↔ IsConnected (univ : Set (StoneCech X)) :=
Pugh|exercise_2_12a
Let $(p_n)$ be a sequence and $f:\mathbb{N}\to\mathbb{N}$. The sequence $(q_k)_{k\in\mathbb{N}}$ with $q_k=p_{f(k)}$ is called a rearrangement of $(p_n)$. Show that if $f$ is an injection, the limit of a sequence is unaffected by rearrangement.
\begin{proof} Let $\varepsilon>0$. Since $p_n \rightarrow L$, we have that, for all $n$ except $n \leq N$, $d\left(p_n, L\right)<\epsilon$. Let $S=\{n \mid f(n) \leq N\}$, let $n_0$ be the largest $n \in S$, we know there is such a largest $n$ because $f(n)$ is injective. Now we have that $\forall n>n_0 f(n)>N$ which implies that $p_{f(n)} \rightarrow L$, as required. \end{proof}
import Mathlib open Filter Real Function open scoped Topology
theorem exercise_2_12a {Ξ± : Type*} [TopologicalSpace Ξ±] (f : β„• β†’ β„•) (p : β„• β†’ Ξ±) (a : Ξ±) (hf : Injective f) (hp : Tendsto p atTop (𝓝 a)) : Tendsto (Ξ» n => p (f n)) atTop (𝓝 a) :=
Pugh|exercise_2_29
Let $\mathcal{T}$ be the collection of open subsets of a metric space $\mathrm{M}$, and $\mathcal{K}$ the collection of closed subsets. Show that there is a bijection from $\mathcal{T}$ onto $\mathcal{K}$.
\begin{proof} The bijection given by $x\mapsto X^C$ suffices. \end{proof}
import Mathlib open Filter Real Function open scoped Topology
theorem exercise_2_29 (M : Type*) [MetricSpace M] (O C : Set (Set M)) (hO : O = {s | IsOpen s}) (hC : C = {s | IsClosed s}) : βˆƒ f : O β†’ C, Bijective f :=
Pugh|exercise_2_41
Let $\|\cdot\|$ be any norm on $\mathbb{R}^{m}$ and let $B=\left\{x \in \mathbb{R}^{m}:\|x\| \leq 1\right\}$. Prove that $B$ is compact.
\begin{proof} Let us call $\|\cdot\|_E$ the Euclidean norm in $\mathbb{R}^m$. We start by claiming that there exist constants $C_1, C_2>0$ such that $$ C_1\|x\|_E \leq\|x\| \leq C_2\|x\|_E, \forall x \in \mathbb{R}^m . $$ Assuming (1) to be true, let us finish the problem. First let us show that $B$ is bounded w.r.t. $d_E$, which is how we call the Euclidean distance in $\mathbb{R}^m$. Indeed, given $x \in B,\|x\|_E \leq \frac{1}{C_1}\|x\| \leq \frac{1}{C_1}$. Hence $B \subset\left\{x \in \mathbb{R}^m: d_E(x, 0)<\frac{1}{C_1}+1\right\}$, which means $B$ is bounded w.r.t $d_E$. Now let us show that $B$ is closed w.r.t. $d_E$. Let $x_n \rightarrow x$ w.r.t. $d_E$, where $x_n \in B$. Notice that this implies that $x_n \rightarrow x$ w.r.t. $d(x, y)=\|x-y\|$, the distance coming from $\|\cdot\|$, since by (1) we have $$ d\left(x_n, x\right)=\left\|x_n-x\right\| \leq C_2\left\|x_n-x\right\|_E \rightarrow 0 . $$ Also, notice that $$ \|x\| \leq\left\|x_n-x\right\|+\left\|x_n\right\| \leq\left\|x_n-x\right\|+1, $$ hence passing to the limit we obtain that $\|x\| \leq 1$, therefore $x \in B$ and so $B$ is closed w.r.t. $d_E$. Since $B$ is closed and bounded w.r.t. $d_E$, it must be compact. Now we claim that the identity function, $i d:\left(\mathbb{R}^m, d_E\right) \rightarrow\left(\mathbb{R}^m, d\right)$ where $\left(\mathbb{R}^m, d_E\right)$ means we are using the distance $d_E$ in $\mathbb{R}^m$ and $\left(\mathbb{R}^m, d\right)$ means we are using the distance $d$ in $\mathbb{R}^m$, is a homeomorphism. This follows by (1), since $i d$ is always a bijection, and it is continuous and its inverse is continuous by (1) (if $x_n \rightarrow x$ w.r.t. $d_E$, then $x_n \rightarrow x$ w.r.t. $d$ and vice-versa, by (1)). By a result we saw in class, since $B$ is compact in $\left(\mathbb{R}^m, d_E\right)$ and $i d$ is a homeomorphism, then $i d(B)=B$ is compact w.r.t. $d$. We are left with proving (1). Notice that it suffices to prove that $C_1 \leq\|x\| \leq$ $C_2, \forall x \in \mathbb{R}^m$ with $\|x\|_E=1$. Indeed, if this is true, given $x \in \mathbb{R}^m$, either $\|x\|_E=0$ (which implies $x=0$ and (1) holds in this case), or $x /\|x\|_E=y$ is such that $\|y\|_E=1$, so $C_1 \leq\|y\| \leq C_2$, which implies $C_1\|x\|_E \leq\|x\| \leq C_2\|x\|_E$. We want to show now that $\|\cdot\|$ is continuous w.r.t. $d_E$, that is, given $\varepsilon>0$ and $x \in \mathbb{R}^m$, there exists $\delta>0$ such that if $d_E(x, y)<\delta$, then $\|\mid x\|-\|y\| \|<\varepsilon$. By the triangle inequality, $\|x\|-\|y\| \leq\|x-y\|$, and $\|y\|-\|x\| \leq\|x-y\|$, therefore $$ |\|x||-\| y|\|\leq\| x-y \| . $$ Writing now $x=\sum_{i=1}^m a_i e_i, y=\sum_{i=1}^m b_i e_i$, where $e_i=(0, \ldots, 1,0, \ldots, 0)$ (with 1 in the i-th component), we obtain by the triangle inequality, $$ \begin{aligned} \|x-y\| & =\left\|\sum_{i=1}^m\left(a_i-b_i\right) e_i\right\| \leq \sum_{i=1}^m\left|a_i-b_i\left\|\left|\left\|e_i\right\| \leq \max _{i=1, \ldots, m}\left\|e_i\right\| \sum_{i=1}^m\right| a_i-b_i \mid\right.\right. \\ & =\max _{i=1, \ldots, m}\left\|e_i\right\| d_{s u m}(x, y) \leq \max _{i=1, \ldots, m}\left\|e_i\right\| m d_{\max }(x, y) \\ & \leq \max _{i=1, \ldots, m}\left\|e_i\right\| m d_E(x, y) . \end{aligned} $$ Let $\delta=\frac{\varepsilon}{m \max _{i=1, \ldots, m}\left\|e_i\right\|}$. Then if $d_E(x, y)<\delta,\|x\|-\|y\|||<\varepsilon$. Since $\|\cdot\|$ is continuous w.r.t. $d_E$ and $K=\left\{x \in \mathbb{R}^m:\|x\|_E=1\right\}$ is compact w.r.t. $d_E$, then the function $\|\cdot\|$ achieves a maximum and a minimum value on $K$. Call $C_1=\min _{x \in K}\|x\|, C_2=\max _{x \in K}\|x\|$. Then $$ C_1 \leq\|x\| \leq C_2, \forall x \in \mathbb{R}^m \text { such that }\|x\|_E=1, $$ which is what we needed. \end{proof}
import Mathlib open Filter Real Function open scoped Topology
theorem exercise_2_41 (m : β„•) [NormedSpace ℝ ((Fin m) β†’ ℝ)] : IsCompact (Metric.closedBall (0 : EuclideanSpace ℝ (Fin m)) 1) :=
Pugh|exercise_2_57
Show that if $S$ is connected, it is not true in general that its interior is connected.
\begin{proof} Consider $X=\mathbb{R}^2$ and $$ A=([-2,0] \times[-2,0]) \cup([0,2] \times[0,2]) $$ which is connected, while $\operatorname{int}(A)$ is not connected. To see this consider the continuous function $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ is defined by $f(x, y)=x+y$. Let $U=f^{-1}(0,+\infty)$ which is open in $\mathbb{R}^2$ and so $U \cap \operatorname{int}(A)$ is open in $\operatorname{int}(A)$. Also, since $(0,0) \notin \operatorname{int}(A)$, so for all $(x, y) \in \operatorname{int}(A), f(x, y) \neq 0$ and $U \cap \operatorname{int}(A)=f^{-1}[0,+\infty) \cap \operatorname{int}(A)$ is closed in $\operatorname{int}(A)$. Furthermore, $(1,1)=f^{-1}(2) \in U \cap \operatorname{int}(A)$ shows that $U \cap \operatorname{int}(A) \neq \emptyset$ while $(-1,-1) \in \operatorname{int}(A)$ and $(-1,-1) \notin U$ shows that $U \cap \operatorname{int}(A) \neq \operatorname{int}(A)$. \end{proof}
import Mathlib open Filter Real Function open scoped Topology
theorem exercise_2_57 {X : Type*} [TopologicalSpace X] : βˆƒ (S : Set X), IsConnected S ∧ Β¬ IsConnected (interior S) :=
Pugh|exercise_2_126
Suppose that $E$ is an uncountable subset of $\mathbb{R}$. Prove that there exists a point $p \in \mathbb{R}$ at which $E$ condenses.
\begin{proof} I think this is the proof by contrapositive that you were getting at. Suppose that $E$ has no limit points at all. Pick an arbitrary point $x \in E$. Then $x$ cannot be a limit point, so there must be some $\delta>0$ such that the ball of radius $\delta$ around $x$ contains no other points of $E$ : $$ B_\delta(x) \cap E=\{x\} $$ Call this "point 1 ". For the next point, take the closest element to $x$ and on its left; that is, choose the point $$ \max [E \cap(-\infty, x)] $$ if it exists (that is important - if not, skip to the next step). Note that by the argument above, this supremum, should it exist, cannot equal $x$ and is therefore a new point in $E$. Call this "point 2 ". Now take the first point to the right of $x$ for "point 3 ". Take the first point to the left of point 2 for "point 4 ". And so on, ad infinitum. This gives a countable list of unique points; we must show that it exhausts the entire set $E$. Suppose not. Suppose there is some element $a<x$ which is never included in the list (picking $a$ on the negative side of $x$ is arbitrary, and the same argument would work for the second case). Then the element closest and to the right of $a$ in $E$ (which exists, by the no-limit-points argument at the beginning) is also not in the list; if it was, $a$ would have been in one of the next two spots. And same with that point (call it $a_1$ ); there is a closest $a_2>a_1 \in E$ such that $a_2$ is not in the list. Repeating, we generate an infinite monotone-increasing sequence $\left\{a_i\right\}$ of elements in $E$ and not in the list, which is clearly bounded above by $x$. By the Monotone Convergence Theorem this sequence has a limit. But that means the sequence $\left\{a_i\right\} \subset E$ converges to a limit, and hence $E$ has a limit point, contradicting the assumption. Therefore our list exhausts $E$, and we have enumerated all its elements. \end{proof}
import Mathlib open Filter Real Function open scoped Topology
theorem exercise_2_126 {E : Set ℝ} (hE : Β¬ Set.Countable E) : βˆƒ (p : ℝ), ClusterPt p (π“Ÿ E) :=
Pugh|exercise_3_4
Prove that $\sqrt{n+1}-\sqrt{n} \rightarrow 0$ as $n \rightarrow \infty$.
\begin{proof} $$ \sqrt{n+1}-\sqrt{n}=\frac{(\sqrt{n+1}-\sqrt{n})(\sqrt{n+1}+\sqrt{n})}{\sqrt{n+1}+\sqrt{n}}=\frac{1}{\sqrt{n+1}+\sqrt{n}}<\frac{1}{2 \sqrt{n}} $$ \end{proof}
import Mathlib open Filter Real Function open scoped Topology
theorem exercise_3_4 (n : β„•) : Tendsto (Ξ» n => (sqrt (n + 1) - sqrt n)) atTop (𝓝 0) :=
Pugh|exercise_3_63b
Prove that $\sum 1/k(\log(k))^p$ diverges when $p \leq 1$.
\begin{proof} Using the integral test, for a set $a$, we see $$ \lim _{b \rightarrow \infty} \int_a^b \frac{1}{x \log (x)^c} d x=\lim _{b \rightarrow \infty}\left(\frac{\log (b)^{1-c}}{1-c}-\frac{\log (a)^{1-c}}{1-c}\right) $$ which goes to infinity if $c \leq 1$ and converges if $c>1$. Thus, $$ \sum_{n=2}^{\infty} \frac{1}{n \log (n)^c} $$ converges if and only if $c>1$. \end{proof}
import Mathlib open Filter Real Function open scoped Topology
theorem exercise_3_63b (p : ℝ) (f : β„• β†’ ℝ) (hp : p ≀ 1) (h : f = Ξ» (k : β„•) => (1 : ℝ) / (k * (log k) ^ p)) : Β¬ βˆƒ l, Tendsto f atTop (𝓝 l) :=
Putnam|exercise_1998_a3
Let $f$ be a real function on the real line with continuous third derivative. Prove that there exists a point $a$ such that $f(a) \cdot f^{\prime}(a) \cdot f^{\prime \prime}(a) \cdot f^{\prime \prime \prime}(a) \geq 0$.
import Mathlib open scoped BigOperators
theorem exercise_1998_a3 (f : ℝ β†’ ℝ) (hf : ContDiff ℝ 3 f) : βˆƒ a : ℝ, (f a) * (deriv f a) * (iteratedDeriv 2 f a) * (iteratedDeriv 3 f a) β‰₯ 0 :=
Putnam|exercise_2000_a2
Prove that there exist infinitely many integers $n$ such that $n, n+1, n+2$ are each the sum of the squares of two integers.
\begin{proof} It is well-known that the equation $x^2-2y^2=1$ has infinitely many solutions (the so-called ``Pell'' equation). Thus setting $n=2y^2$ (so that $n=y^2+y^2$, $n+1=x^2+0^2$, $n+2=x^2+1^2$) yields infinitely many $n$ with the desired property. \end{proof}
import Mathlib open scoped BigOperators
theorem exercise_2000_a2 : βˆ€ N : β„•, βˆƒ n : β„•, n > N ∧ βˆƒ i : Fin 6 β†’ β„•, n = (i 0)^2 + (i 1)^2 ∧ n + 1 = (i 2)^2 + (i 3)^2 ∧ n + 2 = (i 4)^2 + (i 5)^2 :=
Putnam|exercise_2010_a4
Prove that for each positive integer $n$, the number $10^{10^{10^n}}+10^{10^n}+10^n-1$ is not prime.
\begin{proof} Put \[ N = 10^{10^{10^n}} + 10^{10^n} + 10^n - 1. \] Write $n = 2^m k$ with $m$ a nonnegative integer and $k$ a positive odd integer. For any nonnegative integer $j$, \[ 10^{2^m j} \equiv (-1)^j \pmod{10^{2^m} + 1}. \] Since $10^n \geq n \geq 2^m \geq m+1$, $10^n$ is divisible by $2^n$ and hence by $2^{m+1}$, and similarly $10^{10^n}$ is divisible by $2^{10^n}$ and hence by $2^{m+1}$. It follows that \[ N \equiv 1 + 1 + (-1) + (-1) \equiv 0 \pmod{10^{2^m} + 1}. \] Since $N \geq 10^{10^n} > 10^n + 1 \geq 10^{2^m} + 1$, it follows that $N$ is composite. \end{proof}
import Mathlib open scoped BigOperators
theorem exercise_2010_a4 (n : β„•) (hn : n > 0) : Β¬ Nat.Prime (10^10^10^n + 10^10^n + 10^n - 1) :=
Putnam|exercise_2017_b3
Suppose that $f(x)=\sum_{i=0}^{\infty} c_{i} x^{i}$ is a power series for which each coefficient $c_{i}$ is 0 or 1 . Show that if $f(2 / 3)=3 / 2$, then $f(1 / 2)$ must be irrational.
\begin{proof} Suppose by way of contradiction that $f(1/2)$ is rational. Then $\sum_{i=0}^{\infty} c_i 2^{-i}$ is the binary expansion of a rational number, and hence must be eventually periodic; that is, there exist some integers $m,n$ such that $c_i = c_{m+i}$ for all $i \geq n$. We may then write \[ f(x) = \sum_{i=0}^{n-1} c_i x^i + \frac{x^n}{1-x^m} \sum_{i=0}^{m-1} c_{n+i} x^i. \] Evaluating at $x = 2/3$, we may equate $f(2/3) = 3/2$ with \[ \frac{1}{3^{n-1}} \sum_{i=0}^{n-1} c_i 2^i 3^{n-i-1} + \frac{2^n 3^m}{3^{n+m-1}(3^m-2^m)} \sum_{i=0}^{m-1} c_{n+i} 2^i 3^{m-1-i}; \] since all terms on the right-hand side have odd denominator, the same must be true of the sum, a contradiction. \end{proof}
import Mathlib open scoped BigOperators
theorem exercise_2017_b3 (f : ℝ β†’ ℝ) (c : β„• β†’ ℝ) (hf : f = Ξ» x => (βˆ‘' (i : β„•), (c i) * x^i)) (hc : βˆ€ n, c n = 0 ∨ c n = 1) (hf1 : f (2/3) = 3/2) : Irrational (f (1/2)) :=
Putnam|exercise_2018_b2
Let $n$ be a positive integer, and let $f_{n}(z)=n+(n-1) z+$ $(n-2) z^{2}+\cdots+z^{n-1}$. Prove that $f_{n}$ has no roots in the closed unit disk $\{z \in \mathbb{C}:|z| \leq 1\}$.
\begin{proof} Note first that $f_n(1) > 0$, so $1$ is not a root of $f_n$. Next, note that \[ (z-1)f_n(z) = z^n + \cdots + z - n; \] however, for $\left| z \right| \leq 1$, we have $\left| z^n + \cdots + z \right| \leq n$ by the triangle inequality; equality can only occur if $z,\dots,z^n$ have norm 1 and the same argument, which only happens for $z=1$. Thus there can be no root of $f_n$ with $|z| \leq 1$. \end{proof}
import Mathlib open scoped BigOperators
theorem exercise_2018_b2 (n : β„•) (hn : n > 0) (f : β„• β†’ β„‚ β†’ β„‚) (hf : βˆ€ n : β„•, f n = Ξ» (z : β„‚) => (βˆ‘ i : Fin n, (n-i)* z^(i : β„•))) : Β¬ (βˆƒ z : β„‚, β€–zβ€– ≀ 1 ∧ f n z = 0) :=
Putnam|exercise_2020_b5
For $j \in\{1,2,3,4\}$, let $z_{j}$ be a complex number with $\left|z_{j}\right|=1$ and $z_{j} \neq 1$. Prove that $3-z_{1}-z_{2}-z_{3}-z_{4}+z_{1} z_{2} z_{3} z_{4} \neq 0 .$
\begin{proof} It will suffice to show that for any $z_1, z_2, z_3, z_4 \in \mathbb{C}$ of modulus 1 such that $|3-z_1-z_2-z_3-z_4| = |z_1z_2z_3z_4|$, at least one of $z_1, z_2, z_3$ is equal to 1. To this end, let $z_1=e^{\alpha i}, z_2=e^{\beta i}, z_3=e^{\gamma i}$ and \[ f(\alpha, \beta, \gamma)=|3-z_1-z_2-z_3|^2-|1-z_1z_2z_3|^2. \] A routine calculation shows that \begin{align*} f(\alpha, \beta, \gamma)&= 10 - 6\cos(\alpha) - 6\cos(\beta) - 6\cos(\gamma) \\ &\quad + 2\cos(\alpha + \beta + \gamma) + 2\cos(\alpha - \beta) \\ &\quad + 2\cos(\beta - \gamma) + 2\cos(\gamma - \alpha). \end{align*} Since the function $f$ is continuously differentiable, and periodic in each variable, $f$ has a maximum and a minimum and it attains these values only at points where $\nabla f=(0,0,0)$. A routine calculation now shows that \begin{align*} \frac{\partial f}{\partial \alpha} + \frac{\partial f}{\partial \beta} + \frac{\partial f}{\partial \gamma} &= 6(\sin(\alpha) +\sin(\beta)+\sin(\gamma)- \sin(\alpha + \beta + \gamma)) \\ &= 24\sin\left(\frac{\alpha+\beta}{2}\right) \sin\left(\frac{\beta+\gamma}{2}\right) \sin\left(\frac{\gamma+\alpha}{2}\right). \end{align*} Hence every critical point of $f$ must satisfy one of $z_1z_2=1$, $z_2z_3=1$, or $z_3z_1=1$. By symmetry, let us assume that $z_1z_2=1$. Then \[ f = |3-2\mathrm{Re}(z_1)-z_3|^2-|1-z_3|^2; \] since $3-2\mathrm{Re}(z_1)\ge 1$, $f$ is nonnegative and can be zero only if the real part of $z_1$, and hence also $z_1$ itself, is equal to $1$. \end{proof}
import Mathlib open scoped BigOperators
theorem exercise_2020_b5 (z : Fin 4 β†’ β„‚) (hz0 : βˆ€ n, β€–z nβ€– = 1) (hz1 : βˆ€ n, z n β‰  1) : 3 - z 0 - z 1 - z 2 - z 3 + (z 0) * (z 1) * (z 2) * (z 3) β‰  0 :=
Rudin|exercise_1_1a
If $r$ is rational $(r \neq 0)$ and $x$ is irrational, prove that $r+x$ is irrational.
\begin{proof} If $r$ and $r+x$ were both rational, then $x=r+x-r$ would also be rational. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_1a (x : ℝ) (y : β„š) (hy : y β‰  0) : ( Irrational x ) -> Irrational ( x + y ) :=
Rudin|exercise_1_2
Prove that there is no rational number whose square is $12$.
\begin{proof} Suppose $m^2=12 n^2$, where $m$ and $n$ have no common factor. It follows that $m$ must be even, and therefore $n$ must be odd. Let $m=2 r$. Then we have $r^2=3 n^2$, so that $r$ is also odd. Let $r=2 s+1$ and $n=2 t+1$. Then $$ 4 s^2+4 s+1=3\left(4 t^2+4 t+1\right)=12 t^2+12 t+3, $$ so that $$ 4\left(s^2+s-3 t^2-3 t\right)=2 . $$ But this is absurd, since 2 cannot be a multiple of 4 . \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_2 : Β¬ βˆƒ (x : β„š), ( x ^ 2 = 12 ) :=
Rudin|exercise_1_5
Let $A$ be a nonempty set of real numbers which is bounded below. Let $-A$ be the set of all numbers $-x$, where $x \in A$. Prove that $\inf A=-\sup (-A)$.
\begin{proof} We need to prove that $-\sup (-A)$ is the greatest lower bound of $A$. For brevity, let $\alpha=-\sup (-A)$. We need to show that $\alpha \leq x$ for all $x \in A$ and $\alpha \geq \beta$ if $\beta$ is any lower bound of $A$. Suppose $x \in A$. Then, $-x \in-A$, and, hence $-x \leq \sup (-A)$. It follows that $x \geq-\sup (-A)$, i.e., $\alpha \leq x$. Thus $\alpha$ is a lower bound of $A$. Now let $\beta$ be any lower bound of $A$. This means $\beta \leq x$ for all $x$ in $A$. Hence $-x \leq-\beta$ for all $x \in A$, which says $y \leq-\beta$ for all $y \in-A$. This means $-\beta$ is an upper bound of $-A$. Hence $-\beta \geq \sup (-A)$ by definition of sup, i.e., $\beta \leq-\sup (-A)$, and so $-\sup (-A)$ is the greatest lower bound of $A$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_5 (A minus_A : Set ℝ) (hA : A.Nonempty) (hA_bdd_below : BddBelow A) (hminus_A : minus_A = {x | -x ∈ A}) : sInf A = - sSup minus_A :=
Rudin|exercise_1_11a
If $z$ is a complex number, prove that there exists an $r\geq 0$ and a complex number $w$ with $| w | = 1$ such that $z = rw$.
\begin{proof} If $z=0$, we take $r=0, w=1$. (In this case $w$ is not unique.) Otherwise we take $r=|z|$ and $w=z /|z|$, and these choices are unique, since if $z=r w$, we must have $r=r|w|=|r w|=|z|, z / r$ \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_11a (z : β„‚) : βˆƒ (r : ℝ) (w : β„‚), r β‰₯ 0 ∧ abs w = 1 ∧ z = r * w :=
Rudin|exercise_1_13
If $x, y$ are complex, prove that $||x|-|y|| \leq |x-y|$.
\begin{proof} Since $x=x-y+y$, the triangle inequality gives $$ |x| \leq|x-y|+|y| $$ so that $|x|-|y| \leq|x-y|$. Similarly $|y|-|x| \leq|x-y|$. Since $|x|-|y|$ is a real number we have either ||$x|-| y||=|x|-|y|$ or ||$x|-| y||=|y|-|x|$. In either case, we have shown that ||$x|-| y|| \leq|x-y|$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_13 (x y : β„‚) : |(abs x) - (abs y)| ≀ abs (x - y) :=
Rudin|exercise_1_16a
Suppose $k \geq 3, x, y \in \mathbb{R}^k, |x - y| = d > 0$, and $r > 0$. Prove that if $2r > d$, there are infinitely many $z \in \mathbb{R}^k$ such that $|z-x|=|z-y|=r$.
\begin{proof} (a) Let w be any vector satisfying the following two equations: $$ \begin{aligned} \mathbf{w} \cdot(\mathbf{x}-\mathbf{y}) &=0, \\ |\mathbf{w}|^2 &=r^2-\frac{d^2}{4} . \end{aligned} $$ From linear algebra it is known that all but one of the components of a solution $\mathbf{w}$ of the first equation can be arbitrary. The remaining component is then uniquely determined. Also, if $w$ is any non-zero solution of the first equation, there is a unique positive number $t$ such that $t$ w satisfies both equations. (For example, if $x_1 \neq y_1$, the first equation is satisfied whenever $$ z_1=\frac{z_2\left(x_2-y_2\right)+\cdots+z_k\left(x_k-y_k\right)}{y_1-x_1} . $$ If $\left(z_1, z_2, \ldots, z_k\right)$ satisfies this equation, so does $\left(t z_1, t z_2, \ldots, t z_k\right)$ for any real number $t$.) Since at least two of these components can vary independently, we can find a solution with these components having any prescribed ratio. This ratio does not change when we multiply by the positive number $t$ to obtain a solution of both equations. Since there are infinitely many ratios, there are infinitely many distinct solutions. For each such solution $\mathbf{w}$ the vector $\mathbf{z}=$ $\frac{1}{2} \mathrm{x}+\frac{1}{2} \mathrm{y}+\mathrm{w}$ is a solution of the required equation. For $$ \begin{aligned} |\mathrm{z}-\mathbf{x}|^2 &=\left|\frac{\mathbf{y}-\mathbf{x}}{2}+\mathbf{w}\right|^2 \\ &=\left|\frac{\mathbf{y}-\mathbf{x}}{2}\right|^2+2 \mathbf{w} \cdot \frac{\mathbf{x}-\mathbf{y}}{2}+|\mathbf{w}|^2 \\ &=\frac{d^2}{4}+0+r^2-\frac{d^2}{4} \\ &=r^2 \end{aligned} $$ and a similar relation holds for $|z-y|^2$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_16a (n : β„•) (d r : ℝ) (x y z : EuclideanSpace ℝ (Fin n)) -- R^n (h₁ : n β‰₯ 3) (hβ‚‚ : β€–x - yβ€– = d) (h₃ : d > 0) (hβ‚„ : r > 0) (hβ‚… : 2 * r > d) : Set.Infinite {z : EuclideanSpace ℝ (Fin n) | β€–z - xβ€– = r ∧ β€–z - yβ€– = r} :=
Rudin|exercise_1_18a
If $k \geq 2$ and $\mathbf{x} \in R^{k}$, prove that there exists $\mathbf{y} \in R^{k}$ such that $\mathbf{y} \neq 0$ but $\mathbf{x} \cdot \mathbf{y}=0$
\begin{proof} If $\mathbf{x}$ has any components equal to 0 , then $\mathbf{y}$ can be taken to have the corresponding components equal to 1 and all others equal to 0 . If all the components of $\mathbf{x}$ are nonzero, $\mathbf{y}$ can be taken as $\left(-x_2, x_1, 0, \ldots, 0\right)$. This is, of course, not true when $k=1$, since the product of two nonzero real numbers is nonzero. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_18a (n : β„•) (h : n > 1) (x : EuclideanSpace ℝ (Fin n)) -- R^n : βˆƒ (y : EuclideanSpace ℝ (Fin n)), y β‰  0 ∧ (inner x y) = (0 : ℝ) :=
Rudin|exercise_1_19
Suppose $a, b \in R^k$. Find $c \in R^k$ and $r > 0$ such that $|x-a|=2|x-b|$ if and only if $| x - c | = r$. Prove that $3c = 4b - a$ and $3r = 2 |b - a|$.
\begin{proof} Since the solution is given to us, all we have to do is verify it, i.e., we need to show that the equation $$ |\mathrm{x}-\mathrm{a}|=2|\mathrm{x}-\mathrm{b}| $$ is equivalent to $|\mathrm{x}-\mathbf{c}|=r$, which says $$ \left|\mathbf{x}-\frac{4}{3} \mathbf{b}+\frac{1}{3} \mathbf{a}\right|=\frac{2}{3}|\mathbf{b}-\mathbf{a}| . $$ If we square both sides of both equations, we an equivalent pair of equations, the first of which reduces to $$ 3|\mathbf{x}|^2+2 \mathbf{a} \cdot \mathbf{x}-8 \mathbf{b} \cdot \mathbf{x}-|\mathbf{a}|^2+4|\mathbf{b}|^2=0, $$ and the second of which reduces to this equation divided by 3 . Hence these equations are indeed equivalent. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_1_19 (n : β„•) (a b : EuclideanSpace ℝ (Fin n)) : (βˆƒ c r, r > 0 ∧ (βˆ€ x, β€–x - aβ€– = 2 * β€–x - bβ€– ↔ β€–x - cβ€– = r)) ∧ (βˆ€ c r, (r > 0 ∧ (βˆ€ x, β€–x - aβ€– = 2 * β€–x - bβ€– ↔ β€–x - cβ€– = r)) β†’ (3 β€’ c = 4 β€’ b - a ∧ 3 * r = 2 * β€–b - aβ€–)) :=
Rudin|exercise_2_24
Let $X$ be a metric space in which every infinite subset has a limit point. Prove that $X$ is separable.
\begin{proof} We observe that if the process of constructing $x_j$ did not terminate, the result would be an infinite set of points $x_j, j=1,2, \ldots$, such that $d\left(x_i, x_j\right) \geq \delta$ for $i \neq j$. It would then follow that for any $x \in X$, the open ball $B_{\frac{\delta}{2}}(x)$ contains at most one point of the infinite set, hence that no point could be a limit point of this set, contrary to hypothesis. Hence $X$ is totally bounded, i.e., for each $\delta>0$ there is a finite set $x_1, \ldots, x_{N\delta}$such that $X=\bigcup_{j / 1}^{N\delta} B_\delta\left(x_j\right)$ Let $x_{n_1}, \ldots, x_{n N_n}$ be such that $X=\bigcup_{j / 1}^{N_n} B_{\frac{1}{n}}\left(x_{n j}\right), n=1,2, \ldots$ We claim that $\left\{x_{n j}: 1 \leq j \leq N_n ; n=1,2, \ldots\right\}$ is a countable dense subset of $X$. Indeed 25 if $x \in X$ and $\delta>0$, then $x \in B_{\frac{1}{n}}\left(x_{n j}\right)$ for some $x_{n j}$ for some $n>\frac{1}{\delta}$, and hence $d\left(x, x_{n j}\right)<\delta$. By definition, this means that $\left\{x_{n j}\right\}$ is dense in $X$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_2_24 {X : Type*} [MetricSpace X] (hX : βˆ€ (A : Set X), Infinite A β†’ βˆƒ (x : X), x ∈ closure A) : SeparableSpace X :=
Rudin|exercise_2_27a
Suppose $E\subset\mathbb{R}^k$ is uncountable, and let $P$ be the set of condensation points of $E$. Prove that $P$ is perfect.
\begin{proof} We see that $E \cap W$ is at most countable, being a countable union of at-most-countable sets. It remains to show that $P=W^c$, and that $P$ is perfect. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_2_27a (k : β„•) (E P : Set (EuclideanSpace ℝ (Fin k))) (hE : Β¬ Set.Countable E) (hP : P = {x | βˆ€ U ∈ 𝓝 x, Β¬ Set.Countable (U ∩ E)}) : Perfect P :=
Rudin|exercise_2_28
Prove that every closed set in a separable metric space is the union of a (possibly empty) perfect set and a set which is at most countable.
\begin{proof} If $E$ is closed, it contains all its limit points, and hence certainly all its condensation points. Thus $E=P \cup(E \backslash P)$, where $P$ is perfect (the set of all condensation points of $E$ ), and $E \backslash P$ is at most countable. Since a perfect set in a separable metric space has the same cardinality as the real numbers, the set $P$ must be empty if $E$ is countable. The at-mostcountable set $E \backslash P$ cannot be perfect, hence must have isolated points if it is nonempty. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_2_28 (X : Type*) [MetricSpace X] [SeparableSpace X] (A : Set X) (hA : IsClosed A) : βˆƒ P₁ Pβ‚‚ : Set X, A = P₁ βˆͺ Pβ‚‚ ∧ Perfect P₁ ∧ Set.Countable Pβ‚‚ :=
Rudin|exercise_3_1a
Prove that convergence of $\left\{s_{n}\right\}$ implies convergence of $\left\{\left|s_{n}\right|\right\}$.
\begin{proof} Let $\varepsilon>0$. Since the sequence $\left\{s_n\right\}$ is a Cauchy sequence, there exists $N$ such that $\left|s_m-s_n\right|<\varepsilon$ for all $m>N$ and $n>N$. We then have $\left| |s_m| - |s_n| \right| \leq\left|s_m-s_n\right|<\varepsilon$ for all $m>N$ and $n>N$. Hence the sequence $\left\{\left|s_n\right|\right\}$ is also a Cauchy sequence, and therefore must converge. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_3_1a (f : β„• β†’ ℝ) (h : βˆƒ (a : ℝ), Tendsto (Ξ» (n : β„•) => f n) atTop (𝓝 a)) : βˆƒ (a : ℝ), Tendsto (Ξ» (n : β„•) => |f n|) atTop (𝓝 a) :=
Rudin|exercise_3_3
If $s_{1}=\sqrt{2}$, and $s_{n+1}=\sqrt{2+\sqrt{s_{n}}} \quad(n=1,2,3, \ldots),$ prove that $\left\{s_{n}\right\}$ converges, and that $s_{n}<2$ for $n=1,2,3, \ldots$.
\begin{proof} Since $\sqrt{2}<2$, it is manifest that if $s_n<2$, then $s_{n+1}<\sqrt{2+2}=2$. Hence it follows by induction that $\sqrt{2}<s_n<2$ for all $n$. In view of this fact,it also follows that $\left(s_n-2\right)\left(s_n+1\right)<0$ for all $n>1$, i.e., $s_n>s_n^2-2=s_{n-1}$. Hence the sequence is an increasing sequence that is bounded above (by 2 ) and so converges. Since the limit $s$ satisfies $s^2-s-2=0$, it follows that the limit is 2. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
noncomputable def f : β„• β†’ ℝ | 0 => sqrt 2 | (n + 1) => sqrt (2 + sqrt (f n)) theorem exercise_3_3 : βˆƒ (x : ℝ), Tendsto f atTop (𝓝 x) ∧ βˆ€ n, f n < 2 :=
Rudin|exercise_3_6a
Prove that $\lim_{n \rightarrow \infty} \sum_{i<n} a_i = \infty$, where $a_i = \sqrt{i + 1} -\sqrt{i}$.
\begin{proof} (a) Multiplying and dividing $a_n$ by $\sqrt{n+1}+\sqrt{n}$, we find that $a_n=\frac{1}{\sqrt{n+1}+\sqrt{n}}$, which is larger than $\frac{1}{2 \sqrt{n+1}}$. The series $\sum a_n$ therefore diverges by comparison with the $p$ series $\left(p=\frac{1}{2}\right)$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
noncomputable def g (n : β„•) : ℝ := sqrt (n + 1) - sqrt n theorem exercise_3_6a : Tendsto (Ξ» (n : β„•) => (βˆ‘ i in range n, g i)) atTop atTop :=
Rudin|exercise_3_8
If $\Sigma a_{n}$ converges, and if $\left\{b_{n}\right\}$ is monotonic and bounded, prove that $\Sigma a_{n} b_{n}$ converges.
\begin{proof} We shall show that the partial sums of this series form a Cauchy sequence, i.e., given $\varepsilon>0$ there exists $N$ such that $\left|\sum_{k=m+1}^n a_k b_k\right|\langle\varepsilon$ if $n\rangle$ $m \geq N$. To do this, let $S_n=\sum_{k=1}^n a_k\left(S_0=0\right)$, so that $a_k=S_k-S_{k-1}$ for $k=1,2, \ldots$ Let $M$ be an uppper bound for both $\left|b_n\right|$ and $\left|S_n\right|$, and let $S=\sum a_n$ and $b=\lim b_n$. Choose $N$ so large that the following three inequalities hold for all $m>N$ and $n>N$ : $$ \left|b_n S_n-b S\right|<\frac{\varepsilon}{3} ; \quad\left|b_m S_m-b S\right|<\frac{\varepsilon}{3} ; \quad\left|b_m-b_n\right|<\frac{\varepsilon}{3 M} . $$ Then if $n>m>N$, we have, from the formula for summation by parts, $$ \sum_{k=m+1}^n a_n b_n=b_n S_n-b_m S_m+\sum_{k=m}^{n-1}\left(b_k-b_{k+1}\right) S_k $$ Our assumptions yield immediately that $\left|b_n S_n-b_m S_m\right|<\frac{2 \varepsilon}{3}$, and $$ \left|\sum_{k=m}^{n-1}\left(b_k-b_{k+1}\right) S_k\right| \leq M \sum_{k=m}^{n-1}\left|b_k-b_{k+1}\right| . $$ Since the sequence $\left\{b_n\right\}$ is monotonic, we have $$ \sum_{k=m}^{n-1}\left|b_k-b_{k+1}\right|=\left|\sum_{k=m}^{n-1}\left(b_k-b_{k+1}\right)\right|=\left|b_m-b_n\right|<\frac{\varepsilon}{3 M}, $$ from which the desired inequality follows. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_3_8 (a b : β„• β†’ ℝ) (h1 : βˆƒ y, (Tendsto (Ξ» n => (βˆ‘ i in (range n), a i)) atTop (𝓝 y))) (h2 : Monotone b) (h3 : Bornology.IsBounded (Set.range b)) : βˆƒ y, Tendsto (Ξ» n => (βˆ‘ i in (range n), (a i) * (b i))) atTop (𝓝 y) :=
Rudin|exercise_3_20
Suppose $\left\{p_{n}\right\}$ is a Cauchy sequence in a metric space $X$, and some sequence $\left\{p_{n l}\right\}$ converges to a point $p \in X$. Prove that the full sequence $\left\{p_{n}\right\}$ converges to $p$.
\begin{proof} Let $\varepsilon>0$. Choose $N_1$ so large that $d\left(p_m, p_n\right)<\frac{\varepsilon}{2}$ if $m>N_1$ and $n>N_1$. Then choose $N \geq N_1$ so large that $d\left(p_{n_k}, p\right)<\frac{\varepsilon}{2}$ if $k>N$. Then if $n>N$, we have $$ d\left(p_n, p\right) \leq d\left(p_n, p_{n_{N+1}}\right)+d\left(p_{n_{N+1}}, p\right)<\varepsilon $$ For the first term on the right is less than $\frac{\varepsilon}{2}$ since $n>N_1$ and $n_{N+1}>N+1>$ $N_1$. The second term is less than $\frac{\varepsilon}{2}$ by the choice of $N$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_3_20 {X : Type*} [MetricSpace X] (p : β„• β†’ X) (l : β„•+) (r : X) (hp : CauchySeq p) (hpl : Tendsto (Ξ» n => p (l * n)) atTop (𝓝 r)) : Tendsto p atTop (𝓝 r) :=
Rudin|exercise_3_22
Suppose $X$ is a nonempty complete metric space, and $\left\{G_{n}\right\}$ is a sequence of dense open sets of $X$. Prove Baire's theorem, namely, that $\bigcap_{1}^{\infty} G_{n}$ is not empty.
\begin{proof} Let $F_n$ be the complement of $G_n$, so that $F_n$ is closed and contains no open sets. We shall prove that any nonempty open set $U$ contains a point not in any $F_n$, hence in all $G_n$. To this end, we note that $U$ is not contained in $F_1$, so that there is a point $x_1 \in U \backslash F_1$. Since $U \backslash F_1$ is open, there exists $r_1>0$ such that $B_1$, defined as the open ball of radius $r_1$ about $x_1$, is contained in $U \backslash F_1$. Let $E_1$ be the open ball of radius $\frac{r_1}{2}$ about $x_1$, so that the closure of $E_1$ is contained in $B_1$. Now $F_2$ does not contain $E_1$, and so we can find a point $x_2 \in E_1 \backslash F_2$. Since $E_1 \backslash F_2$ is an open set, there exists a positive number $r_2$ such that $B_2$, the open ball of radius $R_2$ about $x_2$, is contained in $E_1 \backslash F_2$, which in turn is contained in $U \backslash\left(F_1 \cup F_2\right)$. We let $E_2$ be the open ball of radius $\frac{r_2}{2}$ about $x_2$, so that $\bar{E}_2 \subseteq B_2$. Proceeding in this way, we construct a sequence of open balls $E_j$, such that $E_j \supseteq \bar{E}_{j+1}$, and the diameter of $E_j$ tends to zero. By the previous exercise, there is a point $x$ belonging to all the sets $\bar{E}_j$, hence to all the sets $U \backslash\left(F_1 \cup F_2 \cup \cdots \cup F_n\right)$. Thus the point $x$ belongs to $U \cap\left(\cap_1^{\infty} G_n\right)$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_3_22 (X : Type*) [MetricSpace X] [CompleteSpace X] [Nonempty X] (G : β„• β†’ Set X) (hG : βˆ€ n, IsOpen (G n) ∧ Dense (G n)) : βˆƒ x, βˆ€ n, x ∈ G n :=
Rudin|exercise_4_2a
If $f$ is a continuous mapping of a metric space $X$ into a metric space $Y$, prove that $f(\overline{E}) \subset \overline{f(E)}$ for every set $E \subset X$. ($\overline{E}$ denotes the closure of $E$).
\begin{proof} Let $x \in \bar{E}$. We need to show that $f(x) \in \overline{f(E)}$. To this end, let $O$ be any neighborhood of $f(x)$. Since $f$ is continuous, $f^{-1}(O)$ contains (is) a neighborhood of $x$. Since $x \in \bar{E}$, there is a point $u$ of $E$ in $f^{-1}(O)$. Hence $\frac{f(u)}{f(E)} \in O \cap f(E)$. Since $O$ was any neighborhood of $f(x)$, it follows that $f(x) \in \overline{f(E)}$ \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_2a {Ξ± : Type} [MetricSpace Ξ±] {Ξ² : Type} [MetricSpace Ξ²] (f : Ξ± β†’ Ξ²) (h₁ : Continuous f) : βˆ€ (x : Set Ξ±), f '' (closure x) βŠ† closure (f '' x) :=
Rudin|exercise_4_4a
Let $f$ and $g$ be continuous mappings of a metric space $X$ into a metric space $Y$, and let $E$ be a dense subset of $X$. Prove that $f(E)$ is dense in $f(X)$.
\begin{proof} To prove that $f(E)$ is dense in $f(X)$, simply use that $f(X)=f(\bar{E}) \subseteq \overline{f(E)}$. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_4a {Ξ± : Type} [MetricSpace Ξ±] {Ξ² : Type} [MetricSpace Ξ²] (f : Ξ± β†’ Ξ²) (s : Set Ξ±) (h₁ : Continuous f) (hβ‚‚ : Dense s) : f '' Set.univ βŠ† closure (f '' s) :=
Rudin|exercise_4_5a
If $f$ is a real continuous function defined on a closed set $E \subset \mathbb{R}$, prove that there exist continuous real functions $g$ on $\mathbb{R}$ such that $g(x)=f(x)$ for all $x \in E$.
\begin{proof} Following the hint, let the complement of $E$ consist of a countable collection of finite open intervals $\left(a_k, b_k\right)$ together with possibly one or both of the the semi-infinite intervals $(b,+\infty)$ and $(-\infty, a)$. The function $f(x)$ is already defined at $a_k$ and $b_k$, as well as at $a$ and $b$ (if these last two points exist). Define $g(x)$ to be $f(b)$ for $x>b$ and $f(a)$ for $x<a$ if $a$ and $b$ exist. On the interval $\left(a_k, b_k\right)$ let $$ g(x)=f\left(a_k\right)+\frac{x-a_k}{b_k-a_k}\left(f\left(b_k\right)-f\left(a_k\right)\right) . $$ Of course we let $g(x)=f(x)$ for $x \in E$. It is now fairly clear that $g(x)$ is continuous. A rigorous proof proceeds as follows. Let $\varepsilon>0$. To choose $\delta>0$ such that $|x-u|<\delta$ implies $|g(x)-g(u)|<\varepsilon$, we consider three cases. i. If $x>b$, let $\delta=x-b$. Then if $|x-u|<\delta$, it follows that $u>b$ also, so that $g(u)=f(b)=g(x)$, and $|g(u)-g(x)|=0<\varepsilon$. Similarly if $x<a$, let $\delta=a-x$ ii. If $a_k<x<b_k$ and $f\left(a_k\right)=f\left(b_k\right)$, let $\delta=\min \left(x-a_k, b_k-x\right)$. Since $|x-u|<\delta$ implies $a_k<u<b_k$, so that $g(u)=f\left(a_k\right)=f\left(b_k\right)=g(x)$, we again have $|g(x)-g(u)|=0<\varepsilon$. If $a_k<x<b_k$ and $f\left(a_k\right) \neq f\left(b_k\right)$, let $\delta=\min \left(x-a_k, b_k-x, \frac{\left(b_k-a_k\right) \varepsilon}{\left|f\left(b_k\right)-f\left(a_k\right)\right|}\right)$. Then if $|x-u|<\delta$, we again have $a_k<u<b_k$ and so $$ |g(x)-g(u)|=\frac{|x-u|}{b_k-a_k}\left|f\left(b_k\right)-f\left(a_k\right)\right|<\varepsilon . $$ iii. If $x \in E$, let $\delta_1$ be such that $|f(u)-f(x)|<\varepsilon$ if $u \in E$ and $|x-u|<\delta_1$. (Subcase a). If there are points $x_1 \in E \cap\left(x-\delta_1, x\right)$ and $x_2 \in E \cap\left(x, x+\delta_1\right)$, let $\delta=\min \left(x-x_1, x_2-x\right)$. If $|u-x|<\delta$ and $u \in E$, then $|f(u)-f(x)|<\varepsilon$ by definition of $\delta_1$. if $u \notin E$, then, since $x_1, x$, and $x_2$ are all in $E$, it follows that $u \in\left(a_k, b_k\right)$, where $a_k \in E, b_k \in E$, and $\left|a_k-x\right|<\delta$ and $\left|b_k-x\right|<\delta$, so that $\left|f\left(a_k\right)-f(x)\right|<\varepsilon$ and $\left|f\left(b_k\right)-f(x)\right|<\varepsilon$. If $f\left(a_k\right)=f\left(b_k\right)$, then $f(u)=f\left(a_k\right)$ also, and we have $|f(u)-f(x)|<\varepsilon$. If $f\left(a_k\right) \neq f\left(b_k\right)$, then $$ \begin{aligned} |f(u)-f(x)| & =\left|f\left(a_k\right)-f(x)+\frac{u-a_k}{b_k-a_k}\left(f\left(b_k\right)-f\left(a_k\right)\right)\right| \\ & =\left|\frac{b_k-u}{b_k-a_k}\left(f\left(a_k\right)-f(x)\right)+\frac{u-a_k}{b_k-a_k}\left(f\left(b_k\right)-f(x)\right)\right| \\ & <\frac{b_k-u}{b_k-a_k} \varepsilon+\frac{u-a_k}{b_k-a_k} \varepsilon \\ & =\varepsilon \end{aligned} $$ (Subcase b). Suppose $x_2$ does not exist, i.e., either $x=a_k$ or $x=a_k$ and $b_k>a_k+\delta_1$. Let us consider the second of these cases and show how to get $|f(u)-f(x)|<\varepsilon$ for $x<u<x+\delta$. If $f\left(a_k\right)=f\left(b_k\right)$, let $\delta=\delta_1$. If $u>x$ we have $a_k<u<b_k$ and $f(u)=f\left(a_k\right)=f(x)$. If $f\left(a_k\right) \neq f\left(b_k\right)$, let $\delta=$ $\min \left(\delta_1, \frac{\left(b_k-a_k\right) \varepsilon}{\left|f\left(b_k\right)-f\left(a_k\right)\right|}\right)$. Then, just as in Subcase a, we have $|f(u)-f(x)|<\varepsilon$. The case when $x=b_k$ for some $k$ and $a_k<x-\delta_1$ is handled in exactly the same way. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_5a (f : ℝ β†’ ℝ) (E : Set ℝ) (h₁ : IsClosed E) (hβ‚‚ : ContinuousOn f E) : βˆƒ (g : ℝ β†’ ℝ), Continuous g ∧ βˆ€ x ∈ E, f x = g x :=
Rudin|exercise_4_6
If $f$ is defined on $E$, the graph of $f$ is the set of points $(x, f(x))$, for $x \in E$. In particular, if $E$ is a set of real numbers, and $f$ is real-valued, the graph of $f$ is a subset of the plane. Suppose $E$ is compact, and prove that $f$ is continuous on $E$ if and only if its graph is compact.
\begin{proof} Let $Y$ be the co-domain of the function $f$. We invent a new metric space $E \times Y$ as the set of pairs of points $(x, y), x \in E, y \in Y$, with the metric $\rho\left(\left(x_1, y_1\right),\left(x_2, y_2\right)\right)=d_E\left(x_1, x_2\right)+d_Y\left(y_1, y_2\right)$. The function $\varphi(x)=(x, f(x))$ is then a mapping of $E$ into $E \times Y$. We claim that the mapping $\varphi$ is continuous if $f$ is continuous. Indeed, let $x \in X$ and $\varepsilon>0$ be given. Choose $\eta>0$ so that $d_Y(f(x), f(u))<\frac{\varepsilon}{2}$ if $d_E(x, y)<\eta$. Then let $\delta=\min \left(\eta, \frac{\varepsilon}{2}\right)$. It is easy to see that $\rho(\varphi(x), \varphi(u))<\varepsilon$ if $d_E(x, u)<\delta$. Conversely if $\varphi$ is continuous, it is obvious from the inequality $\rho(\varphi(x), \varphi(u)) \geq d_Y(f(x), f(u))$ that $f$ is continuous. From these facts we deduce immediately that the graph of a continuous function $f$ on a compact set $E$ is compact, being the image of $E$ under the continuous mapping $\varphi$. Conversely, if $f$ is not continuous at some point $x$, there is a sequence of points $x_n$ converging to $x$ such that $f\left(x_n\right)$ does not converge to $f(x)$. If no subsequence of $f\left(x_n\right)$ converges, then the sequence $\left\{\left(x_n, f\left(x_n\right)\right\}_{n=1}^{\infty}\right.$ has no convergent subsequence, and so the graph is not compact. If some subsequence of $f\left(x_n\right)$ converges, say $f\left(x_{n_k}\right) \rightarrow z$, but $z \neq f(x)$, then the graph of $f$ fails to contain the limit point $(x, z)$, and hence is not closed. A fortiori it is not compact. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_6 (f : ℝ β†’ ℝ) (E : Set ℝ) (G : Set (ℝ Γ— ℝ)) (h₁ : IsCompact E) (hβ‚‚ : G = {(x, f x) | x ∈ E}) : ContinuousOn f E ↔ IsCompact G :=
Rudin|exercise_4_8b
Let $E$ be a bounded set in $R^{1}$. Prove that there exists a real function $f$ such that $f$ is uniformly continuous and is not bounded on $E$.
\begin{proof} The function $f(x)=x$ is uniformly continuous on the entire line, but not bounded. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_8b (E : Set ℝ) (h : Bornology.IsBounded E) : βˆƒ f : ℝ β†’ ℝ, UniformContinuousOn f E ∧ Β¬ Bornology.IsBounded (Set.image f E) :=
Rudin|exercise_4_12
A uniformly continuous function of a uniformly continuous function is uniformly continuous.
\begin{proof} Let $f: X \rightarrow Y$ and $g: Y \rightarrow Z$ be uniformly continuous. Then $g \circ f: X \rightarrow Z$ is uniformly continuous, where $g \circ f(x)=g(f(x))$ for all $x \in X$. To prove this fact, let $\varepsilon>0$ be given. Then, since $g$ is uniformly continuous, there exists $\eta>0$ such that $d_Z(g(u), g(v))<\varepsilon$ if $d_Y(u, v)<\eta$. Since $f$ is uniformly continuous, there exists $\delta>0$ such that $d_Y(f(x), f(y))<\eta$ if $d_X(x, y)<\delta$ It is then obvious that $d_Z(g(f(x)), g(f(y)))<\varepsilon$ if $d_X(x, y)<\delta$, so that $g \circ f$ is uniformly continuous. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_12 {Ξ± Ξ² Ξ³ : Type*} [UniformSpace Ξ±] [UniformSpace Ξ²] [UniformSpace Ξ³] {f : Ξ± β†’ Ξ²} {g : Ξ² β†’ Ξ³} (hf : UniformContinuous f) (hg : UniformContinuous g) : UniformContinuous (g ∘ f) :=
Rudin|exercise_4_19
Suppose $f$ is a real function with domain $R^{1}$ which has the intermediate value property: if $f(a)<c<f(b)$, then $f(x)=c$ for some $x$ between $a$ and $b$. Suppose also, for every rational $r$, that the set of all $x$ with $f(x)=r$ is closed. Prove that $f$ is continuous.
\begin{proof} The contradiction is evidently that $x_0$ is a limit point of the set of $t$ such that $f(t)=r$, yet, $x_0$ does not belong to this set. This contradicts the hypothesis that the set is closed. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_19 {f : ℝ β†’ ℝ} (hf : βˆ€ a b c, a < b β†’ f a < c β†’ c < f b β†’ βˆƒ x, a < x ∧ x < b ∧ f x = c) (hg : βˆ€ r : β„š, IsClosed {x | f x = r}) : Continuous f :=
Rudin|exercise_4_24
Assume that $f$ is a continuous real function defined in $(a, b)$ such that $f\left(\frac{x+y}{2}\right) \leq \frac{f(x)+f(y)}{2}$ for all $x, y \in(a, b)$. Prove that $f$ is convex.
\begin{proof} We shall prove that $$ f(\lambda x+(1-\lambda) y) \leq \lambda f(x)+(1-\lambda) f(y) $$ for all "dyadic rational" numbers, i.e., all numbers of the form $\lambda=\frac{k}{2^n}$, where $k$ is a nonnegative integer not larger than $2^n$. We do this by induction on $n$. The case $n=0$ is trivial (since $\lambda=0$ or $\lambda=1$ ). In the case $n=1$ we have $\lambda=0$ or $\lambda=1$ or $\lambda=\frac{1}{2}$. The first two cases are again trivial, and the third is precisely the hypothesis of the theorem. Suppose the result is proved for $n \leq r$, and consider $\lambda=\frac{k}{2^{r+1}}$. If $k$ is even, say $k=2 l$, then $\frac{k}{2^{r+1}}=\frac{l}{2^r}$, and we can appeal to the induction hypothesis. Now suppose $k$ is odd. Then $1 \leq k \leq 2^{r+1}-1$, and so the numbers $l=\frac{k-1}{2}$ and $m=\frac{k+1}{2}$ are integers with $0 \leq l<m \leq 2^r$. We can now write $$ \lambda=\frac{s+t}{2}, $$ where $s=\frac{k-1}{2^{r+1}}=\frac{l}{2^r}$ and $t=\frac{k+1}{2^{r+1}}=\frac{m}{2^r}$. We then have $$ \lambda x+(1-\lambda) y=\frac{[s x+(1-s) y]+[t x+(1-t) y]}{2} $$ Hence by the hypothesis of the theorem and the induction hypothesis we have $$ \begin{aligned} f(\lambda x+(1-\lambda) y) & \leq \frac{f(s x+(1-s) y)+f(t x+(1-t) y)}{2} \\ & \leq \frac{s f(x)+(1-s) f(y)+t f(x)+(1-t) f(y)}{2} \\ &=\left(\frac{s+t}{2}\right) f(x)+\left(1-\frac{s+t}{2}\right) f(y) \\ &=\lambda f(x)+(1-\lambda) f(y) \end{aligned} $$ This completes the induction. Now for each fixed $x$ and $y$ both sides of the inequality $$ f(\lambda x+(1-\lambda) y) \leq \lambda f(x)+(1-\lambda) f(y) $$ are continuous functions of $\lambda$. Hence the set on which this inequality holds (the inverse image of the closed set $[0, \infty)$ under the mapping $\lambda \mapsto \lambda f(x)+(1-$ $\lambda) f(y)-f(\lambda x+(1-\lambda) y))$ is a closed set. Since it contains all the points $\frac{k}{2^n}$, $0 \leq k \leq n, n=1,2, \ldots$, it must contain the closure of this set of points, i.e., it must contain all of $[0,1]$. Thus $f$ is convex. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_4_24 {f : ℝ β†’ ℝ} (hf : Continuous f) (a b : ℝ) (hab : a < b) (h : βˆ€ x y : ℝ, a < x β†’ x < b β†’ a < y β†’ y < b β†’ f ((x + y) / 2) ≀ (f x + f y) / 2) : ConvexOn ℝ (Set.Ioo a b) f :=
Rudin|exercise_5_2
Suppose $f^{\prime}(x)>0$ in $(a, b)$. Prove that $f$ is strictly increasing in $(a, b)$, and let $g$ be its inverse function. Prove that $g$ is differentiable, and that $g^{\prime}(f(x))=\frac{1}{f^{\prime}(x)} \quad(a<x<b)$.
\begin{proof} For any $c, d$ with $a<c<d<b$ there exists a point $p \in(c, d)$ such that $f(d)-f(c)=f^{\prime}(p)(d-c)>0$. Hence $f(c)<f(d)$ We know from Theorem $4.17$ that the inverse function $g$ is continuous. (Its restriction to each closed subinterval $[c, d]$ is continuous, and that is sufficient.) Now observe that if $f(x)=y$ and $f(x+h)=y+k$, we have $$ \frac{g(y+k)-g(y)}{k}-\frac{1}{f^{\prime}(x)}=\frac{1}{\frac{f(x+h)-f(x)}{h}}-\frac{1}{f^{\prime}(x)} $$ Since we know $\lim \frac{1}{\varphi(t)}=\frac{1}{\lim \varphi(t)}$ provided $\lim \varphi(t) \neq 0$, it follows that for any $\varepsilon>0$ there exists $\eta>0$ such that $$ \left|\frac{1}{\frac{f(x+h)-f(x)}{h}}-\frac{1}{f^{\prime}(x)}\right|<\varepsilon $$ if $0<|h|<\eta$. Since $h=g(y+k)-g(y)$, there exists $\delta>0$ such that $0<|h|<\eta$ if $0<|k|<\delta$. The proof is now complete. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_5_2 {a b : ℝ} {f g : ℝ β†’ ℝ} (hf : βˆ€ x ∈ Set.Ioo a b, deriv f x > 0) (hg : g = f⁻¹) : StrictMonoOn f (Set.Ioo a b) ∧ DifferentiableOn ℝ g (Set.Ioo a b) ∧ βˆ€ x ∈ Set.Ioo a b, deriv g (f x) = 1 / deriv f x :=
Rudin|exercise_5_4
If $C_{0}+\frac{C_{1}}{2}+\cdots+\frac{C_{n-1}}{n}+\frac{C_{n}}{n+1}=0,$ where $C_{0}, \ldots, C_{n}$ are real constants, prove that the equation $C_{0}+C_{1} x+\cdots+C_{n-1} x^{n-1}+C_{n} x^{n}=0$ has at least one real root between 0 and 1.
\begin{proof} Consider the polynomial $$ p(x)=C_0 x+\frac{C_1}{2} x^2+\cdots+\frac{C_{n-1}}{n} x^n+\frac{C_n}{n+1} x^{n+1}, $$ whose derivative is $$ p^{\prime}(x)=C_0+C_1 x+\cdots+C_{n-1} x^{n-1}+C_n x^n . $$ It is obvious that $p(0)=0$, and the hypothesis of the problem is that $p(1)=0$. Hence Rolle's theorem implies that $p^{\prime}(x)=0$ for some $x$ between 0 and 1 . \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_5_4 {n : β„•} (C : β„• β†’ ℝ) (hC : βˆ‘ i in (range (n + 1)), (C i) / (i + 1) = 0) : βˆƒ x, x ∈ (Set.Icc (0 : ℝ) 1) ∧ βˆ‘ i in range (n + 1), (C i) * (x^i) = 0 :=
Rudin|exercise_5_6
Suppose (a) $f$ is continuous for $x \geq 0$, (b) $f^{\prime}(x)$ exists for $x>0$, (c) $f(0)=0$, (d) $f^{\prime}$ is monotonically increasing. Put $g(x)=\frac{f(x)}{x} \quad(x>0)$ and prove that $g$ is monotonically increasing.
\begin{proof} Put $$ g(x)=\frac{f(x)}{x} \quad(x>0) $$ and prove that $g$ is monotonically increasing. By the mean-value theorem $$ f(x)=f(x)-f(0)=f^{\prime}(c) x $$ for some $c \in(0, x)$. Since $f^{\prime}$ is monotonically increasing, this result implies that $f(x)<x f^{\prime}(x)$. It therefore follows that $$ g^{\prime}(x)=\frac{x f^{\prime}(x)-f(x)}{x^2}>0, $$ so that $g$ is also monotonically increasing. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_5_6 {f : ℝ β†’ ℝ} (hf1 : ContinuousOn f (Set.Ici 0)) (hf2 : DifferentiableOn ℝ f (Set.Ioi 0)) (hf3 : f 0 = 0) (hf4 : MonotoneOn (deriv f) (Set.Ioi 0)) : MonotoneOn (Ξ» x => f x / x) (Set.Ioi 0) :=
Rudin|exercise_5_15
Suppose $a \in R^{1}, f$ is a twice-differentiable real function on $(a, \infty)$, and $M_{0}, M_{1}, M_{2}$ are the least upper bounds of $|f(x)|,\left|f^{\prime}(x)\right|,\left|f^{\prime \prime}(x)\right|$, respectively, on $(a, \infty)$. Prove that $M_{1}^{2} \leq 4 M_{0} M_{2} .$
\begin{proof} The inequality is obvious if $M_0=+\infty$ or $M_2=+\infty$, so we shall assume that $M_0$ and $M_2$ are both finite. We need to show that $$ \left|f^{\prime}(x)\right| \leq 2 \sqrt{M_0 M_2} $$ for all $x>a$. We note that this is obvious if $M_2=0$, since in that case $f^{\prime}(x)$ is constant, $f(x)$ is a linear function, and the only bounded linear function is a constant, whose derivative is zero. Hence we shall assume from now on that $0<M_2<+\infty$ and $0<M_0<+\infty$. Following the hint, we need only choose $h=\sqrt{\frac{M_0}{M_2}}$, and we obtain $$ \left|f^{\prime}(x)\right| \leq 2 \sqrt{M_0 M_2}, $$ which is precisely the desired inequality. The case of equality follows, since the example proposed satisfies $$ f(x)=1-\frac{2}{x^2+1} $$ for $x \geq 0$. We see easily that $|f(x)| \leq 1$ for all $x>-1$. Now $f^{\prime}(x)=\frac{4 x}{\left(x^2+1\right)^2}$ for $x>0$ and $f^{\prime}(x)=4 x$ for $x<0$. It thus follows from Exercise 9 above that $f^{\prime}(0)=0$, and that $f^{\prime}(x)$ is continuous. Likewise $f^{\prime \prime}(x)=4$ for $x<0$ and $f^{\prime \prime}(x)=\frac{4-4 x^2}{\left(x^2+1\right)^3}=-4 \frac{x^2-1}{\left(x^2+1\right)^3}$. This shows that $\left|f^{\prime \prime}(x)\right|<4$ for $x>0$ and also that $\lim _{x \rightarrow 0} f^{\prime \prime}(x)=4$. Hence Exercise 9 again implies that $f^{\prime \prime}(x)$ is continuous and $f^{\prime \prime}(0)=4$. On $n$-dimensional space let $\mathbf{f}(x)=\left(f_1(x), \ldots, f_n(x)\right), M_0=\sup |\mathbf{f}(x)|$, $M_1=\sup \left|\mathbf{f}^{\prime}(x)\right|$, and $M_2=\sup \left|\mathbf{f}^{\prime \prime}(x)\right|$. Just as in the numerical case, there is nothing to prove if $M_2=0$ or $M_0=+\infty$ or $M_2=+\infty$, and so we assume $0<M_0<+\infty$ and $0<M_2<\infty$. Let $a$ be any positive number less than $M_1$, let $x_0$ be such that $\left|\mathbf{f}^{\prime}\left(x_0\right)\right|>a$, and let $\mathbf{u}=\frac{1}{\left|\mathbf{f}^{\prime}\left(x_0\right)\right|} \mathbf{f}^{\prime}\left(x_0\right)$. Consider the real-valued function $\varphi(x)=\mathrm{u} \cdot \mathrm{f}(x)$. Let $N_0, N_1$, and $N_2$ be the suprema of $|\varphi(x)|,\left|\varphi^{\prime}(x)\right|$, and $\left|\varphi^{\prime \prime}(x)\right|$ respectively. By the Schwarz inequality we have (since $|\mathbf{u}|=1) N_0 \leq M_0$ and $N_2 \leq M_2$, while $N_1 \geq \varphi\left(x_0\right)=\left|\mathbf{f}^{\prime}\left(x_0\right)\right|>a$. We therefore have $a^2<4 N_0 N_2 \leq 4 M_0 M_2$. Since $a$ was any positive number less than $M_1$, we have $M_1^2 \leq 4 M_0 M_2$, i.e., the result holds also for vector-valued functions. Equality can hold on any $R^n$, as we see by taking $\mathbf{f}(x)=(f(x), 0, \ldots, 0)$ or $\mathbf{f}(x)=(f(x), f(x), \ldots, f(x))$, where $f(x)$ is a real-valued function for which equality holds. \end{proof}
import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators
theorem exercise_5_15 {f : ℝ β†’ ℝ} (a M0 M1 M2 : ℝ) (hf' : DifferentiableOn ℝ f (Set.Ioi a)) (hf'' : DifferentiableOn ℝ (deriv f) (Set.Ioi a)) (hM0 : M0 = sSup {(|f x|) | x ∈ (Set.Ioi a)}) (hM1 : M1 = sSup {(|deriv f x|) | x ∈ (Set.Ioi a)}) (hM2 : M2 = sSup {(|deriv (deriv f) x|) | x ∈ (Set.Ioi a)}) : (M1 ^ 2) ≀ 4 * M0 * M2 :=
Shakarchi|exercise_1_13a
Suppose that $f$ is holomorphic in an open set $\Omega$. Prove that if $\text{Re}(f)$ is constant, then $f$ is constant.
\begin{proof} Let $f(z)=f(x, y)=u(x, y)+i v(x, y)$, where $z=x+i y$. Since $\operatorname{Re}(f)=$ constant, $$ \frac{\partial u}{\partial x}=0, \frac{\partial u}{\partial y}=0 . $$ By the Cauchy-Riemann equations, $$ \frac{\partial v}{\partial x}=-\frac{\partial u}{\partial y}=0 . $$ Thus, in $\Omega$, $$ f^{\prime}(z)=\frac{\partial f}{\partial x}=\frac{\partial u}{\partial x}+i \frac{\partial v}{\partial x}=0+0=0 . $$ 3 Thus $f(z)$ is constant. \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_1_13a {f : β„‚ β†’ β„‚} (Ξ© : Set β„‚) (a b : Ξ©) (h : IsOpen Ξ©) (hf : DifferentiableOn β„‚ f Ξ©) (hc : βˆƒ (c : ℝ), βˆ€ z ∈ Ξ©, (f z).re = c) : f a = f b :=
Shakarchi|exercise_1_13c
Suppose that $f$ is holomorphic in an open set $\Omega$. Prove that if $|f|$ is constant, then $f$ is constant.
\begin{proof} Let $f(z)=f(x, y)=u(x, y)+i v(x, y)$, where $z=x+i y$. We first give a mostly correct argument; the reader should pay attention to find the difficulty. Since $|f|=\sqrt{u^2+v^2}$ is constant, $$ \left\{\begin{array}{l} 0=\frac{\partial\left(u^2+v^2\right)}{\partial x}=2 u \frac{\partial u}{\partial x}+2 v \frac{\partial v}{\partial x} . \\ 0=\frac{\partial\left(u^2+v^2\right)}{\partial y}=2 u \frac{\partial u}{\partial y}+2 v \frac{\partial v}{\partial y} . \end{array}\right. $$ Plug in the Cauchy-Riemann equations and we get $$ \begin{gathered} u \frac{\partial v}{\partial y}+v \frac{\partial v}{\partial x}=0 \\ -u \frac{\partial v}{\partial x}+v \frac{\partial v}{\partial y}=0 \\ (1.14) \Rightarrow \frac{\partial v}{\partial x}=\frac{v}{u} \frac{\partial v}{\partial y} \end{gathered} $$ Plug (1.15) into (1.13) and we get $$ \frac{u^2+v^2}{u} \frac{\partial v}{\partial y}=0 . $$ So $u^2+v^2=0$ or $\frac{\partial v}{\partial y}=0$. If $u^2+v^2=0$, then, since $u, v$ are real, $u=v=0$, and thus $f=0$ which is constant. Thus we may assume $u^2+v^2$ equals a non-zero constant, and we may divide by it. We multiply both sides by $u$ and find $\frac{\partial v}{\partial y}=0$, then by (1.15), $\frac{\partial v}{\partial x}=0$, and by Cauchy-Riemann, $\frac{\partial u}{\partial x}=0$. $$ f^{\prime}=\frac{\partial f}{\partial x}=\frac{\partial u}{\partial x}+i \frac{\partial v}{\partial x}=0 . $$ Thus $f$ is constant. Why is the above only mostly a proof? The problem is we have a division by $u$, and need to make sure everything is well-defined. Specifically, we need to know that $u$ is never zero. We do have $f^{\prime}=0$ except at points where $u=0$, but we would need to investigate that a bit more. Let's return to $$ \left\{\begin{array}{l} 0=\frac{\partial\left(u^2+v^2\right)}{\partial x}=2 u \frac{\partial u}{\partial x}+2 v \frac{\partial v}{\partial x} . \\ 0=\frac{\partial\left(u^2+v^2\right)}{\partial y}=2 u \frac{\partial u}{\partial y}+2 v \frac{\partial v}{\partial y} . \end{array}\right. $$ Plug in the Cauchy-Riemann equations and we get $$ \begin{array}{r} u \frac{\partial v}{\partial y}+v \frac{\partial v}{\partial x}=0 \\ -u \frac{\partial v}{\partial x}+v \frac{\partial v}{\partial y}=0 . \end{array} $$ We multiply the first equation $u$ and the second by $v$, and obtain $$ \begin{aligned} u^2 \frac{\partial v}{\partial y}+u v \frac{\partial v}{\partial x} & =0 \\ -u v \frac{\partial v}{\partial x}+v^2 \frac{\partial v}{\partial y} & =0 . \end{aligned} $$ Adding the two yields $$ u^2 \frac{\partial v}{\partial y}+v^2 \frac{\partial v}{\partial y}=0, $$ or equivalently $$ \left(u^2+v^2\right) \frac{\partial v}{\partial y}=0 . $$ We now argue in a similar manner as before, except now we don't have the annoying $u$ in the denominator. If $u^2+v^2=0$ then $u=v=0$, else we can divide by $u^2+v^2$ and find $\partial v / \partial y=0$. Arguing along these lines finishes the proof. \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_1_13c {f : β„‚ β†’ β„‚} (Ξ© : Set β„‚) (a b : Ξ©) (h : IsOpen Ξ©) (hf : DifferentiableOn β„‚ f Ξ©) (hc : βˆƒ (c : ℝ), βˆ€ z ∈ Ξ©, abs (f z) = c) : f a = f b :=
Shakarchi|exercise_1_19b
Prove that the power series $\sum z^n/n^2$ converges at every point of the unit circle.
\begin{proof} Since $\left|z^n / n^2\right|=1 / n^2$ for all $|z|=1$, then $\sum z^n / n^2$ converges at every point in the unit circle as $\sum 1 / n^2$ does ( $p$-series $p=2$.) \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_1_19b (z : β„‚) (hz : abs z = 1) (s : β„• β†’ β„‚) (h : s = (Ξ» n => βˆ‘ i in (range n), z ^ (i + 1) / (i + 1) ^ 2)) : βˆƒ y, Tendsto s atTop (𝓝 y) :=
Shakarchi|exercise_1_26
Suppose $f$ is continuous in a region $\Omega$. Prove that any two primitives of $f$ (if they exist) differ by a constant.
\begin{proof} Suppose $F_1$ adn $F_2$ are primitives of $F$. Then $(F_1-F_2)^\prime = f - f = 0$, therefore $F_1$ and $F_2$ differ by a constant. \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_1_26 (f F₁ Fβ‚‚ : β„‚ β†’ β„‚) (Ξ© : Set β„‚) (h0 : Nonempty Ξ©) (h1 : IsOpen Ξ©) (h2 : IsConnected Ξ©) (hf : ContinuousOn f Ξ©) (hF₁ : DifferentiableOn β„‚ F₁ Ξ©) (hFβ‚‚ : DifferentiableOn β„‚ Fβ‚‚ Ξ©) (hdF₁ : βˆ€ x ∈ Ξ©, deriv F₁ x = f x) (hdFβ‚‚ : βˆ€ x ∈ Ξ©, deriv Fβ‚‚ x = f x) : βˆƒ c : β„‚, βˆ€ x, F₁ x = Fβ‚‚ x + c :=
Shakarchi|exercise_2_9
Let $\Omega$ be a bounded open subset of $\mathbb{C}$, and $\varphi: \Omega \rightarrow \Omega$ a holomorphic function. Prove that if there exists a point $z_{0} \in \Omega$ such that $\varphi\left(z_{0}\right)=z_{0} \quad \text { and } \quad \varphi^{\prime}\left(z_{0}\right)=1$ then $\varphi$ is linear.
\begin{proof} When $\Omega$ is connected, if $\varphi$ is not linear, then there exists $n \geq 2$ and $a_n \neq 0$, such that $$ \varphi(z)=z+a_n\left(z-z_0\right)^n+O\left(\left(z-z_0\right)^{n+1}\right) . $$ As you have noticed, by induction, it follows that for every $k \geq 1$, $$ \varphi^k(z)=z+k a_n\left(z-z_0\right)^n+O\left(\left(z-z_0\right)^{n+1}\right) . $$ Let $r>0$ be such that when $\left|z-z_0\right| \leq r$, then $z \in \Omega$. Then by (1), $$ k a_n=\frac{1}{2 \pi i} \int_{\left|z-z_0\right|=r} \frac{\varphi^k(z)}{\left(z-z_0\right)^{n+1}} d z . $$ Since $\varphi^k(\Omega) \subset \Omega$ and since $\Omega$ is bounded, there exists $M>0$, independent of $k$, such that $\left|\varphi^k\right| \leq M$ on $\Omega$. Then by (2), $$ k\left|a_n\right| \leq M r^{-n} . $$ Since $k$ is arbitrary, $a_n=0$, a contradiction. \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_2_9 {f : β„‚ β†’ β„‚} (Ξ© : Set β„‚) (b : Bornology.IsBounded Ξ©) (h : IsOpen Ξ©) (hf : DifferentiableOn β„‚ f Ξ©) (z : Ξ©) (hz : f z = z) (h'z : deriv f z = 1) : βˆƒ (f_lin : β„‚ β†’L[β„‚] β„‚), βˆ€ x ∈ Ξ©, f x = f_lin x :=
Shakarchi|exercise_3_3
Show that $ \int_{-\infty}^{\infty} \frac{\cos x}{x^2 + a^2} dx = \pi \frac{e^{-a}}{a}$ for $a > 0$.
\begin{proof} $\cos x=\frac{e^{i x}+e^{-i x}}{2}$. changing $x \rightarrow-x$ we see that we can just integrate $e^{i x} /\left(x^2+a^2\right)$ and we'll get the same answer. Again, we use the same semicircle and part of the real line. The only pole is $x=i a$, it has order 1 and the residue at it is $\lim _{x \rightarrow i a} \frac{e^{i x}}{x^2+a^2}(x-i a)=\frac{e^{-a}}{2 i a}$, which multiplied by $2 \pi i$ gives the answer. \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_3_3 (a : ℝ) (ha : 0 < a) : Tendsto (Ξ» y => ∫ x in -y..y, Real.cos x / (x ^ 2 + a ^ 2)) atTop (𝓝 (Real.pi * (Real.exp (-a) / a))) :=
Shakarchi|exercise_3_9
Show that $\int_0^1 \log(\sin \pi x) dx = - \log 2$.
\begin{proof} Consider $$ \begin{gathered} f(z)=\log \left(1-e^{2 \pi z i}\right)=\log \left(e^{\pi z i}\left(e^{-\pi z i}-e^{\pi z i}\right)\right)=\log (-2 i)+\pi z i+\log \\ (\sin (\pi z)) \end{gathered} $$ Then we have $$ \begin{aligned} \int_0^1 f(z) d z & =\log (-2 i)+\frac{i \pi}{2}+\int_0^1 \log (\sin (\pi z)) d z \\ & =\int_0^1 \log (\sin (\pi z)) d z+\log (-2 i)+\log (i) \\ & =\log (2)+\int_0^1 \log (\sin (\pi z)) d z \end{aligned} $$ Now it suffices to show that $\int_0^1 f(z) d z=0$. Consider the contour $C(\epsilon, R)$ (which is the contour given in your question) given by the following. 1. $C_1(\epsilon, R)$ : The vertical line along the imaginary axis from $i R$ to $i \epsilon$. 2. $C_2(\epsilon)$ : The quarter turn of radius $\epsilon$ about 0 . 3. $C_3(\epsilon)$ : Along the real axis from $(\epsilon, 1-\epsilon)$. 4. $C_4(\epsilon)$ : The quarter turn of radius $\epsilon$ about 1 . 5. $C_5(\epsilon, R)$ : The vertical line from $1+i \epsilon$ to $1+i R$. 6. $C_6(R)$ : The horizontal line from $1+i R$ to $i R$. $f(z)$ is analytic inside the contour $C$ and hence $\oint_C f(z)=0$. This gives us $$ \begin{aligned} \int_{C_1(\epsilon, R)} f d z+\int_{C_2(\epsilon)} f d z+\int_{C_3(\epsilon)} f d z+\int_{C_4(\epsilon)} f d z+\int_{C_5(\epsilon, R)} f d z+\int_{C_6(R)} f d z \\ =0 \end{aligned} $$ Now the integral along 1 cancels with the integral along 5 due to symmetry. Integrals along 2 and 4 scale as $\epsilon \log (\epsilon)$. Integral along 6 goes to 0 as $R \rightarrow \infty$. This gives us $$ \lim _{\epsilon \rightarrow 0} \int_{C_3(\epsilon)} f d z=0 $$ which is what we need. \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_3_9 : ∫ x in (0 : ℝ)..(1 : ℝ), Real.log (Real.sin (Real.pi * x)) = - Real.log 2 :=
Shakarchi|exercise_3_22
Show that there is no holomorphic function $f$ in the unit disc $D$ that extends continuously to $\partial D$ such that $f(z) = 1/z$ for $z \in \partial D$.
\begin{proof} Consider $g(r)=\int_{|z|=r} f(z) d z$. Cauchy theorem implies that $g(r)=0$ for all $r<1$. Now since $\left.f\right|_{\partial D}=1 / z$ we have $\lim _{r \rightarrow 1} \int_{|z|=r} f(z) d z=\int_{|z|=1} \frac{1}{z} d z=\frac{2}{\pi i} \neq 0$. Contradiction. \end{proof}
import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology
theorem exercise_3_22 (D : Set β„‚) (hD : D = ball 0 1) (f : β„‚ β†’ β„‚) (hf : DifferentiableOn β„‚ f D) (hfc : ContinuousOn f (closure D)) : Β¬ βˆ€ z ∈ (sphere (0 : β„‚) 1), f z = 1 / z :=