# Commutative Algebra/Torsion-free, flat, projective and free modules
## Free modules

The following definitions are straightforward generalisations from linear algebra. We begin by repeating a definition we already saw in chapter 6.
Definition 6.1 (generators of modules):
Let $M$ be a module over the ring $R$. A generating set of $M$ is a subset $\{m_{j}\}_{j\in J}\subseteq M$ such that
    $\forall n\in M:\exists j_{1},\ldots ,j_{k}\in J,r_{1},\ldots ,r_{k}\in R:n=\sum _{l=1}^{k}r_{l}m_{j_{l}}$.
We also have:
Definition 11.1:
Let $M$ be an $R$-module. A subset $\{m_{j}\}_{j\in J}$ of $M$ is called linearly independent if and only if, whenever $j_{1},\ldots ,j_{n}\in J$, we have
    $r_{1}m_{j_{1}}+\cdots +r_{n}m_{j_{n}}=0\Rightarrow r_{1},\ldots ,r_{n}=0$.
Definition 11.2:
A free $R$-module is a module $M$ over $R$ where there exists a basis, that is, a subset $\{m_{j}\}_{j\in J}$ of $M$ that is a linearly independent generating set.
Theorem 11.3:
Let $M_{\alpha },\alpha \in A$ be free modules. Then the direct sum
    $\bigoplus _{\alpha \in A}M_{\alpha }$
is free.
Proof:
Let bases $\{e_{\beta }\}_{\beta \in B_{\alpha }}$ of the $M_{\alpha }$ be given. We claim that
    $\left\{\left(0,\ldots ,0,\overbrace {e_{\beta _{\alpha }}} ^{\alpha {\text{-th place}}},0,\ldots ,0\right){\big |}\alpha \in A,\beta _{\alpha }\in B_{\alpha }\right\}$
is a basis of
    $M:=\bigoplus _{\alpha \in A}M_{\alpha }$.
Indeed, let an arbitrary element $(m_{\alpha })_{\alpha \in A}$ be given. Then by assumption, each of the $m_{\alpha }$ has a decomposition
    $m_{\alpha }=\sum _{j=1}^{n_{\alpha }}r_{j,\alpha }e_{\beta _{j,\alpha }}$
for suitable $e_{\beta _{j,\alpha }}\in \{e_{\beta }\}_{\beta \in B_{\alpha }}$. By summing this, we get a decomposition of $(m_{\alpha })_{\alpha \in A}$ in the aforementioned basis. Furthermore, this decomposition must be unique, for otherwise projecting gives a new composition of one of the particular $m_{\alpha }$.$\Box$
The converse is not true in general!
Theorem 11.4:
Let $M,N$ be free $R$-modules, with bases $\{e_{\alpha }\}_{\alpha \in A}$ and $\{f_{\beta }\}_{\beta \in B}$ respectively. Then
    $M\otimes _{R}N$
is a free module, with basis
    $\{e_{\alpha }\otimes f_{\beta }\}_{(\alpha ,\beta )\in A\times B}$,
where we wrote for short
    $e_{\alpha }\otimes f_{\beta }:=[(e_{\alpha },f_{\beta })]$
(note that it is quite customary to use this notation).
Proof:
We first prove that our supposed basis forms a generating system. Clearly, by summation it suffices to show that elements of the form
    $m\otimes n$, $m\in M,n\in N$
can be written in terms of the $e_{\alpha }\otimes f_{\beta }$. Thus, write
    $m=\sum _{j=1}^{\mu }r_{j}e_{\alpha _{j}}$ and $n=\sum _{i=1}^{\nu }s_{i}b_{\beta _{i}}$,
and obtain by the rules of computing within the tensor product, that
    $m\otimes n=\sum _{j=1}^{\mu }\sum _{i=1}^{\nu }r_{j}s_{i}e_{\alpha _{j}}\otimes b_{\beta _{i}}$.
On the other hand, if
    $0=\sum _{\alpha \in A,\beta \in B}t_{\alpha ,\beta }e_{\alpha }\otimes f_{\beta }$
