# Linear Algebra over a Ring/Printable version

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/Linear_Algebra_over_a_Ring

# Modules and linear functions

Definition (module):
Let $R$ be a ring. A left $R$-module is an abelian group $(M,+)$ together with a function $R\times M\to M$, denoted by juxtaposition, that satisfies the following axioms for all $r,s\in R$ and $m,n\in M$:
* $1m=m$
* $(r+s)m=rm+sm$
* $r(sm)=(rs)m$
* $r(m+n)=rm+rn$
Definition (homogenous):
Let $M$, $N$ be left modules over a ring $R$. A function $f:M\to N$ is called homogenous if and only if for all $r\in R$ and $m\in N$ the identity
    $f(rm)=rf(m)$
holds.
Definition (linear):
Let $M$, $N$ be left modules over a ring $R$. A function $f:M\to N$ is called linear if and only if it is both homogenous and a morphism of abelian groups from $M$ to $N$.
Theorem (first isomorphism theorem):
Let $M$ and $N$ be left modules over a ring $R$. Let $\varphi :M\to N$ be linear. Then
    $M/\ker \varphi \cong \operatorname {im} \varphi$.
Proof: $\Box$

## Exercises

* Prove that for a function $f:M\to N$ between left $R$-modules, the following are equivalent:
** $f$ is linear
** For all $m,n\in M$ and $r\in R$, we have $f(m+n)=f(m)+f(n)$ and $f(rm)=rf(m)$
** For all $m,n\in M$ and $r\in R$, we have $f(m+rn)=f(m)+rf(n)$
** For all $m,n\in M$ and $r,s\in R$, we have $f(rm+sn)=rf(m)+sf(n)$

# Free modules and matrices

Definition (free module):
Let $R$ be a ring, and let $S$ be an arbitrary set. Then the free $R$-module over $S$, denoted $R\langle S\rangle$, is defined to be the $R$-module whose elements are functions
    $f:S\to R$
which are zero everywhere on $S$ except on finitely many elements, together with pointwise addition and scalar multiplication.
Proposition (basis of a free module):
Let $R$ be a ring, and let $S$ be a set. Then a basis for the free $R$-module over $s$ is given by the functions
    $f_{s}:S\to R,f(t):={\begin{cases}1&t=s\\0&{\text{otherwise}}.\end{cases}}$
By abuse of notation, we will write $s$ instead of $f_{s}$. Hence, the above proposition implies that we may denote an element $m\in R\langle S\rangle$ as a sum
    $m=\sum _{s\in S}a_{s}s$,
where only finitely many $a_{s}$ are nonzero.
Proof: Let $f:S\to R$ be any function that is everywhere zero except on finitely many entries, and let $s_{1},\ldots ,s_{n}=\{s\in S|f(s)\neq 0\}$. Then we have
    $f=\sum _{k=1}^{n}f(s_{k})s_{k}$. $\Box$

# Direct product, direct sum and tensor product

Definition (free module over a set):
Let $S$ be any set, and let $R$ be a ring. Then the free module $F(S)$ is defined to be the module
    Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "http://localhost:6011/en.wikibooks.org/v1/":): {\displaystyle F(S) := \left\{ \sum_{k=1}^n r_k s_k \middle| \forall k \in [n]: r_k \in R \wedge s_k \in S \right\}}
together with the module operation
    $r\left(\sum _{k=1}^{n}r_{k}s_{k}\right)=\sum _{k=1}^{n}rr_{k}s_{k}$
and the obvious addition
    $\sum _{k=1}^{n}r_{k}s_{k}+\sum _{k=1}^{n}r_{k}'s_{k}'=\sum _{k=1}^{n}r_{k}s_{k}+\sum _{k=1}^{n}r_{k}'s_{k}'$.
Definition (tensor product):
Let $R$ be a ring and let $M_{1},\ldots ,M_{n}$ be $R$-modules. The tensor product of the modules $M_{1},\ldots ,M_{n}$ is defined as the $R$-module
    $M_{1}\otimes M_{2}\otimes \cdots \otimes M_{n}:=F(M_{1}\times M_{2}\times \cdots \times M_{n})/K$,
