Hi everybody !

I’m now busy with the submodule concept as described in AbstractAlgebra package documentation.

I noticed that, on my point of view, a lot of things are missing in the interface.

For example as a minimum it would be good to decide if some vector of a module M belongs to some submodule S of M.

Such test function apparently doesn’t exist but AA proposes the computation of the intersection of two submodules of the same module, and it seems to be working very well.

So to know if y belongs to S it’s enough to see the generators of the intersection of S with the submodule of dimension 1 generated by y (straight line) if one generator y in S if 0 generators y not in S.

Here’s a test program :

```
using AbstractAlgebra
F = FreeModule(ZZ, 3)
@show F
v=F([1,2,3])
w=F([1,1,0])
@show v,w
S,f=sub(F,[v,w])
@show S
@show f
@show(gens(S))
@show f(gen(S,1)) #-v+2w
@show f(gen(S,2)) #v-w
S1,f1=sub(F,[v+w])
@show intersect(S,S1) #donc v+w appartient à S
y=F([0,0,1])
S2,f2 =sub(F,[y])
@show intersect(S,S2) #donc y n'appartient pas à S
```

result (output)

```
F = Free module of rank 3 over Integers
(v, w) = ((1, 2, 3), (1, 1, 0))
S = Submodule over Integers with 2 generators and no relations
f = Module homomorphism with
Domain: Submodule over Integers with 2 generators and no relations
Codomain: F
gens(S) = AbstractAlgebra.Generic.SubmoduleElem{BigInt}[(1, 0), (0, 1)]
f(gen(S, 1)) = (1, 0, -3)
f(gen(S, 2)) = (0, 1, 3)
intersect(S, S1) = (Submodule over Integers with 1 generator and no relations
, Module homomorphism with
Domain: Submodule over Integers with 1 generator and no relations
Codomain: Submodule over Integers with 2 generators and no relations
)
intersect(S, S2) = (Submodule over Integers with 0 generators and no relations
, Module homomorphism with
Domain: Submodule over Integers with 0 generators and no relations
Codomain: Submodule over Integers with 2 generators and no relations
)
```

Going a little farther considering two submodules generated by two distinct sets, it is possible to decide if the two modules are equal by testing that every member of the first set belongs to the second submodule and conversely. So a test S==S1 could be provided.

I would like to know if users of AA agree with me or if I miss something and I am too naive. Of course I understand that all these questions sum up to solving linear systems, which is easy for vector spaces over the rationals but more delicate for module over the ring of integers.

Thank you for any reaction.

Gilles