What is the coequalizer of two $m \times n$ matrices in $\text{Matr$_K$}$? 
What is the coequalizer of two $m \times n$ matrices in $\text{Matr$_K$}$?$(K$ is a commutative ring, objects are positive integers, and arrows are $m \times n$ matricies$)$

If $A_{m \times n},B_{m \times n}$ are matrices (arrows $A,B: n \rightarrow m)$, then I would have to find a matrix $E_{e \times m}$ with $EA=EB$ such that for every $H_{d \times m}$ there's a unique $H'_{d \times e}$ such that $H' \circ E = H$.
I first tried to work with $E$ being the zero matrix but it doesn't satisfy the above composition.
Anyone have any ideas?
 A: Let $C = A - B$. We want to prove that an $(e \times m$)-matrix $E$ is a coequalizer of $A$ and $B$ if and only if the vectors $v_1, \dotsc, v_e$ obtained by transposing the rows of $E$ are a basis of $\ker C^\top$.
$(\Rightarrow)$ If $E$ is a coequalizer of $A$ and $B$, then $v_1, \dotsc, v_e$ are a basis of $\ker C^\top$.
First of all, since $EC = EA - EB = 0$, we have that $C^\top E^\top = (EC)^\top = 0$, and so $C^\top v_i = 0$ for any $i = 1, \dotsc, e$, which proves that $v_i \in \ker C^\top$ for any $i = 1, \dotsc, e$.
Now, suppose $v \in \ker C^\top$. Then $C^\top v = 0$, i.e. $v^\top C = (C^\top v)^\top = 0$. Let $H$ be the $(1 \times m)$-matrix having $v^\top$ as its only row, i.e. $H = v^\top$. Since $HC = HA - HB = 0$, we have that $HA = HB$, and so there exists a unique $(1 \times e)$-matrix $H'$ such that $H' E = H$. If $H' = (\alpha_1, \dotsc, \alpha_e)$, then from $v^\top = H = H' E$ we get that $v^\top = \alpha_1 v_1^\top + \dotsb + \alpha_e v_e^\top$, i.e. $v = \alpha_1 v_1 + \dotsb + \alpha_e v_e$, which is the unique linear combination representing $v$. Therefore $v_1, \dotsc, v_e$ is a basis of $\ker C^\top$.
$(\Leftarrow)$ If $v_1, \dotsc, v_e$ are a basis of $\ker C^\top$, then $E$ is a coequalizer of $A$ and $B$.
First of all, by definition of $E$, the $i$-th row of $EC$ is $v_i^T C = (C^\top v_i)^\top = 0$ for $i = 1, \dotsc, e$, and so $EC$ is a zero matrix, which implies that $EA = EB$.
Suppose now that $H$ is a $(d \times m)$-matrix such that $HA = HB$, and let $w_j$ be the vector obtained by transposing the $j$-th row of $H$, for $j = 1, \dotsc, d$. Since $HC = HA - HB = 0$, also $C^\top H^\top = (HC)^\top = 0$, and so $w_j \in \ker C^\top$ for all $j = 1, \dotsc, d$. Therefore, each $w_j$ is represented by a unique linear combination of $v_1, \dotsc, v_e$. Let $H'$ be the $(d \times e)$-matrix having the coefficients of the linear combination representing $w_j$ as its $j$-th row, for $j = 1, \dotsc, d$. It follows that $H' E = H$.
Finally, suppose $H''$ is a $(d \times e)$-matrix such that $H'' E = H$. Then $(H'' - H') E = 0$. Notice that $E$ is a full rank matrix with at least as many columns as rows (because its rows are linearly independent), and so it is right invertible. Thus $H'' - H' = 0$ and so $H'' = H'$.

If $K$ is a field, then $\ker C^\top$ is a finite dimensional vector space over $K$, and so we can always find a basis $v_1, \dotsc, v_e$ of $\ker C^\top$, and thus also a coequalizer $E$ of $A$ and $B$.
If $K$ is not a field, then there might not exist a coequalizer $E$ of $A$ and $B$. Indeed, let $K = \mathbb R [x, y, z]/(x^2 + y^2 + z^2 - 1)$ and let $A$ and $B$ be two $(3 \times 1)$-matrices such that $C = (x, y, z)^\top$. Then
$$ \ker C^\top = \{ (f, g, h) \in K^3 : x f + y g + zh = 0 \text{ in } K \}$$
which is not a free module, as proved in this paper by K. Conrad.
A: This construction assumes that $\mathbb{K}$ is a field.
You have it slightly wrong: 
For every $H : m \to d$ $\color{blue}{\text{ such that } HA = HB}$ there needs to exist a unique $H' : e \to d$ such that $H'E = H$.
Look at $A, B$ as linear maps from $\mathbb{K}^n \to \mathbb{K}^m$. Consider the equivalence relation $\sim$ defined as $x \sim y \iff Ax = Bx$.
Since $\{x \in \mathbb{K}^m : Ax = Bx\} = \operatorname{Im}(A - B)$, the quotient set $\mathbb{K}^m/_\sim$ is also a vector space and it is equal to $\mathbb{K}^m/{\operatorname{Im}(A - B)}$. 
Define $$e = \dim \Big(\mathbb{K}^m/{\operatorname{Im}(A - B)}\Big)$$
and define $E$ to be the matrix representing the quotient map $\mathbb{K}^m \to \mathbb{K}^m/{\operatorname{Im}(A - B)}$ given by $x \mapsto x \operatorname{Im}(A - B).$
Let's show that $(e, E)$ is indeed the coequalizer.
Let $x \in \mathbb{K}^n$. We have:
$$E(Ax) = E(Bx) \iff (Ax)\operatorname{Im}(A - B) = (Bx)\operatorname{Im}(A - B) \iff (A - B)x = Ax - Bx \in \operatorname{Im}(A - B)$$
The last relation is true so $EA = EB$.
Now let $d \in \mathbb{N}$ and $H : m \to d$ be a matrix such that $HA = HB$. Rerranging gives $0 = HA - HB = H(A - B)$, which implies $\operatorname{Im}(A - B) \subseteq \operatorname{Ker}H$.
Define $H'$ to be the matrix representing the linear map $\mathbb{K}^m/{\operatorname{Im}(A - B)} \to \mathbb{K}^d$ given by $x\operatorname{Im}(A - B) \mapsto Hx$.
$H'$ is well defined. Indeed, assume $x\operatorname{Im}(A - B) = y\operatorname{Im}(A - B)$. We have:
$$x\operatorname{Im}(A - B) = y\operatorname{Im}(A - B) \implies x - y \in \operatorname{Im}(A - B) \implies x - y \in \operatorname{Ker}H \implies Hx = Hy$$
The equality $H'E = H$ is true by definition of $H'$.