where $K\leq F(M_{1}\times M_{2}\times \cdots \times M_{n})$ is the following submodule:
    ${\begin{aligned}K=&\langle {\big \(m_{1},\ldots ,m_{j-1},m_{j}-rl,m_{j+1},\ldots ,m_{n})-(m_{1},\ldots ,m_{n})-r(m_{1},\ldots ,m_{j-1},l,m_{j+1},\ldots ,m_{n})\\&{\big |}j\in \{1,\ldots ,n\},m_{1}\in M_{1},\ldots ,m_{n}\in M_{n},l\in M_{j},r\in R{\big \}}\rangle \end{aligned}}$.
Proposition (universal property of the tensor product):
Let $R$ be a ring and let $M_{1},\ldots ,M_{n}$ be $R$-modules. Then the tensor product $M_{1}\otimes \cdots \otimes M_{n}$ satisfies the universal property that for each $R$-module $N$ and each multilinear map $f:M_{1}\times \cdots \times M_{n}\to N$, there exists a unique linear map ${\tilde {f}}:M_{1}\otimes \cdots \otimes M_{n}\to N$ such that
Proposition (tensor product as multifunctor):
Let $R$ be a ring. Then for each $n\in \mathbb {N}$, the tensor product yields a multifunctor
    $\oplus _{n}:(R-{\textbf {Mod}})^{n}\to R-{\textbf {Mod}}$.
Whenever $M_{1},\ldots ,M_{n}$ and $N_{1},\ldots ,N_{n}$ are $R$-modules and for $j\in \{1,\ldots ,n\}$, $f_{j}:M_{j}\to N_{j}$ are morphisms, the morphisms that turn $\oplus _{n}$ into a multifunctor are given by
    Failed to parse (unknown function "\begin{align}"): {\displaystyle \begin{align} f_1 \otimes \cdots \otimes f_n: M_1 \otimes \cdots \otimes M_n \to N_1 \otimes \cdots \otimes}
Proposition (associativity of the tensor product):
Let $R$ be a ring

# Homomorphism and dual modules

Proposition (multiple of module homomorphism by a ring element over a commutative ring is module homomorphism):
Let $M,N$ be modules over the commutative ring $R$. Let $\phi :M\to N$ be a homomorphism of $R$-modules, and let $r\in R$. Then the function
    $rf:M\to N,(rf)(m):=rf(m)$
is an $R$-module morphism too.
Proof: Let $s\in R$ and $m,n\in M$. Then $(rf)(m+n)=(rf)(m)+(rf)(n)$ and since $R$ is commutative, also $(rf)(sm)=rsf(m)=s(rf)(m)$. $\Box$
Definition (homomorphism module):
Let $R$ be a commutative ring
Definition (dual):
Let $R$ be a commutative ring, and let $M$ be an $R$-module. Then $\operatorname {Hom} _{R}(M,R)$ has a module structure given by addition and pointwise multipliction (since the category of modules over a ring is additive and the addition that is implied is compatible with pointwise multiplication, under which $\operatorname {Hom} _{R}(M,R)$ is closed), and this module, denoted more briefly by $M^{*}$, is called the dual of $M$.
Proposition (the category of modules is abelian):
Let $R$ be a ring. Then the category $R-{\textbf {Mod}}$ of left $R$-modules is abelian. Also, the category ${\textbf {Mod}}-R$ of right $R$-modules is abelian.
Proof: Existence of kernels and cokernels has been dealt with, and the same holds for existence of binary biproducts, since then product and sum coincide in this category. Also, the Noether isomorphism theorem holds. Then, the category is additive. Indeed, the summation on the homomorphism group indicated above is precisely the addition in the categorical sense. $\Box$

# Modules over Bézout domains

