'Returns True if ``other`` is a submodule of ``self``.
>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> M = F.submodule([2, x])
>>> F.is_submodule(F)
True
>>> F.is_submodule(M)
True
>>> M.is_submodule(F)
False'

def is_submodule(self, other):

    if isinstance(other, SubModule):
        return (other.container == self)
    if isinstance(other, FreeModule):
        return ((other.ring == self.ring) and (other.rank == self.rank))
    return False