is a linear combination (i.e. all but finitely many summands are zero), then all the $t_{\alpha ,\beta }$ must be zero. The argument is this: Fix $\alpha ,\beta$ and define a bilinear function
    $f:M\times N\to R,(m,n)\mapsto r_{\alpha }s_{\beta }$,
where $r_{\alpha }$, $s_{\beta }$ are the coefficients of $e_{\alpha }$, $f_{\beta }$ in the decomposition of $m$ and $n$ respectively. According to the universal property of the tensor product, we obtain a linear map
    $g:M\otimes N\to R$ with $g\circ \pi =f$,
where $\pi :M\times N\to M\otimes N$ is the canonical projection on the quotient space. We have the equations
    $g(e_{\alpha '}\otimes f_{\beta '})=f(e_{\alpha '},f_{\beta '})=[\alpha =\alpha '\wedge \beta =\beta ']$,
and inserting the given linear combination into this map therefore yields the desired result.$\Box$

## Projective modules

The following is a generalisation of free modules:
Definition 11.5:
Let $M$ be an $R$-module. $M$ is called projective if and only if for a fixed module $N$ and a fixed surjection $f:N\twoheadrightarrow M$ every other module morphism with codomain $M$ (call $g:K\to M$) has a factorisation
Theorem 11.6:
Every free module is projective.
Proof:
Pick a basis $\{m_{j}\}_{j\in J}$ of $M$, let $f:N\twoheadrightarrow M$ be surjective and let $g:K\to M$ be some morphism. For each $m_{j}$ pick $n_{j}\in N$ with $f(n_{j})=m_{j}$. Define
    $h:K\to N,h(k)=\sum _{i=1}^{l}r_{i}n_{j_{i}}$ where $g(k)=\sum _{i=1}^{l}r_{i}m_{j_{i}}$.
This is well-defined since the linear combination describing $g(k)$ is unique. Furthermore, it is linear, since we have
    $g(k+rk')=\sum _{i=1}^{l}r_{i}m_{j_{i}}+r\sum _{i'=1}^{l'}r_{i}'m'_{j_{i}'}$,