Proposition (extending a single element of a free, finite-dimensional module over a Bézout domain to a basis):
Let $R$ be a Bézout domain, and let $R^{n}$ be the $n$-dimensional free module over $R$. Let $v=(v_{1},\ldots ,v_{n})\in R^{n}$ be such that $\gcd(v_{1},\ldots ,v_{n})=1$. Then there exist elements $w_{2},\ldots ,w_{n}\in R^{n}$ such that $v,w_{2},\ldots ,w_{n}$ is a basis of $R^{n}$.
Proof: We proceed by induction on $n$. If $n=1$, the statement becomes trivial, so that the induction base is handled. Let now a general $n$ be given; we reduce the claim to the same statement for $n-1$.
Indeed, if $v=(v_{1},\ldots ,v_{n})$ is given, we may set
    $d:=\gcd(v_{2},\ldots ,v_{n})$,
and then $\gcd(v_{1},d)=\gcd(v_{1},\ldots ,v_{n})=1$. Hence, there are elements $r,s\in R$ such that
    $rv_{1}+sd=1$.
We define
    $w:=(s,-rv_{2}/d,\ldots ,-rv_{n}/d)$,
so that
    $rv+dw=e_{1}$ and $sv-v_{1}w=(0,v_{2}/d,\ldots ,v_{n}/d)$,
where for $j\in \mathbb {N}$, as usual, $e_{j}$ denotes the vector whose every component is zero except the one in the $j$-th place, which is one. From these equations it is evident that
    $\langle v,w\rangle =\langle e_{1},(0,v_{2}/d,\ldots ,v_{n}/d)\rangle$.
Also, $v$ and $w$ are linearly independent, because if there existed $b,c\in R$ such that $bv+cw=0$, then $b(0,v_{2}/d,\ldots ,v_{n}/d)=(v_{1}-sc)w$ and in particular $0=(v_{1}-sc)s$, so that either $s=0$ and $v$ and $w$ are linearly independent (almost) by definition, or $v_{1}=sc$, so that $b=1$ whenever $v_{1}\neq 0$ (once again, if $v_{1}=0$, then the vectors are automatically linearly independent). But this implies that $c|v_{j}$ for all $j\in \{1,\ldots ,n\}$, so that contrary to the assumption $\gcd(v_{1},\ldots ,v_{n})\neq 1$.
It now suffices to note that
    $R^{n}/\langle v,w\rangle =R^{n}/\langle e_{1},(0,v_{2}/d,\ldots ,v_{n}/d)\rangle \cong R^{n-1}/\langle (v_{2}/d,\ldots ,v_{n}/d)\rangle$
by the first Noether isomorphism theorem applied to the homomorphism that forgets the first component, which reduces the dimension of the problem by one as we have $\gcd(v_{2}/d,\ldots ,v_{n}/d)=1$. $\Box$
Theorem (a minimum cardinality generating set of a finitely generated torsion-free module over a Bézout domain is a basis):
Let $R$ be a Bézout domain, and let $M$ be a finitely generated torsion-free module over $R$. Then every generating set of $M$ whose cardinality is minimal is a basis of $M$.
Proof: We proceed by induction on $n$, where $n$ is the cardinality of a minimum cardinality generating set of $M$. Let $x_{1},\ldots ,x_{n}$ be a minimum cardinality generating set of $M$. Then we have a homomorphism
    $\varphi :R^{n}\to M$
such that $\varphi (e_{k})=x_{k}$ for $k\in \{1,\ldots ,n\}$, where $e_{k}$ is the element of $R^{n}$ whose every entry is zero, except for the $k$-th entry, which is one. Since $\varphi$ is surjective, the first isomorphism theorem implies that
    $M\cong R^{n}/K$,
