Let RR be a and write for the Hom functor.

Statement (covariant in the second variable)

Fix a left RR-module MM. If

0→A′→uA→vA′′0 \to A' \xrightarrow{u} A \xrightarrow{v} A''

is an exact sequence of left RR-modules, then

0→HomR(M,A′)→u∗HomR(M,A)→v∗HomR(M,A′′)0 \to \mathrm{Hom}_R(M,A') \xrightarrow{u_*} \mathrm{Hom}_R(M,A) \xrightarrow{v_*} \mathrm{Hom}_R(M,A'')

is exact.

Equivalently: HomR(M,−)\mathrm{Hom}_R(M,-) preserves kernels (and monomorphisms), but it need not preserve cokernels (and epimorphisms).

Statement (contravariant in the first variable)

Fix a left RR-module NN. If

A′→uA→vA′′→0A' \xrightarrow{u} A \xrightarrow{v} A'' \to 0

is exact, then applying HomR(−,N)\mathrm{Hom}_R(-,N) yields an exact sequence

0→HomR(A′′,N)→v∗HomR(A,N)→u∗HomR(A′,N).0 \to \mathrm{Hom}_R(A'',N) \xrightarrow{v^*} \mathrm{Hom}_R(A,N) \xrightarrow{u^*} \mathrm{Hom}_R(A',N).
Failure of right exactness and Ext

The failure of Hom\mathrm{Hom} to be exact is measured by : ExtR1(−,N)\mathrm{Ext}^1_R(-,N) (and higher Extn\mathrm{Ext}^n) are the of HomR(−,N)\mathrm{Hom}_R(-,N), and every gives a (a special case of ).

If MM is , then HomR(M,−)\mathrm{Hom}_R(M,-) is exact. If NN is , then HomR(−,N)\mathrm{Hom}_R(-,N) is exact.

Examples

In the cyclic-group examples, let n≥2n\ge 2 be an integer.

Example 1: Hom need not be right exact (over Z\mathbb Z)

Start from the short exact sequence

0→Z→×nZ→Z/n→0.0 \to \mathbb Z \xrightarrow{\times n} \mathbb Z \to \mathbb Z/n \to 0.

Apply HomZ(−,Z)\mathrm{Hom}_{\mathbb Z}(-,\mathbb Z). Since Hom(Z/n,Z)=0\mathrm{Hom}(\mathbb Z/n,\mathbb Z)=0 and Hom(Z,Z)≅Z\mathrm{Hom}(\mathbb Z,\mathbb Z)\cong \mathbb Z, we get

0→0→Z→×nZ→ExtZ1(Z/n,Z)→0.0 \to 0 \to \mathbb Z \xrightarrow{\times n} \mathbb Z \to \mathrm{Ext}^1_{\mathbb Z}(\mathbb Z/n,\mathbb Z)\to 0.

The map Z→×nZ\mathbb Z\xrightarrow{\times n}\mathbb Z is not surjective for ∣n∣>1|n|>1, so Hom(−,Z)\mathrm{Hom}(-,\mathbb Z) fails to preserve the cokernel; the cokernel is

ExtZ1(Z/n,Z)≅Z/n.\mathrm{Ext}^1_{\mathbb Z}(\mathbb Z/n,\mathbb Z)\cong \mathbb Z/n.

Example 2: If MM is free, then Hom is exact

If M≅R⊕rM\cong R^{\oplus r} is free of finite rank rr, then

HomR(M,A)≅A⊕r.\mathrm{Hom}_R(M,A)\cong A^{\oplus r}.

Thus HomR(M,−)\mathrm{Hom}_R(M,-) is a finite product of the identity functor, hence exact (it preserves both kernels and cokernels).

Example 3: Vector spaces over a field

If kk is a field and VV is a kk-vector space, then VV is free (hence projective). Therefore Homk(V,−)\mathrm{Hom}_k(V,-) is exact, and equivalently

Extkn(V,W)=0(n>0)\mathrm{Ext}^n_k(V,W)=0 \quad (n>0)

for all kk-vector spaces WW.