where the right hand side is the sum of the linear combinations coinciding with $g(k)$ and $g(k')$ respectively, which is why $h(k+rk')=h(k)+rh(k')$. By linearity of $f$ and definition of the $n_{j}$, it has the desired property.$\Box$
There are a couple equivalent definitions of projective modules.
Theorem 11.7:
A module $M$ is projective if and only if there exists a module $N$ such that $K:=M\oplus N$ is free.
Proof:
$\Rightarrow$: Define the module
    $L:=\bigoplus _{m\in M}R$
(this obviously is a free module) and the function
    $f:L\to M,(0,\ldots ,0,\overbrace {r} ^{m{\text{-th place}}},0,\ldots ,0)\mapsto rm$.
$f$ is a surjective morphism, whence we obtain a commutative diagram
that is, $f\circ h=\operatorname {Id} _{M}$.
We claim that the map
    $\varphi :M\oplus \ker f\to L,\varphi (m,k):=h(m)+k$
is an isomorphism. Indeed, if $h(m)+k=0$, then $f(h(m)+k)=f(h(m))=m=0$ and thus also $k=0$ (injectivity) and further $\varphi ((rm,0))=(0,\ldots ,0,\overbrace {r} ^{m{\text{-th place}}},0,\ldots ,0)+k$, where $k\in \ker f$, which is why
    $\varphi ((rm,-k))=(0,\ldots ,0,\overbrace {r} ^{m{\text{-th place}}},0,\ldots ,0)=(0,\ldots ,0,\overbrace {r} ^{m{\text{-th place}}},0,\ldots ,0)$
(surjectivity).
$\Leftarrow$: Assume $M\oplus L$ is a free module. Assume $f:N\twoheadrightarrow M$ is a surjective morphism, and let $g:K\to M$ be any morphism. We extend $g$ to ${\tilde {g}}:K\to M\oplus L$ via
    ${\tilde {g}}(k):=(g(k),0)$.
This is still linear as the composition of the linear map $g$ and the linear inclusion $M\hookrightarrow M\oplus L$. Now $M\oplus L$ is projective since it's free. Hence, we get a commutative diagram
where ${\tilde {h}}$ satisfies $(f\times \operatorname {Id} _{L})\circ {\tilde {h}}={\tilde {g}}$. Projecting ${\tilde {h}}$ to $N$ gives the desired diagram for $M$.$\Box$
Definition 11.8:
An exact sequence of modules
    $0\rightarrow K\rightarrow N\rightarrow M\rightarrow 0$
is called split exact iff we can augment it by three isomorphisms such that
commutes.
Theorem 11.9:
A module $M$ is projective iff every exact sequence
    $0\rightarrow K\rightarrow N\rightarrow M\rightarrow 0$
is split exact.
Proof:
$\Rightarrow$: The morphism $N\rightarrow M$ is surjective, and thus every other morphism with codomain $M$ lifts to $N$. In particular, so does the projection $\pi :K\oplus M\to M$. Thus, we obtain a commutative diagram
where we don't know yet whether $h$ is an isomorphism, but we can use $h$ to define the function
    ${\tilde {h}}:K\otimes M\to N,{\tilde {h}}(k,m):=g(k)+h(0,m)$,
which is an isomorphism due to injectivity:
Let ${\tilde {h}}(k,m)=0$, that is $h(0,m)+g(k)=0$. Then first
    $m=f(h(0,m))=f(h(0,m)+g(k))=f(0)=0$
and therefore second
    $g(k)=h(0,m)+g(k)=0\Rightarrow k=0$.
And surjectivity:
Let $n\in N$. Set $m:=f(n)$. Then
    $h(0,m)-n\in \ker f=\operatorname {im} h$
and hence $g(k)=h(0,m)-n$ for a suitable $k\in K$, thus
    $n={\tilde {h}}(-k,m)$.
We thus obtain the commutative diagram
and have proven what we wanted.
$\Leftarrow$: We prove that $M\oplus N$ is free for a suitable $N$.
We set
    $K:=\bigoplus _{m\in M}R$, $f:K\to M$
where $f$ is defined as in the proof of theorem 11.7 $\Rightarrow$. We obtain an exact sequence
    $0\rightarrow \ker f{\overset {\iota }{\hookrightarrow }}K{\overset {f}{\rightarrow }}M\rightarrow 0$
which by assumption splits as
which is why $\ker f\oplus M$ is isomorphic to the free module $K$ and hence itself free.$\Box$
Theorem 11.10:
Let $M$ and $N$ be projective $R$-modules. Then $M\otimes N$ is projective.
Proof:
We choose $L,K$ $R$-modules such that $M\oplus L$ and $N\oplus K$ are free. Since the tensor product of free modules is free, $(M\oplus L)\otimes (N\oplus K)$ is free. But
    $(M\oplus L)\otimes (N\oplus K)\cong (M\otimes N)\oplus (M\otimes K)\oplus (L\otimes N)\oplus (L\otimes K)$,
and thus $M\otimes N$ occurs as the summand of a free module and is thus projective.$\Box$
Theorem 11.11:
Let $M_{\alpha },\alpha \in A$ be $R$-modules. Then $\bigoplus _{\alpha \in A}M_{\alpha }$ is projective if and only if each $M_{\alpha }$ is projective.
Proof:
Let first each of the $M_{\alpha }$ be projective. Then each of the $M_{\alpha }$ occurs as the direct summand of a free module, and summing all these free modules proves that $\bigoplus _{\alpha \in A}M_{\alpha }$ is the direct summand of free modules.
On the other hand, if $\bigoplus _{\alpha \in A}M_{\alpha }$ is the summand of a free module, then so are all the $M_{\alpha }$s.$\Box$

## Flat modules

The following is a generalisation of projective modules:
Definition 11.12:
An $R$-module $M$ is called flat if and only if tensoring by it preserves exactness:
    $0\rightarrow N\rightarrow L\rightarrow K\rightarrow 0$ exact implies $0\rightarrow N\otimes _{R}M\rightarrow L\otimes _{R}M\rightarrow K\otimes _{R}M\rightarrow 0$ exact.
The morphisms in the right sequence induced by any morphism $f$ are given by the bilinear map
    $(x,m)\mapsto f(x)\otimes m$.
Theorem 11.13:
The module $S^{-1}R$ is a flat $R$-module.
Proof: This follows from theorems 9.10 and 10.?.$\Box$
Theorem 11.14:
Flatness is a local property.
Proof: Exactness is a local property. Furthermore, for any multiplicatively closed $S\subseteq R$
    $S^{-1}(M\otimes _{R}N)\cong S^{-1}M\otimes _{S^{-1}R}S^{-1}N$
by theorem 9.11. Since every $S^{-1}R$-module is the localisation of an $R$-module (for instance itself as an $R$-module via $rn=r/1n$), the theorem follows.$\Box$
Theorem 11.15:
A projective module is flat.
Proof:
We first prove that every free module is flat. This will enable us to prove that every projective module is flat.
Indeed, if $M$ is a free module and $\{e_{\alpha }\},\alpha \in A$ a basis of $M$, we have
    $M\cong \bigoplus _{\alpha \in A}R$
via
    $\sum _{\alpha \in A}r_{\alpha }e_{\alpha }\mapsto (r_{\alpha })_{\alpha \in A}$,
where all but finitely many of the summands on the left are nonzero. Hence, by distributivity of direct sum over tensor product, if we are given any exact sequence
    $0\rightarrow A\rightarrow B\rightarrow C\rightarrow 0$,
to show that the sequence
    $0\rightarrow A\otimes M\rightarrow B\otimes M\rightarrow C\otimes M\rightarrow 0$
is exact, all we have to do is to prove that
    $0\rightarrow A\otimes M\rightarrow B\otimes M\rightarrow C\otimes M\rightarrow 0$
is exact, since we may then augment the latter sequence by suitable isomorphisms
Theorem 11.16:
direct sum flat iff all summands are
Theorem 11.17:
If $M,N$ are flat $R$-modules, then $M\otimes _{R}N$ is as well.
Proof:
Let
    $0\rightarrow A\rightarrow B\rightarrow C\rightarrow 0$
be an exact sequence of modules.

## Torsion-free modules

The following is a generalisation of flat modules:
Definition 11.18:
Let $M$ be an $R$-module. The torsion of $M$ is defined to be the set
    $T(M):=\{m\in M|\exists r\in R:rm=0\}$.
Lemma 11.19:
The torsion of a module is a submodule of that module.
Proof:
Let $m,n\in T(M)$, $r\in R$. Obviously $m-n\in T(M)$ (just multiply the two annihilating elements together), and further $s(rm)=r(sm)=0$ if $sm=0$ (we used commutativity here).$\Box$
We may now define torsion-free modules. They are exactly what you think they are.
Definition 11.20:
Let $M$ be a module. $M$ is called torsion-free if and only if
    $T(M)=\{0\}$.
Theorem 11.21:
A flat module is torsion-free.
To get a feeling for the theory, we define $S$-torsion for a multiplicatively closed subset $S\subseteq R$.
Definition 11.22:
Let $S\subseteq R$ be a multiplicatively closed subset of a ring $R$, and let $M$ be an $R$-module. Then the $S$-torsion of $M$ is defined to be
    $T_{S}(M):=\{m\in M|\exists s\in S:sm=0\}$.
Theorem 11.23:
Let $S\subseteq R$ be a multiplicatively closed subset of a ring $R$, and let $M$ be an $R$-module. Then the $S$-torsion of $M$ is precisely the kernel of the canonical map $\pi _{S}:M\to S^{-1}M$.