where $K=\ker \varphi$. If $K=\{0\}$, then the claim is demonstrated. We lead $K\neq \{0\}$ to a contradiction. Indeed, in this case there is a nonzero vector $0\neq v\in K$. We denote $v:=(v_{1},\ldots ,v_{n})$ and set $d:=\gcd(v_{1},\ldots ,v_{n})$. Then $v/d\in K$, for otherwise the image of $v/d$ in $R^{n}/K$ via the canonical projection would be a torsion element. Since we have $\gcd(v_{1}/d,\ldots ,v_{n}/d)=1$, we may extend $v$ to a basis $\{v,w_{2},\ldots ,w_{n}\}$ of $R^{n}$, and then $R^{n}/K$ is generated by the images of $w_{2},\ldots ,w_{n}$ via the canonical projection. Yet this contradicts the minimality of $n$. $\Box$
Theorem (Dedekind's theorem):
Let $R$ be a Bézout domain, and let $M$ be a torsion-free module over $R$. Then every finitely generated submodule $N\leq M$ is free.
Proof: If $M$ is torsion-free, then every submodule of $M$ is torsion-free as well. Hence, $N$ as in the theorem's statement is torsion-free and finitely generated. Hence, there exists a basis of $N$. $\Box$
Proposition (basis extension over Bézout domains):
Let $R$ be a Bézout domain, and let $M$ be a torsion-free module over $R$. If $v_{1},\ldots ,v_{k}$ are linearly independent vectors in $M$ such that $M/\langle v_{1},\ldots ,v_{k}\rangle$ is torsion-free and finitely generated, then we find an $n\in \mathbb {N}$ and vectors $v_{k+1},\ldots ,v_{n}\in M$ such that the vectors $v_{1},\ldots ,v_{k},v_{k+1},\ldots ,v_{n}$ constitute a basis of $M$.
Proof: Since $M/\langle v_{1},\ldots ,v_{k}\rangle$ is torsion-free and finitely generated, upon choosing a generating set of minimal cardinality we obtain a basis of that module. We shall denote this basis by $g_{1},\ldots ,g_{m}$. If moreover
    $\pi :M\to M/\langle v_{1},\ldots ,v_{k}\rangle$
is the canonical projection, we choose a $w_{j}\in \pi ^{-1}(g_{j})$ for each $j\in \{1,\ldots ,m\}$. We claim that $\{v_{1},\ldots ,v_{k},w_{1},\ldots ,w_{m}\}$ is a basis. First, we prove that these vectors are linearly independent. Indeed, suppose that $a_{1},\ldots ,a_{m},b_{1},\ldots ,b_{k}\in R$ are such that
    $0=a_{1}w_{1}+\cdots +a_{m}w_{m}+b_{1}v_{1}+\cdots +b_{k}v_{k}$.
Since $\pi$ is a homomorphism,
    $0=\pi (0)=\pi (a_{1}w_{1}+\cdots +a_{m}w_{m}+b_{1}v_{1}+\cdots +b_{k}v_{k})=a_{1}g_{1}+\cdots +a_{m}g_{m}$,
so that $a_{1}=a_{2}=\cdots =a_{m}=0$. Thus
    $b_{1}v_{1}+\cdots +b_{k}v_{k}=0$,
which by virtue of the linear independence of $v_{1},\ldots ,v_{k}$ implies $b_{1}=b_{2}=\cdots =b_{k}=0$.
It remains to show that $\{v_{1},\ldots ,v_{k},w_{1},\ldots ,w_{m}\}$ is a generating set of $M$. In order to do so, suppose that $u\in M$ is arbitrary. We choose $a_{1},\ldots ,a_{m}\in R$ such that
    $\pi (u)=a_{1}g_{1}+\cdots +a_{m}g_{m}$.
We further define $u':=u-a_{1}w_{1}-\cdots -a_{m}w_{m}$, so that $\pi (u')=0$. But by the definition of $\pi$, this means that $u'\in \langle v_{1},\ldots ,v_{k}\rangle$, so that there are $b_{1},\ldots ,b_{k}\in R$ such that
    $u'=b_{1}v_{1}+\cdots +b_{k}v_{k}$, hence $u=u'+a_{1}w_{1}+\cdots +a_{m}w_{m}=b_{1}v_{1}+\cdots +b_{k}v_{k}+a_{1}w_{1}+\cdots +a_{m}w_{m}$,
