Linear combination of elements of sets- finding "basis" and implementation in Python/SAGE

580 Views Asked by At

I actually have a question concerning both linear algebra and SAGE (or just Python) implementation.

Consider for example set with $6$ elements $a,b,c,d,e,f$ and I know some relations that hold between them, for example,

$$a+b+c=0,\quad a+d-e=0,\quad a+b+d=0$$

If element is not in the list of relations it is consider as an element of the basis (since it is independent), so $f$ is in the basis. We also get from here $c=d$, $a=-b-c$, $e=-b$. So our basis is $b,c,f$.

I would like to know how do I implement this. I considered representing elements of the set as elements of standard basis and i considered matrix which represent these linear combination: $$\begin{bmatrix} 1 & 1 & 1 & 0 & 0 & 0 \\ 1&0&0&1&-1&0\\1&1&0&1&0&0 \end{bmatrix}$$ Then I took its right kernel and got this basis matrix: $$\begin{bmatrix} 1 & 0 & -1 & -1 & 0 & 0 \\ 0&1&-1&-1&-1&0\\0&0&0&0&0&1 \end{bmatrix}$$

From here it is not hard to see that i can take $\{a,b,f\}$ but how to get representation of other elements using basis elements? I think I am missing something, and I think my main problem is that I don't know pseudocode which could work here?