Search Knowledge

© 2026 LIBREUNI PROJECT

Geometry & Topology / Overview

General Topology

General Topology

Topology is the study of properties that are preserved under continuous deformations, such as stretching and bending, but not tearing or gluing.

Metric Spaces

A metric space (X,d)(X, d) is a set XX with a distance function d:X×XRd: X \times X \to \mathbb{R} satisfying:

  1. Positivity: d(x,y)0d(x, y) \ge 0, and d(x,y)=0    x=yd(x, y) = 0 \iff x = y.
  2. Symmetry: d(x,y)=d(y,x)d(x, y) = d(y, x).
  3. Triangle Inequality: d(x,z)d(x,y)+d(y,z)d(x, z) \le d(x, y) + d(y, z).
python
1def check_metric_axioms(X, d):
2 for x in X:
3 for y in X:
4 # Positivity
5 if d(x, y) < 0: return False, "Negative distance"
6 if x != y and d(x, y) == 0: return False, "Zero distance for distinct points"
7 # Symmetry
8 if d(x, y) != d(y, x): return False, "Symmetry failed"
9 for z in X:
10 # Triangle Inequality
11 if d(x, z) > d(x, y) + d(y, z) + 1e-9:
12 return False, f"Triangle inequality failed for {x}, {y}, {z}"
13 return True, "Valid Metric"
14 
15# Manhattan Distance
16def taxicab(p1, p2):
17 return abs(p1[0] - p2[0]) + abs(p1[1] - p2[1])
18 
19points = [(0,0), (1,1), (2,3), (10, 0)]
20print(f"Taxicab metric: {check_metric_axioms(points, taxicab)}")
21 
22# Discrete Metric
23def discrete(p1, p2):
24 return 0 if p1 == p2 else 1
25 
26print(f"Discrete metric: {check_metric_axioms(points, discrete)}")

Topological Spaces

A topological space (X,τ)(X, \tau) is a set XX with a collection of subsets τ\tau (the open sets) such that:

  1. τ\emptyset \in \tau and XτX \in \tau.
  2. Arbitrary unions of sets in τ\tau are in τ\tau.
  3. Finite intersections of sets in τ\tau are in τ\tau.
python
1def is_topology(X, tau):
2 X_set = set(X)
3 tau_sets = [set(s) for s in tau]
4
5 # Empty set and X
6 if set() not in tau_sets or X_set not in tau_sets:
7 return False, "Missing empty set or X"
8
9 # Finite Intersections
10 import itertools
11 for s1, s2 in itertools.combinations(tau_sets, 2):
12 if s1.intersection(s2) not in tau_sets:
13 return False, f"Intersection of {s1} and {s2} not in tau"
14
15 # Binary Unions (covers arbitrary unions for finite sets)
16 for s1, s2 in itertools.combinations(tau_sets, 2):
17 if s1.union(s2) not in tau_sets:
18 return False, f"Union of {s1} and {s2} not in tau"
19
20 return True, "Valid Topology"
21 
22X = [1, 2, 3]
23indiscrete = [[], [1, 2, 3]]
24print(f"Indiscrete Topology: {is_topology(X, indiscrete)}")
25 
26overlap = [[], [1], [2], [1, 2, 3]]
27print(f"Partial Overlap: {is_topology(X, overlap)}")

Continuity

A function f:XYf: X \to Y is continuous if the preimage of every open set in YY is open in XX.

  • Formally: ff is continuous if VτY,f1(V)τX\forall V \in \tau_Y, f^{-1}(V) \in \tau_X.

In a Metric Space, this is equivalent to the ϵδ\epsilon-\delta definition: ff is continuous at x0x_0 if: ϵ>0,δ>0 such that dX(x,x0)<δ    dY(f(x),f(x0))<ϵ\forall \epsilon > 0, \exists \delta > 0 \text{ such that } d_X(x, x_0) < \delta \implies d_Y(f(x), f(x_0)) < \epsilon

In a discrete metric space, which sets are open?

Compactness and Connectedness

A space is compact if every open cover has a finite subcover. A space is connected if it cannot be partitioned into two disjoint non-empty open sets.

The Heine-Borel theorem states that subsets of R^n are compact if and only if they are:

Previous Module Riemannian Geometry
Finish Course