which shows that $\{v_{1},\ldots ,v_{k},w_{1},\ldots ,w_{m}\}$ is a generating set of $M$ since $u$ was arbitrary. $\Box$
Theorem (dimension formula):

# Modules over principal ideal domains

Proposition (torsion-free modules over principal ideal domains are free):
Let $R$ be a principal ideal domain, and let $M$ be a torsion-free module over $R$. Then $M$ is free.
Proof: We consider the set of sets $S\subseteq M$ such that $S$ is linearly independent and $M/\langle S\rangle$ is torsion-free. This set may be equipped with the partial order that is given by inclusion. Suppose then that $A$ is a totally ordered set, and $(S_{\alpha })_{\alpha \in A}$ is a family such that $\alpha \leq \beta \Leftrightarrow S_{\alpha }\subseteq S_{\beta }$. We claim that an upper bound for this chain is given by the union of the sets $S_{\alpha }$, which we shall denote by $S_{\infty }$. Indeed, $S_{\infty }$ is linearly independent, since any linear relation within $S_{\infty }$ involves only finitely many elements of $S_{\infty }$, and we may find a sufficiently large (w.r.t. the order of $A$) $\alpha \in A$ such that all these elements are contained within $S_{\alpha }$, so that by the linear independence of $S_{\alpha }$ the given linear relation must be trivial. Moreover, $S_{\infty }$ has the property that $M/\langle S_{\infty }\rangle$ is torsion-free, since if $m\in M$ and $r\in R$ are given such that $m\notin S_{\infty }$, but $rm\in S_{\infty }$ (ie. the equivalence class of $m$ in $M/\langle S_{\infty }\rangle$ is torsion), then $rm$ is a linear combination of finitely many elements of $S_{\infty }$, so that once more we find a sufficiently large $\alpha \in A$ such that $rm\in S_{\alpha }$, and then the equivalence class of $m$ in $R/\langle S_{\alpha }\rangle$ is torsion, a contradiction.
Thus, Zorn's lemma may be applied, and it yields a maximal linearly independent $S\subseteq M$ such that $M/\langle S\rangle$ is torsion-free. We lead the assumption $\langle S\rangle \neq M$ to a contradiction. Indeed, if we had $\langle S\rangle \neq M$, then there would be an element $m\in M\setminus \langle S\rangle$. The set $S\cup \{m\}$ will then be linearly independent, for if there was a linear relation
    $0=rm+r_{1}s_{1}+\cdots +r_{n}s_{n}$ (where $r,r_{1},\ldots ,r_{n}\in R$ and $s_{1},\ldots ,s_{n}\in S$),
