Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1.3: Euclidean space

The real line

Let us recall that the real numbers R\mathbb{R} could be viewed as the real line, where numbers are plotted as dots on the line.

import matplotlib.pyplot as plt
import math

values = [
    (-2, r"$-2$"),
    (0, r"$0$"),
    (0.5, r"$\frac{1}{2}$"),
    (1, r"$1$"),
    (math.sqrt(2), r"$\sqrt{2}$"),
    (math.pi, r"$\pi$"),
]

fig, ax = plt.subplots(figsize=(8, 2.2))
ax.axhline(0, color="black", linewidth=1.5)
ax.annotate("", xy=(3.6, 0), xytext=(-2.6, 0), arrowprops=dict(arrowstyle="->", color="black"))

for value, label in values:
    ax.plot(value, 0, "o", color="#2563eb", markersize=8)
    ax.vlines(value, -0.06, 0.06, color="#2563eb", linewidth=2)
    ax.text(value, 0.18, label, ha="center", va="bottom", fontsize=12)

for tick in range(-2, 4):
    ax.vlines(tick, -0.035, 0.035, color="black", linewidth=1)
    ax.text(tick, -0.18, str(tick), ha="center", va="top", fontsize=10)

ax.text(3.65, -0.18, r"$\mathbb{R}$", ha="left", va="top", fontsize=13)
ax.set_xlim(-2.7, 3.85)
ax.set_ylim(-0.45, 0.55)
ax.set_axis_off()
ax.set_title("Some points on the real line", pad=12)
plt.show()
<Figure size 800x220 with 1 Axes>

2D and 3D Euclidean spaces

The space R2\mathbb{R}^2 is the set of all pairs of real numbers. In set-builder notation, it is written as

R2={(x,y):xR, yR}.\mathbb{R}^2 = \left\{ (x,y): x\in \mathbb{R},\ y\in \mathbb{R}\right\}.

Similar to how we visualized the set of real numbers R\mathbb{R} as a line, the space R2\mathbb{R}^2 can be identified with the more familiar Euclidean plane, or the two-dimensional Euclidean space. Let us recall that the two axes are called the xx-axis and the yy-axis, and that elements of R2\mathbb{R}^2 can be identified with points on the plane.

import matplotlib.pyplot as plt

points = [(2, 3), (-1, 2), (3, -1), (-2, -2), (0, 1)]
colors = ["#dc2626", "#2563eb", "#16a34a", "#9333ea", "#ea580c"]

fig, ax = plt.subplots(figsize=(6, 6))
ax.axhline(0, color="black", linewidth=1.2)
ax.axvline(0, color="black", linewidth=1.2)

for (px, py), color in zip(points, colors):
    ax.scatter(px, py, s=80, color=color, zorder=3)
    ax.annotate(f"({px}, {py})", (px, py), xytext=(7, 7), textcoords="offset points", fontsize=11)

ax.set_xlim(-3.5, 4)
ax.set_ylim(-3.5, 4)
ax.set_aspect("equal", adjustable="box")
ax.set_xticks(range(-3, 5))
ax.set_yticks(range(-3, 5))
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_title(r"Points in $\mathbb{R}^2$")
ax.grid(True, linestyle="--", alpha=0.35)
plt.show()
<Figure size 600x600 with 1 Axes>

An important thing to note here is that the order of the two numbers in the pairs matter. For instance, the pair (2,3)(2,3) and (3,2)(3,2) are different elements of R2\mathbb{R}^2. This is unlike sets, where the ordering of the elements do not matter; the sets {2,3}\left\{2,3\right\} and {3,2}\left\{3,2\right\} are the same object.

In the same way, we define the space R3\mathbb{R}^3 to be the collection of all 3-tuples of real numbers, which in set-builder notation is written

R3={(x,y,z):x,y,zR}.\mathbb{R}^3 = \left\{ (x,y,z): x,y,z\in \mathbb{R}\right\}.

We can similarly identify elements of R3\mathbb{R}^3 with points in 3-dimensional Euclidean space.

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

points = [
    (1, 2, 3),
    (-2, 1, 2),
    (3, -1, 1),
    (-1, -2, -1),
    (0, 2, -2),
]
colors = ["#dc2626", "#2563eb", "#16a34a", "#9333ea", "#ea580c"]

fig = plt.figure(figsize=(7, 6))
ax = fig.add_subplot(111, projection="3d")

for (x, y, z), color in zip(points, colors):
    ax.scatter(x, y, z, s=70, color=color)
    ax.text(x, y, z, f" ({x}, {y}, {z})", fontsize=9)

ax.set_xlim(-3, 4)
ax.set_ylim(-3, 4)
ax.set_zlim(-3, 4)

ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("z")
ax.set_title(r"Points in $\mathbb{R}^3$")

ax.view_init(elev=22, azim=35)
plt.show()
<Figure size 700x600 with 1 Axes>

nn-dimensional Euclidean spaces

We can generalize these definitions beyond just two and three dimensions. We define the nn-dimensional Euclidean space to be the space of all nn-tuples of real numbers:

Rn={(x1,,xn):x1,,xnRn}.\mathbb{R}^n = \left\{ (x_1,\ldots, x_n):x_1,\ldots, x_n\in \mathbb{R}^n\right\}.

This space can be thought of a geometric space just like the two and three dimensional cases, although it is a bit harder to visualize. The power of mathematics is that one can often define objects like nn-dimensional spaces in a concrete and simple way algebraically, even though they may be hard to draw on a canvas or picture in our brains.

We will think of general nn-dimensional Euclidean spaces more in the future and focus on the two and three dimensional spaces first.