> [!definitionb] Definition
>
> Let $X$ be a [[Topological Space|topological space]]. For any two [[Path|paths]] $f, g \in C([0, 1], X)$ with $f(1) = g(0)$, their **product/composition** is the path
> $
> (f \cdot g)(t) = \begin{cases}
> f(2t) & t \in [0, 1/2] \\
> g(2t - 1) &t \in [1/2, 1]
> \end{cases}
> $
>
> Fix $x_0 \in X$, then a **loop** in $X$ with **basepoint** $x_0$ is a path $f: [0, 1] \to X$ such that $f(0) = f(1) = x_0$. Let $\pi_1(X, x_0)$ set of all homotopy classes of loops in $X$, then
> 1. For any $f \simeq f'$ and $g \simeq g'$ such that $f(1) = f'(1) = g(0) = g'(0)$, $f \cdot g \simeq f' \cdot g$. In other words, the product is well-defined on the homotopy classes of paths in $X$.
> 2. For any $[f], [g] \in \pi_1(X, x_0)$, define $[f] \cdot [g] = [f \cdot g]$, then $\pi_1(X, x_0)$ forms a [[Group|group]].
> 3. Let $x_1 \in X$ and $h: [0, 1] \to X$ be a path from $x_0$ to $x_1$, then the map $\beta: \pi_1(X, x_1) \to \pi_1(X, x_0)$ defined by $[f] \mapsto[h \cdot f \cdot h^{-1}]$ is an [[Isomorphism|isomorphism]].
>
> The group $\pi_1(X, x_0)$ is the **fundamental group** of $X$ at **basepoint** $x_0$.
>
> *Proof*. $(1)$: Let $F, G \in C([0, 1]^2, X)$ be homotopies connecting $f$ to $f'$, and $g$ to $g'$ respectively. Define
> $
> H: [0, 1]^2 \to X \quad (s, t) \mapsto \begin{cases}
> F(2s, t) &s \in [0, 1/2] \\
> G(2s-1, t) &s \in [1/2, 1]
> \end{cases}
> $
> For $s \ne 1/2$, $H$ is continuous at $(s, t)$ for all $t \in [0, 1]$, so it is sufficient to show continuity on the strip $\bracs{s = 1/2}$. To this end, let $y = f(1) = f'(1) = g(0) = g'(0)$, and $U \in \cn^o(y)$ be a [[Neighbourhood|neighbourhood]]. By continuity of $F$, there exists $\eps_f > 0$ such that $F(2s, t') \in U$ whenever $s \in (1/2 - \eps_f, 1/2]$ and $|t' - t| < \eps_f$. Similarly, there exists $\eps_g > 0$ such that $G(2s'-1, t') \in U$ whenever $s \in [1/2, 1/2 + \eps_g)$ and $|t' - t| < \eps_g$. Let $\eps = \min(\eps_f, \eps_g)$, then $H(s, t') \in U$ whenever $s \in B(1/2, \eps)$ and $t' \in B(t, \eps)$. Therefore $f \cdot g \simeq f' \cdot g'$.
>
> $(2)$: Let $[f], [g], [h] \in \pi_1(X, x_0)$, then $(f \cdot g) \cdot h = f \cdot (g \cdot h) \circ \varphi$ where
> $
> \varphi(t) = \begin{cases}
> 2(t - 3/4) + 1/2 &t \in [3/4, 1] \\
> t - 1/4 &t \in [1/2, 3/4] \\
> t/2 &t \in [0, 1/2]
> \end{cases}
> $
> Hence $(f \cdot g) \cdot h \simeq f \cdot (g \cdot h)$, and the composition is associative. Let $e: [0, 1] \to X$ be defined as $e(s) = x_0$, then $f \cdot e = f \circ \psi_r$ where
> $
> \psi_r(t) = \begin{cases}
> 2t & t \in [0, 1/2] \\
> 1 &t \in [1/2, 1]
> \end{cases}
> $
> so $f \cdot e \simeq f$. Similarly, $e \cdot f = f \circ \psi_l$ where
> $
> \psi_l(t) = \begin{cases}
> 0 &t \in [0, 1/2] \\
> 2(t - 1/2) &t \in [1/2, 1]
> \end{cases}
> $
> Lastly, let $f^{-1}: [0, 1] \to X$ be defined by $s \mapsto f(1 - s)$, then $f \cdot f^{-1} \simeq e$ with the homotopy
> $
> F: [0, 1]^2 \to X \quad (s, t) \mapsto \begin{cases}
> 2st &t \in [0, 1/2] \\
> s(1-2(t-1/2)) &t \in [1/2, 1]
> \end{cases}
> $
> thus $[f]^{-1} = [f^{-1}]$.
>
> $(3)$: Since $\beta^{-1}: \pi(X, x_0) \to \pi(X, x_1)$ defined by $[f] \mapsto [h^{-1} \cdot f \cdot h]$ is an inverse to $\beta$, it is a bijection. For any $[f], [g] \in \pi(X, x_{1})$,
> $
> [h \cdot f \cdot g \cdot h^{-1}] = [h \cdot f \cdot h^{-1} \cdot h \cdot g \cdot h^{-1}]
> $
> so $\beta$ is a homomorphism.