Copyright (C) 2020 Andreas Kloeckner
import numpy as np
n = 4
Let's create an elimination matrix as $M$:
M = np.eye(n)
M[1,0] = 2
M
Here's a matrix $A$. See if $M$ has the desired effect on $A$:
np.random.seed(5)
A = np.random.randn(n, n).round(1)
A
M.dot(A)
Next, see if you can build the inverse of $M$:
Minv = np.eye(n)
Minv[1,0] = -2
Minv
M.dot(Minv)