analysis
Sets, functions & cardinality, proof technique, axioms of the numbers, construction of the reals, sequences & convergence, open & closed sets.
sets & functions · cardinality · proof technique · axioms of the numbers · the reals · sequences & series · open & closed sets
Sets, relations & functions
Sets. A set is a collection of objects; \(x\in A\) / \(x\notin A\) for membership. Roster \(\{1,2,3\}\), ellipsis \(\{1,2,\ldots,1000\}\), set-builder \(\{n\mid n\in\Z,\ 1\le n\le 1000\}\) (the bar — some write a colon — reads "such that"); \(\varnothing\) contains nothing. \(A=B\) iff same elements; \(A\subset B\) iff every \(x\in A\) is in \(B\); proper subset \(A\subsetneq B\). Key: \(A=B\iff A\subset B\) and \(B\subset A\).
Algebra of sets. \(A\cup B=\{x\mid x\in A\text{ or }x\in B\}\); \(A\cap B=\{x\mid x\in A\text{ and }x\in B\}\); difference \(A\setminus B=\{x\mid x\in A,\ x\notin B\}\); complement \({}^{c}B=X\setminus B\) for \(B\subset X\); symmetric difference \(A\,\Delta\,B=(A\setminus B)\cup(B\setminus A)\). Union and intersection commute, difference does not. Distributivity \(A\cap(B\cup C)=(A\cap B)\cup(A\cap C)\); De Morgan \({}^{c}(A\cup B)={}^{c}A\cap{}^{c}B\) (and dually).
Recipe — proving two sets equal. Element-chase: \(x\in\) LHS iff … iff \(x\in\) RHS, unwinding each operation into its defining "and/or/not" condition; or prove the inclusions \(\subset\) and \(\supset\) separately. Mix symbols with words — the reader is human.
Cartesian product & relations. \(A\times B=\{(a,b)\mid a\in A,\ b\in B\}\); set-theoretically \((a,b)=\{\{a\},\{a,b\}\}\), and \((a,b)=(a',b')\) iff \(a=a'\), \(b=b'\). A relation on \(X\) is any subset \(\mathcal R\subset X\times X\) (the order \(a\lt b\), orthogonality of unit vectors, …). Equivalence relation: reflexive \((x,x)\in\mathcal R\), symmetric, transitive; write \(x\sim y\). Examples: same parity on \(\Z\), same sign on \(\Z\setminus\{0\}\), congruence mod \(n\).
Equivalence classes. \([a]=\{b\in X\mid a\sim b\}\); \(a\in[a]\); \([a]=[b]\iff a\sim b\); two classes are equal or disjoint and their union is \(X\) — an equivalence relation partitions the set. Quotient set \(X/\!\sim\;=\{[a]\mid a\in X\}\): sign gives \(\{+,-\}\); mod \(n\) gives the \(n\) classes \(\{0,1,\ldots,n-1\}\).
Functions. \(f\colon A\to B\) is a subset of \(A\times B\) in which each \(a\in A\) occurs exactly once as first coordinate; write \(f(a)=b\). Domain \(A\), target \(B\), image \(f(A')=\{f(a)\mid a\in A'\}\), preimage \(f^{-1}(b)=\{x\mid f(x)=b\}\), \(f^{-1}(B')\). Injective: \(f(a_1)=f(a_2)\Rightarrow a_1=a_2\); surjective: every \(b\in B\) is an image; bijective: both. Both depend on the declared domain and target, not the formula: \(x\mapsto x^2\) is neither on \(\R\to\R\) but a bijection on \(\R^+\to\R^+\). Identity \(\mathrm{Id}(x)=x\); inclusion \(A\hookrightarrow B\) for \(A\subset B\); composition \((g\circ f)(a)=g(f(a))\).
Russell's paradox. Unrestricted set-building breaks: \(A=\{a\mid a\text{ is a set},\ a\notin a\}\) forces \(A\in A\iff A\notin A\) (the barber who cuts the hair of exactly those who don't cut their own). Resolution: axiomatise which sets exist — ZFC, Zermelo–Fraenkel with choice.
Cardinality
Finite counting. \(\#A\) = number of elements. Two primitive facts: a bijection \(A\to B\) gives \(\#A=\#B\); \(A\cap B=\varnothing\) gives \(\#(A\cup B)=\#A+\#B\). Inclusion–exclusion: \(\#(A\cup B)=\#A+\#B-\#(A\cap B)\) (decompose into disjoint pieces). An injection \(A\to B\) gives \(\#A\le\#B\).
Pigeonhole. \(\#A=m\), \(\#B=n\), \(f\colon A\to B\): some \(b\) has \(\#f^{-1}(b)\ge\lceil m/n\rceil\), where \(\lceil x\rceil\) is the least integer \(\ge x\). By contradiction: fibres are disjoint and cover \(A\), so if all were smaller, \(\#A=\sum_i\#f^{-1}(b_i)\lt n\cdot\tfrac mn=m\).
Infinite cardinality. \(\#A=\#B\) iff a bijection exists; \(\#A\le\#B\) iff an injection exists; \(\#A\lt\#B\) iff an injection but no surjection exists. Schröder–Bernstein: injections both ways give a bijection, so \(\#A\le\#B\) and \(\#B\le\#A\Rightarrow\#A=\#B\). A proper subset can have full cardinality: \(x\mapsto2x\) shows \(\#(\text{evens})=\#\Z\); interleaving shows \(\#\Z^+=\#\Z\).
Countability. \(A\) countable iff finite or \(\#A=\#\Z^+\), iff its elements can be listed as a sequence \(a_1,a_2,a_3,\ldots\) Every nonempty subset of a countable set is countable (well-ordering picks an increasing enumeration). \(\Q\) is countable: arrange the positive fractions \(p/q\) in a grid, walk Cantor's zigzag diagonal path, skip duplicates; interleave negatives. The same path shows a countable union of countable sets is countable.
Recipe — Cantor's diagonal. \(\R\) is uncountable. Suppose \([0,1)\) were listed; write each entry as an infinite decimal \(a_i=0.a_{i1}a_{i2}a_{i3}\cdots\); build \(b=0.b_1b_2b_3\cdots\) with \(b_i\ne a_{ii}\) and \(b_i\ne9\) (avoids the double expansion \(0.999\cdots=1.000\cdots\)). Then \(b\) differs from every \(a_i\) at digit \(i\) — no list is complete. The trick refutes any claimed enumeration.
Proof technique & induction
Anatomy of a proof. A proof is an inferential argument showing the assumptions logically guarantee the conclusion — written for a human. Recipe: translate the claim into quantified symbols (\(\forall\), \(\exists\), \(\Rightarrow\), \(\iff\)); announce the goal; write down the hypothesis in hand; one derivation per step, naming the axiom or property that licenses it; conclude by stating what was proved. \(P\Rightarrow Q\): \(P\) sufficient for \(Q\), \(Q\) necessary for \(P\). "Iff" is two implications — prove each direction and say which one you are in.
Contradiction & contrapositive. Contradiction: announce it, assume the negation of the goal, use it as an extra hypothesis, derive an absurdity (typically against trichotomy or a least/greatest choice); conclude the negation fails. Contrapositive: \(P\Rightarrow Q\) is equivalent to \(\lnot Q\Rightarrow\lnot P\) — use it when the negated statements are easier to manipulate.
Well-definedness. Anything defined through representatives of equivalence classes must be checked independent of the choice: for \(\Q\), \(\frac ab+\frac cd=\frac{ad+bc}{bd}\) requires \((a,b)\sim(a',b')\), \((c,d)\sim(c',d')\Rightarrow(ad+bc,\,bd)\sim(a'd'+b'c',\,b'd')\) — verified from \(ab'=a'b\), \(cd'=c'd\).
Induction. For statements \(\mathcal P(n)\), \(n\in\Z^+\): base \(\mathcal P(1)\), step \(\mathcal P(n)\Rightarrow\mathcal P(n+1)\); the induction axiom yields all \(n\). Notation \(\sum_{i=m}^{n}a_i=a_m+\cdots+a_n\), \(\prod\) for products. Model example: \(\sum_{i=1}^{n}i=\frac{n(n+1)}2\) — base \(1=1\), step adds \(n+1\) to both sides. Strong induction: assume \(\mathcal P(1),\ldots,\mathcal P(n)\) to prove \(\mathcal P(n+1)\) (equivalent to ordinary). Shifted base: start at \(k\) to cover all \(n\ge k\). A step reaching back \(r\) terms needs \(r\) base cases: Binet's \(F_n=\frac{\varphi^n-\psi^n}{\varphi-\psi}\), \(\varphi,\psi=\frac{1\pm\sqrt5}2\) (via \(\varphi^2=1+\varphi\), \(\psi^2=1+\psi\)) uses \(\mathcal P(n-1)\) and \(\mathcal P(n)\), so both \(F_0\), \(F_1\) must be checked.
The broken link. Pólya's fake proof that "any \(n\) numbers are equal": the step overlaps \(a_1=\cdots=a_n\) with \(a_2=\cdots=a_{n+1}\), which fails at \(n=1\) — the blocks don't overlap, so \(\mathcal P(1)\) does not give \(\mathcal P(2)\). Induction proves nothing unless every link of the chain holds.
Axioms of the numbers
Axioms of the integers. \(\Z\) with \(+\), \(\cdot\), \(\lt\): addition associative, commutative, identity \(0\), inverses \(-a\); multiplication associative, commutative, identity \(1\ne0\) but no inverses (\(1=0\) would collapse \(\Z\) to \(\{0\}\)); distributivity \(a(b+c)=ab+ac\); order — trichotomy (exactly one of \(a\lt b\), \(a=b\), \(b\lt a\)), transitivity, \(a\lt b\Rightarrow a+c\lt b+c\), and \(a\lt b\), \(0\lt c\Rightarrow ac\lt bc\). The four order axioms are mutually independent. \(\Z^+=\{a\mid a\gt0\}\); \(a\le b\) iff \(a\lt b\) or \(a=b\).
The extra axiom. The twelve above cannot rule out an "integer" \(\tau\) with \(0\lt\tau\lt1\); a thirteenth pins \(\Z\) down (Peano-style). Induction property: \(S\subset\Z^+\), \(1\in S\), \(s\in S\Rightarrow s+1\in S\) imply \(S=\Z^+\). Equivalent: well-ordering — every nonempty \(S\subset\Z^+\) has a least element. Either gives \(1\le a\) for all \(a\in\Z^+\).
Consequences. \(0\), \(1\) and each \(-a\) are unique; additive cancellation \(a+b=a+c\Rightarrow b=c\) (add \(-a\)); \(a\cdot0=0\); \((-1)\cdot a=-a\); same signs multiply to positive, opposite to negative; \(1\gt0\); \(ab\gt0\), \(a\gt0\Rightarrow b\gt0\) (contradiction via trichotomy). Multiplicative cancellation does not follow from the ring axioms alone (no inverses) — it needs the order structure.
Rationals as a quotient. Fractions \(\mathcal F=\{(a,b)\in\Z\times\Z\mid b\ne0\}\) with \((a,b)\sim(c,d)\iff ad=bc\); \(\Q:=\mathcal F/\!\sim\), writing \(\frac ab\) for \([(a,b)]\) — a rational number is an equivalence class. \(\frac ab+\frac cd=\frac{ad+bc}{bd}\), \(\frac ab\cdot\frac cd=\frac{ac}{bd}\), both well-defined. All \(\Z\)-axioms survive plus multiplicative inverses \(\bigl(\frac ab\bigr)^{-1}=\frac ba\) for \(\frac ab\ne0\): with the first nine properties a set is a commutative ring, with inverses a field. Positivity \(\frac ab\gt0\iff ab\gt0\) (well-defined); \(x\lt y\iff y-x\gt0\) satisfies the four order axioms — \(\Q\) is an ordered field. \(\Z\hookrightarrow\Q\) by \(a\mapsto\frac a1\).
Irrational numbers. \(k\) divides \(n\) iff \(n=km\) (finitely many divisors, since \(|k|\le|n|\)); a prime \(p\ne\pm1\) has only divisors \(\pm1,\pm p\); Euclid's lemma: \(p\mid ab\Rightarrow p\mid a\) or \(p\mid b\); \(m,n\) coprime iff only common divisors \(\pm1\); every fraction has a coprime representative (divide out the greatest common divisor). No rational \(c\) has \(c^2=2\): take \(c=\frac ab\) coprime; \(a^2=2b^2\) forces \(a\) even (odd squares are odd), \(a=2d\) gives \(b^2=2d^2\), so \(b\) even too — contradicting coprimality. So Pythagoras' diagonal of the unit square is no rational length: the numbers must be extended again.
The real numbers
Bounds, sup & inf. In an ordered field: \(M\) is an upper bound of \(A\) iff \(a\le M\) for all \(a\in A\) (\(A\) bounded from above); \(\sup A\) = least upper bound (supremum), \(\inf A\) = greatest lower bound (infimum). \(\sup\{x\in\Q\mid x\le q\}=\sup\{x\in\Q\mid x\lt q\}=q\); \(\sup\{1-\frac1n\}=1\notin\) the set — the supremum need not belong. \(\Q\) fails to have suprema: \(\{a\in\Q\mid a^2\lt2,\ a\gt0\}\) has none in \(\Q\) — any candidate \(L\) with \(L^2\lt2\) is beaten by some \(L+\frac1N\) still in the set, any \(L\) with \(L^2\gt2\) by the smaller upper bound \(L-\frac1N\).
Definition of the reals. \(\R\) := an ordered field with the least-upper-bound property: every subset bounded from above has a supremum (Dedekind's idea — complete \(\Q\) with the "precise values" that better and better approximations, e.g. bisection, point at). Suprema are unique. Existence of \(\sqrt2\): \(L=\sup\{a\in\R\mid a^2\lt2\}\) has \(L^2=2\), since either strict inequality is refuted by nudging to \(L\pm\frac1N\) (Archimedes supplies \(N\)) and contradicting upper-bound-ness or leastness.
Recipe — approximation theorem. An upper bound \(L\) equals \(\sup A\) iff for every \(\varepsilon\gt0\) there is \(a\in A\) with \(0\le L-a\lt\varepsilon\): the supremum is approximated from inside the set. To prove \(L=\sup A\): show upper bound, then given \(\varepsilon\) exhibit the element (usually via the Archimedean property). To refute: produce the smaller upper bound \(L-\varepsilon\).
Archimedean property. For \(a\gt0\) the set \(\{na\mid n\in\Z^+\}\) is unbounded (a supremum \(L\) would make \(L-a\) a smaller upper bound); hence for \(a,b\gt0\) there is \(N\) with \(Na\gt b\), and for any \(\varepsilon\gt0\) an \(N\) with \(\frac1N\lt\varepsilon\). Same trick with \(a^{-1}L\): for \(a\gt1\), \(b\gt0\) there is \(N\) with \(a^N\gt b\). Denseness of \(\Q\) in \(\R\): between any reals \(a\lt b\) lies a rational — pick \(\frac1N\lt b-a\), let \(\frac KN\) be the largest multiple \(\le a\) (a sup argument), then \(a\lt\frac{K+1}N\lt b\).
The real line & decimals. Geometrically \(\R\) is a line, increasing rightward; distance \(=|a-b|\), where \(|x|=x\) if \(x\ge0\) and \(-x\) otherwise; \(\sup A\) is where an upper bound pushed left "touches" \(A\). Finite decimal \(b.a_1a_2\cdots a_k=b+\sum_i a_i/10^{i}\); infinite decimal \(b.a_1a_2a_3\cdots:=\sup\{b.a_1,\ b.a_1a_2,\ b.a_1a_2a_3,\ldots\}\) (negatives via \(-\)). So \(0.999\cdots=\sup\{1-10^{-N}\}=1\): decimal expansions are not unique. Generally a sum of nonnegative terms \(\sum_{k=1}^{\infty}x_k\) := the sup of its partial sums, when bounded.
Geometric series. From \(xS_k=S_k+x^{k+1}-1\), \[\sum_{i=0}^{k}x^i=\frac{1-x^{k+1}}{1-x}\quad(x\ne1),\qquad \sum_{i=0}^{\infty}x^i=\frac{1}{1-x}\quad(|x|\lt1),\] the sum being the least upper bound: \(a^N\gt b\) for \(a\gt1\) drives the tail \(\frac{x^{k+1}}{1-x}\) below any \(\varepsilon\), then apply the approximation theorem.
Sequences, series & convergence
Intervals & neighbourhoods. \((a,b)\), \([a,b]\), half-open \((a,b]\), \([a,b)\), infinite \((a,\infty)\), \((-\infty,b]\), \(\R=(-\infty,\infty)\); length \(b-a\); for \(a\le c\lt d\le b\), \((c,d)\subset(a,b)\subset[a,b]\) and \([c,d]\subset[a,b]\). A neighbourhood of \(x\) is an open interval containing \(x\); the symmetric ones are \((x-\varepsilon,x+\varepsilon)\).
Accumulation points. \(x\) is an accumulation point of a set \(A\) iff every neighbourhood of \(x\) meets \(A\): \(\forall\varepsilon\gt0\), \(A\cap(x-\varepsilon,x+\varepsilon)\ne\varnothing\) (e.g. \(0\) for \(\{\frac1N\mid N\in\Z^+\}\), by Archimedes). A sequence \((a_k)_{k\in\Z^+}\) — formally a function \(\Z^+\to\R\); order matters, repeats allowed — has accumulation point \(x\) iff every \((x-\varepsilon,x+\varepsilon)\) contains \(a_k\) for infinitely many \(k\): \(\forall\varepsilon\gt0\), \(\forall n\), \(\exists k\gt n\) with \(|a_k-x|\lt\varepsilon\).
Limit of a sequence. \[\lim_{k\to\infty}a_k=x \iff \forall\varepsilon\gt0\ \exists N\in\Z^+:\ n\gt N\Rightarrow|a_n-x|\lt\varepsilon.\] Convergent = has a limit: all but finitely many terms within every \(\varepsilon\). \(\frac1k\to0\); \(((-1)^k)\) has accumulation points \(\pm1\) and no limit. Recipe: given \(\varepsilon\gt0\), produce \(N\) explicitly (usually from the Archimedean property), then verify the bound for every \(n\gt N\).
Convergence theorems. Monotone convergence: increasing and bounded above \(\Rightarrow\) converges to its supremum (approximation puts \(a_N\) within \(\varepsilon\); monotonicity keeps the tail there); dually decreasing \(\to\) infimum. Nested intervals: closed \(I_1\supset I_2\supset\cdots\) have \(\bigcap_k I_k=[\lim a_k,\ \lim b_k]\ne\varnothing\). Bolzano–Weierstrass: any sequence in \([A,B]\) has an accumulation point — bisect, keep a half holding infinitely many terms, nest, intersect. Cauchy sequence: \(\forall\varepsilon\gt0\ \exists N\): \(m,n\gt N\Rightarrow|a_m-a_n|\lt\varepsilon\). Cauchy criterion: convergent \(\iff\) Cauchy (forward: \(\varepsilon/2\) split with the triangle inequality \(|a+b|\le|a|+|b|\); back: Cauchy \(\Rightarrow\) bounded, Bolzano–Weierstrass gives a convergent subsequence, Cauchyness drags the whole tail along). It certifies convergence without naming the limit.
Series & convergence tests. \(\sum_{k=1}^{\infty}x_k:=\lim S_k\) with partial sums \(S_k=\sum_{i=1}^{k}x_i\) (for nonnegative terms this matches the sup definition, by monotone convergence). Absolutely convergent: \(\sum|x_k|\) converges; implies convergent since \(|S_m-S_n|\le\sum_{i=n+1}^{m}|x_i|\lt\varepsilon\) transfers the Cauchy property. Comparison: \(|x_k|\le|y_k|\) with \(\sum y_k\) absolutely convergent \(\Rightarrow\sum x_k\) absolutely convergent (same transfer). Ratio-domination: \(|x_{k+1}|\le a|x_k|\) with \(0\lt a\lt1\Rightarrow\) absolute convergence (induction gives \(|x_k|\le a^{k-1}|x_1|\), compare geometric). Harmonic \(\sum\frac1k\) diverges: dyadic blocks give \(S_{2^m}\ge\frac m2\), unbounded. Leibniz: \(a_k\) decreasing with \(a_k\to0\Rightarrow\sum(-1)^{k+1}a_k\) converges (even partial sums increase, odd decrease, the gap \(a_{2n}\to0\) forces one common limit); \(1-\frac12+\frac13-\cdots\) converges (to \(\ln2\)) but not absolutely.
Polynomials. Functions into \(\R\) combine pointwise: \((f+g)(x)=f(x)+g(x)\), \((f\cdot g)(x)=f(x)g(x)\), \(\frac1f\) where \(f\ne0\). From constants and \(\mathrm{Id}\): polynomial \(p(x)=\sum_{i=0}^{k}a_ix^i\) with \(a_k\ne0\), degree \(k\), coefficients \(a_i\). \(\deg(pq)=\deg p+\deg q\) (leading coefficient \(a_kb_l\ne0\)); a zero is \(a\) with \(p(a)=0\); a degree-\(k\) polynomial has at most \(k\) zeros.
Function series. \(\sum f_k\) is a function on the set where \(\sum f_k(y)\) converges: \(\sum_{k=1}^{\infty}x^{k-1}=\frac1{1-x}\) on \((-1,1)\). With \(n!=\prod_{i=1}^{n}i\), \(0!=1\), define \[e^x=\sum_{k=0}^{\infty}\frac{x^k}{k!},\qquad \sin x=\sum_{k=1}^{\infty}\frac{(-1)^{k+1}x^{2k-1}}{(2k-1)!},\qquad \cos x=\sum_{k=0}^{\infty}\frac{(-1)^{k}x^{2k}}{(2k)!},\] all defined on the whole of \(\R\): once \(k\gt2|x|\) each further term at least halves, so \(\frac{|x|^k}{k!}\le\frac{M}{2^k}\) for a suitable \(M\) (induction), and comparison with the geometric series gives absolute convergence. These are Taylor series.
Complex numbers. The algebra of \(\C\) — cartesian and polar forms, conjugate \(\bar z\), modulus \(|z|\), Euler's formula, De Moivre — lives at complex numbers. What the analysis adds: \(\C\) constructed as \(\R\times\R\) with \((a,b)+(c,d)=(a+c,b+d)\), \((a,b)\cdot(c,d)=(ac-bd,ad+bc)\) is a field, \(\mathrm i=(0,1)\), \(\mathrm i^2=-1\); \(z_k\to Z\) iff real and imaginary parts converge separately; multiplication by \(\mathrm i\) rotates the complex plane \(90^\circ\) counter-clockwise about \(0\); \(e^{\mathrm i\theta}=\cos\theta+\mathrm i\sin\theta\) falls out of the three series formally. Fundamental theorem of algebra (d'Alembert–Gauss): a degree-\(k\) polynomial over \(\C\) has exactly \(k\) zeros with multiplicity, \(p(z)=a_k(z-z_1)\cdots(z-z_k)\). Euler's leap — factor \(\sin\) over its zeros \(k\pi\) as if it were a polynomial, fix the constant from the Taylor series, compare the \(z^3\) coefficients: \[\sin z=z\prod_{k=1}^{\infty}\Bigl(1-\frac{z^2}{k^2\pi^2}\Bigr)\ \Rightarrow\ \sum_{k=1}^{\infty}\frac1{k^2}=\frac{\pi^2}{6}.\]
Open & closed sets
Open, closed. \(A\subset\R\) is open iff every \(x\in A\) has a neighbourhood \(I\subset A\) (\(\varnothing\) counts as open); \(B\) is closed iff \(\R\setminus B\) is open. Open intervals are open; \((a,\infty)=\bigcup_{n}(a+n-1,\ a+n)\) and \((-\infty,b)\) are open; \([a,b]=\R\setminus\bigl((-\infty,a)\cup(b,\infty)\bigr)\) is closed.
Stability. Any union of open sets is open (each point keeps its neighbourhood inside one of them); any finite intersection is open (shrink to \((\max a_k,\ \min b_k)\)). Not infinite intersections: \(\bigcap_{k}\bigl(-\frac1k,\frac1k\bigr)=\{0\}\), not open. By De Morgan: any intersection of closed sets is closed; finite unions of closed sets are closed.
Limits via neighbourhoods. \(\lim a_k=x\) iff for every neighbourhood \(U\) of \(x\) there is \(N\) with \(a_k\in U\) for all \(k\gt N\) — the limit needs only the open sets, not a distance.
Topological spaces. \((X,\tau)\): \(X,\varnothing\in\tau\); \(\tau\) closed under arbitrary unions and finite intersections. Elements of \(\tau\) = open sets, their complements closed, elements of \(X\) points. Examples: \(\R\) as above; \(\C\) with open disks \(D(z,r)=\{w\mid|w-z|\lt r\}\) (\(U\) open iff every point has a disk inside \(U\)); the discrete topology \(\tau=\) all subsets. Sequence limits generalise verbatim: \(x_k\to a\) iff every open \(U\ni a\) contains the whole tail.
Furstenberg's topology & Euclid. On \(\Z\): \(U\) open iff every \(a\in U\) carries a full progression \(a+m\Z=\{a+km\}\subset U\) (plus \(\varnothing\)). Unions: trivial; finite intersections: use the common progression \(a+(m_1m_2\cdots m_n)\Z\). Two features: every nonempty open set is infinite; each \(a+m\Z\) is clopen (its complement is the union of the other \(m-1\) residue classes, open). Euclid's theorem, topologically: were the primes \(p_1,\ldots,p_n\) finite, \(\bigcup_i p_i\Z\) would be a finite union of closed sets, hence closed; every integer of absolute value \(\ge2\) has a prime factor, so its complement is \(\{1,-1\}\) — a nonempty open set with two elements, contradicting the first feature. So there are infinitely many primes.