Definition (Matrix) With $m,n\in\mathbb N$ a real-valued $(m,n)$ matrix $\bold A$ is an $m\cdot n$-tuple of elements $a_{ij}$, $i=1,\cdots,m$, $j=1,\cdots,n$, which is ordered according to a rectangular scheme consisting of $m$ rows and $n$ columns:
$$ \begin{bmatrix} a_{11}&a_{12}&\cdots&a_{1n}\\ a_{21}&a_{22}&\cdots&a_{2n}\\ \vdots&\vdots&&\vdots\\ a_{m1}&a_{m2}&\cdots&a_{mn} \end{bmatrix} $$
$(1,n)$-matrices are called rows and $(m,1)$-matrices are called columns. These special matrices are also called row/column vectors.
The sum of two matrices $\bold A,\bold B\in\R^{m\times n}$ is defined as the element-wise sum, i.e.,
$$ \bold A+\bold B\coloneqq \begin{bmatrix} a_{11}+b_{11}&\cdots&a_{1n}+b_{1n}\\ \vdots&&\vdots\\ a_{m1}+b_{m1}&\cdots&a_{mn}+b_{mn} \end{bmatrix}\in\R^{m\times n} $$
For matrices $\bold A\in\R^{m\times n}$, $\bold B\in\R^{n\times k}$, the elements $c_{ij}$ of the product $\bold C=\bold A\bold B\in\R^{m\times k}$ are computed as
$$ c_{ij}=\sum_{l=1}^na_{il}b_{lj},\quad i=1,\cdots,m\quad\ j=1,\cdots,k $$
Example
$$ \bold A= \begin{bmatrix} 1&2&3\\ 3&2&1 \end{bmatrix}\in\R^{2\times3},\ \bold B= \begin{bmatrix} 0&2\\1&-1\\0&1 \end{bmatrix}\in\R^{3\times2}\\ \bold A\bold B=\begin{bmatrix} 1&2&3\\ 3&2&1 \end{bmatrix} \begin{bmatrix} 0&2\\1&-1\\0&1 \end{bmatrix}= \begin{bmatrix} 2&3\\2&5 \end{bmatrix}\in\R^{2\times 2}\\ \bold B\bold A= \begin{bmatrix} 0&2\\1&-1\\0&1 \end{bmatrix} \begin{bmatrix} 1&2&3\\ 3&2&1 \end{bmatrix}= \begin{bmatrix} 6&4&2\\-2&0&2\\3&2&1 \end{bmatrix}\in\R^{3\times3} $$
From this example, we can see that matrix multiplication is not commutative, i.e., $\bold A\bold B\neq\bold B\bold A$.
Definition (Identity Matrix) In $\R^{n\times n}$, we define the identity matrix
$$ \bold I_n\coloneqq \begin{bmatrix} 1&0&\cdots&0\\ 0&1&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&1 \end{bmatrix}\in\R^{n\times n} $$
as the $n\times n$-matrix containing 1 on the diagonal and 0 everywhere else.
Let us have a look at some properties of matrices:
Associativity:
$$ \forall\bold A\in\R^{m\times n},\bold B\in\R^{n\times p},\bold C\in\R^{p\times q}\\ (\bold A\bold B)\bold C=\bold A(\bold B\bold C) $$
Distributivity:
$$ \forall\bold A,\bold B\in\R^{m\times n},\ \bold C,\bold D\in\R^{n\times q}\\ (\bold A+\bold B)\bold C=\bold A\bold C+\bold B\bold C\\ \bold A(\bold C+\bold D)=\bold A\bold C+\bold A\bold D $$
Multiplication with the identity matrix:
Definition (Inverse) Consider a square matrix $\bold A\in\R^{n\times n}$. Let matrix $\bold B\in\R^{n\times n}$ have the property that $\bold A\bold B=\bold I_n=\bold B\bold A$. $\bold B$ is called the inverse of $\bold A$ and denoted by $\bold A^{-1}$.
Not every matrix $\bold A$ possesses an inverse $\bold A^{-1}$. If this inverse does exist, $\bold A$ is called regular/invertible/nonsingular, otherwise singular/noninvertible. When the matrix inverse exists, it is unique.