# Canonical way of turning implicit equations into a subspace and vice versa

Many times I want to go back and forth between the parametric equations of a subspace and its representation as an implicit equation.

For example, I may have a hyperplane in QQ^3 defined by the equation $ax+by+cz=0$, and I may want to turn it into a subspace object in sage. Or I may start with a subspace generated by span([v2,v3]) and I may want to compute its associated subspace in the dual and thus its implicit equations. What is the canonical way of doing so in Sage?

I thought that the method annihilator was what I was looking for, but so far I have not managed to make it work. Any other suggestions?

edit retag close merge delete

Sort by » oldest newest most voted

I am not sure how "canonical" it is, but i would do the following:

For your first question, satisfying an equatiion corresponds to gelonging to some kernel:

sage: M = matrix(QQ,[[1,2,3,]])
sage: M.right_kernel()
Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[   1    0 -1/3]
[   0    1 -2/3]

sage: M.right_kernel().basis()
[
(1, 0, -1/3),
(0, 1, -2/3)
]


So, the set of vectors that satifsfy ax+by+cz=0 are the t_1 * (1, 0, -1/3) + t_2 * (0, 1, -2/3) for t_1 and t_2 in QQ.

For your second question, you can do:

sage: v1 = vector(QQ,(1,2,3))
sage: v2 = vector(QQ,(4,5,6))

sage: V = span([v1,v2],QQ) ; V
Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[ 1  0 -1]
[ 0  1  2]

sage: vector((5,7,9),QQ) in  V
True

more

Right kernel was exactly what I was looking for! However, I think I have been confusing in my second question. Now I want to go back to the implicit equations. What I have thought of now that I know that right_kernel is a thing is using A.basis_matrix().right_kernel(), where A is a vectorial space. I am wondering though if there is a shorthand version of this. Any idea?