![]() | 1 | initial version |
Yes and no.
Row reduction in (Z/9Z)^d corresponds to Hermite normal form of integer lattices. More precisely, (Z/9Z)^d corresponds to the quotient of Z^d by (9Z)^d and submodules are just the quotient by lattices in between. In practice let me consider the three following vectors
sage: V = FreeModule(Zmod(9), 4)
sage: v0 = V((1,2,3,4)); v1 = V((1,0,2,0)); v2 = V((3,3,0,3))
Then what you can do is to lift everything to Z^d
sage: m = matrix(ZZ, 7, 4)
sage: m.set_row(0, v0)
sage: m.set_row(1, v1)
sage: m.set_row(2, v2)
sage: m.set_row(3, (9,0,0,0))
sage: m.set_row(4, (0,9,0,0))
sage: m.set_row(5, (0,0,9,0))
sage: m.set_row(6, (0,0,0,9))
sage: print m[1 2 3 4]
[1 0 2 0]
[3 3 0 3]
[9 0 0 0]
[0 9 0 0]
[0 0 9 0]
[0 0 0 9]
Now a vector in (Z/9Z)^4 belongs to the (Z/9Z)-span of v0,v1,v2 if and only if any of its lift belong to the row space of m. And you can do it as follows
sage: F = m.row_space()
sage: v = V((2,0,2,0))
sage: v.lift() in F
False
sage: v = 2*v0 + 3*v1 +7*v2
sage: v.lift() in F
True
I aimed to made this available within Sage with ticket #6452 but currently it lacks reviewer...