Notion of homotopy in chain complexes Let $f$ and $g$ be two continuous functions from $X$ to $Y$. In homotopy theory, we say that $f$ is homotopic to $g$ if there exists a continuous map $H:X\times I\to Y$ such that $H(x,0)=f(x)$ and $H(x,1)=g(x)$.
However, I came about a new use of the term "homotopy" while reading about chain complexes in homology. If $f$ and $g$ are two morphisms between chain complexes $C_*$ and $D_*$, a homotopy $h$ between $f$ and $g$ is a familly of $R$-module morphisms $h_n:C_n\to D_{n+1}$ such that, for all $n\geq 0$,
$$f_n-g_n = d_{n+1}\circ h_n + h_{n-1}\circ d_n$$
(where $d_n$ is a boundary homomorphism $C_n\to C_{n-1}$ or $D_n\to D_{n-1}$ depending on the context).
My question is: is there a link between these two identically-named concepts? It seems like the second definition is way more general than the first one. Their relation is not clear to me.
 A: Yes there is; I will assume you're familiar with some homology of spaces, say singular homology. Recall how we construct singular homology for a space $X$ is, we take the abelian groups $C_n(X)$ to be the free abelian group generated the set $\{\text{continuous maps }\Delta^n\to X\}$, and these form a chain complex $$\cdots\to C_{n+1}(X)\to C_n(X)\to C_{n-1}(X)\to\cdots$$
Furthermore, if $f:X\to Y$ is a continuous map, then we get maps $f_n:C_n(X)\to C_n(Y)$ by taking a map $\sigma:\Delta^n\to X$ to the composition $f\circ\sigma:\Delta^n\to Y$, and these in fact give a morphism of chain complexes $f_*:C_*(X)\to C_*(Y)$.
Now, suppose we have two maps $f,g:X\to Y$ inducing morphisms of chain complexes $f_*,g_*:C_*(X)\to C_*(Y)$, and suppose we have a homotopy $h:X\times I\to Y$ from $f$ to $g$.  Then we can use this to construct $h_n:C_n(X)\to C_{n+1}(Y)$; this is not trivial and I won't put the entire thing here, but basically given some map $\sigma:\Delta^n\to X$, we have the composition $h\circ(\sigma\times\mathrm{id}_I):\Delta^n\times I\to Y$, and you can subdivide $\Delta^n\times I$ into (n+1)-simplices in a way that allows you to identify this map $\Delta^n\times I\to Y$ with a formal sum of maps $\Delta^{n+1}\to Y$ (you can find the details in Hatcher). All together, these $h_n:C_n(X)\to C_{n+1}(Y)$ can be shown to give a homotopy between $f_*$ and $g_*$ in the sense of chain complexes, giving the connection you seek.