then we would have $(-r)m=r_{1}s_{1}+\cdots +r_{n}s_{n}\in \langle S\rangle$ and the equivalence class of $m$ in $M/\langle S\rangle$ would be torsion. $\Box$
Theorem (Dedekind's theorem):
Let $R$ be a principal ideal domain. Whenever $M$ is a free $R$-module and $N\leq M$ is a submodule, $N$ is free as well.
Proof: Since $N$ is a submodule of a torsion-free module, it is itself torsion-free. Thus, the theorem holds, since torsion-free modules over principal ideal domains are free. $\Box$

# Multilinear algebra

Definition (multilinear function):
Let $R$ be a ring, and let $M_{1},\ldots ,M_{n},K$ be $R$-modules. Then the set of $R$-multilinear functions from $M_{1}\times \cdots \times M_{n}$ to $K$ is the set
    $L(M_{1},\ldots ,M_{n},K):=\left\{f:M_{1}\times M_{n}\to K|\forall j\in [n]:\forall m_{1}\in M_{1},\ldots ,m_{n}\in M_{n},l_{j}\in M_{j},r\in R:f(m_{1},\ldots ,m_{j}+rl_{j},\ldots ,\right\}$.
Proposition (equivalent definition of tensor product of free modules using multilinear functions):
Let $R$ be a ring, and let $M_{1},\ldots ,M_{n}$ be free, finitely generated $R$-modules. Then if we alternatively define
    $M_{1}^{*}\otimes \cdots \otimes M_{n}^{*}:=L(M_{1},\ldots ,M_{n},R)$,
and let the elementary tensors be $m_{1}^{*}\otimes \cdots \otimes m_{n}^{*}(l_{1},\ldots ,l_{n}):=m_{1}^{*}(l_{1})\cdots m_{n}^{*}(l_{n})$, then the $M_{1}\otimes M_{n}$ from this definition satisfies the same universal property as the usual tensor product $M_{1}\otimes \cdots \otimes M_{n}$. In particular, the two tensor products are canonically isomorphic.
Proof: For $j\in [n]$, let $(e_{\lambda }^{j})_{\lambda \in \Lambda _{j}}$ be a basis of $M_{j}$, where $\Lambda _{j}$ is the respective finite index set. Given any $R$-module $K$ and any multilinear map $f:M_{1}\times \cdots \times M_{n}\to K$, we want a unique linear function $g:M_{1}\otimes \cdots \otimes M_{n}\to K$ such that $g\circ h=f$, where $h:M_{1}\times \cdots \times M_{n}\to M_{1}^{*}\otimes \cdots \otimes M_{n}^{*}$ is the map that sends a tuple to the respective elementary tensor. $\Box$

# Projective and injective modules

Theorem (Baer's criterion):
A module $M$ over a commutative ring $R$ is injective if and only if for every ideal $I\leq R$, every homomorphism $\varphi :I\to M$ of $R$-modules may be extended to a homomorphism of $R$-modules $\Phi :R\to M$, ie. extended to a homomorphism $\Phi :R\to M$ that satisfies $\Phi \upharpoonright _{I}=\varphi$.
Proof: The "only if" part is obvious from the definition of injectivity. Conversely, assume that $M$ satisfies the extension property described in the theorem statement. Let now $K,L$ be $R$-modules, let $\psi :K\to M$ be a homomorphism and let $\iota :K\to L$ be an injection. By the definition of injective modules, we have to prove that there exists a homomorphism $\Psi :L\to M$ that satisfies $\Psi \circ \iota =\psi$, ie. that extends $\psi$ wrt. the inclusion $\iota :K\to L$, as the algebraists say. Now the image $\operatorname {Im} \iota :=L'$ is a submodule of $L$ that is isomorphic to $K$ by the injectivity of $\iota$ via $\iota$, and hence precomposition of the inverse of $\iota$ with $\psi$ yields a homomorphism from $L'$ to $M$. Now we partially order all extensions of this isomorphism by the order that $\alpha \leq \beta$ if and only if
* the domain of $\alpha$ is contained within the domain of $\beta$, and
* $\alpha$ and $\beta$ coincide on the domain of $\alpha$.
By Zorn's lemma, which applies since each chain with respect to this order has an upper bound (namely the function that assigns to an element within the union of the respective domains the value that any of the respective homomorphisms assumes on it), there exists a maximal homomorphism $\Psi$ with respect to that order. We claim that $\Psi$ is defined on all of $L$. Indeed, upon assuming otherwise, we may choose an element $l\in L$ where $\Psi$ is not defined. Let $L''\leq L$ be the domain of definition of $\Psi$, so that $l\notin L''$. Define the ideal
    $I:=\{r\in R|rl\in L''\}$
of $R$; it may be the zero ideal. $\Psi$ is defined on $I$, and yields a homomorphism on $I$. By assumption, this homomorphism may be extended to a homomorphism $f:R\to M$. We then define $L''':=L''+\langle l\rangle$; a submodule of $L$ that is strictly larger than $L''$, since it contains $l$. On $L'''$, we define the homomorphism
    $F(x+sl):=\Psi (x)+sf(l)$ for $x\in L''$ and $s\in R$,
which is a proper extension of $\Psi$, so that $\Psi$ was not maximal, a contradiction. Hence, $\Psi$ was defined on all of $L$ from the beginning and yields the desired extension of $\psi$. $\Box$

# Chain complexes of finitely generated free modules

Proposition (every chain complex of finitely generated free modules over a Bézout domain is the direct sum of some of its subcomplexes with at most two nonzero terms):
Let
    $\cdots {\overset {\partial }{\longrightarrow }}C_{n+1}{\overset {\partial }{\longrightarrow }}C_{n}{\overset {\partial }{\longrightarrow }}C_{n-1}{\overset {\partial }{\longrightarrow }}\cdots$
be a chain complex whose objects are finitely generated free modules over a Bézout domain $R$. This chain complex is then the countable direct sum of chain complexes of the form
    $\cdots \longrightarrow 0\longrightarrow 0\longrightarrow L_{n+1}\longrightarrow R_{n}\longrightarrow 0\longrightarrow 0\longrightarrow \cdots$,
where $L_{n+1}\leq C_{n+1}$ and $R_{n}\leq C_{n}$.
Proof: We shall construct a direct sum decomposition
    $C_{n}=L_{n}\oplus R_{n}$,
where $R_{n}=\ker \partial$. Once this is accomplished, we have in fact obtained a direct sum decomposition of the initial chain complex, because elements of $R_{n}$ are mapped to zero by $\partial$, and elements of $L_{n}$ are mapped to $R_{n-1}$ due to the chain complex condition $\partial \circ \partial =0$.
In order to achieve this decomposition, we invoke Dedekind's theorem for Bézout domains, which tells us that $\operatorname {im} \partial \leq C_{n-1}$ is finitely generated and free; indeed, it is finitely generated, since a generating set is given by the image (via $\partial$) of a generating set of $C_{n}$. Let thus $b_{1},\ldots ,b_{n}$ be a basis of $\operatorname {im} \partial \leq C_{n-1}$. For each $j\in \{1,\ldots ,n\}$, we choose an arbitrary, but fixed $a_{j}\in \partial ^{-1}(b_{j})$, and then we define $L_{n}:=\langle a_{1},\ldots ,a_{n}\rangle$. This yields the desired direct sum decomposition. Indeed, $L_{n}\cap R_{n}=\{0\}$, since whenever
    $r_{1}a_{1}+\cdots +r_{n}a_{n}=0$
for some elements $r_{1},\ldots ,r_{n}$ of $R$, applying $\partial$ to both sides of this equation and using its $R$-linearity yields
    $r_{1}b_{1}+\cdots +r_{n}b_{n}=0$,
which implies $r_{1}=r_{2}=\cdots =r_{n}=0$. Moreover, $L_{n}+R_{n}=C_{n}$, since if $c\in C_{n}$ is arbitrary, we may select $r_{1},\ldots ,r_{n}\in R$ such that
    $\partial (c)=r_{1}b_{1}+\cdots +r_{n}b_{n}$,
from which we may easily deduce that
    $c-r_{1}a_{1}-\ldots -r_{n}a_{n}\in \ker \partial$. $\Box$
Proposition (every chain complex of finitely generated free modules over a Bézout domain splits as the direct sum of two types of elementary chain complexes):
Let
    $\cdots {\overset {\partial }{\longrightarrow }}C_{n+1}{\overset {\partial }{\longrightarrow }}C_{n}{\overset {\partial }{\longrightarrow }}C_{n-1}{\overset {\partial }{\longrightarrow }}\cdots$
be a chain complex whose objects are finitely generated free modules over a Bézout domain $R$. This chain complex is the countable direct sum of copies of the following two chain complexes:
* $0\longrightarrow R\longrightarrow 0$
* $0\longrightarrow R{\overset {r}{\longrightarrow }}R\longrightarrow 0$ for an element $r\in R$, ie. the arrow represents the function which is given by multiplication by $r$
Proof: Using the notation of the last theorem, we have $C_{n}=L_{n}\oplus R_{n}$, where $L_{n}$ is finitely generated and $R_{n}$ is sent to zero by $\partial$. $\Box$