If $W\_1,W\_2 \subset V$ are finite-dimensional $k$-vector spaces of dimensions $d\_1, d\_2 \leq d$, respectively, then $d\_1 + d\_2 > d$ suffices to guarantee $W\_1 \cap W\_2 \neq \{0\}$. There are similar results for affine subspaces of a spaces of a $k$-vector space, $E\_1,E\_2 \subset V$.


I'm looking for analogous results for submodules of a free $R$-module $N\_1,N\_2 \subset M$ of finite ranks $r\_1,r\_2 \leq r$, and for "affine submodules" (i.e. torsors/cosets/translates of submodules), $A\_1,A\_2 \subset R$.


The main question I'm interested in is **what can be said about the intersections** $N\_1\cap N\_2, A\_1\cap A\_2$ (i.e. are they nonzero or nonempty?) given certain conditions on the subspaces (i.e. they are (translates of) submodules of certain rank). I currently have in mind $\mathbb{Z}$-modules, but I am also interested in modules over other rings (probably all Noetherian). In addition to intersections, I'd be interested to read more general information. The notion of greatest common divisor is evidently at play here.


I would be interested in **good references/resources** or in **direct statements/proofs** of useful results.


E.g. Consider the translates of rank-2 $\mathbb{Z}$-modules $$A\_1 = (u\_1,v\_2,w\_1)+\langle (a\_1,b\_1,c\_1),(a\_2,b\_2,c\_2) \rangle$$
$$A\_2=(u\_2,v\_2,w\_2)+\langle (a\_3,b\_3,c\_3),(a\_4,b\_4,c\_4) \rangle \subset \mathbb{Z}^3$$
What is $A\_1 \cap A\_2$?


Lastly I have a **terminology question**, relating to an important distinction between the module case and the vector space case. Is there a name for the property of a submodule being maximal with respect to its rank? ("primitive"?) For example $\langle (2,4) \rangle \subset \mathbb{Z}^2$ is a free rank-1 submodule, but it is properly contained in the free rank-1 submodule $\langle (1,2) \rangle$, which is not properly contained in another rank-1 submodule.


Thank you.



Intersection of free/affine submodules, comparison with vector spaces
There is a natural generalization of the aforementioned dimension-based reasoning to modules $M$ over commutative domains or commutative Noetherian reduced rings.


Let $M$ be a module over a commutative domain $R$ and let $K$ be the fraction field of $R$. We set $\text{rk}(M) \Doteq \dim\_K(M \otimes\_R K)$. 



> 
> 
> > 
> > **Claim.** Let $R$ be a commutative domain. Let $M$ be an $R$-module of finite rank over $R$ and let $N\_1, N\_2 \subseteq V$ be submodules of $M$. Then we have $\text{rk}(N\_1) + \text{rk}(N\_2) = \text{rk}(N\_1 \cap N\_2) + \text{rk}(N\_1 + N\_2)$.
> > 
> > 
> > *Proof.* Let $f: N\_1 \oplus N\_2 \rightarrow M$ be the $R$-linear map defined by $f(n\_1, n\_2) = n\_1 + n\_2$. It suffices to apply the exact functor $(-)\otimes\_R K$ to the exact sequence 
> >  $0 \rightarrow N\_1 \cap N\_2 \rightarrow N\_1 \oplus N\_2 \xrightarrow[]{f} N\_1 + N\_2 \rightarrow 0$ and then use the [Rank-Nullity Theorem](https://en.wikipedia.org/wiki/Rank%E2%80%93nullity_theorem).
> > 
> > 
> > 
> 
> 
> 


If $R$ is any commutative reduced Noetherian ring, then its [total ring of fractions](https://en.wikipedia.org/wiki/Total_ring_of_fractions) $K$ is a product $\prod\_i K\_i$ of finitely many fields $K\_i$. 
We set $\text{rk}(M) \Doteq (\dim\_{K\_i}(M \otimes\_R K\_i))\_i$, a finite-dimensional vector with integer coordinates. The same claim will hold true if we replace "domain" by "reduced Noetherian ring" and if vectors are ordered component-wise.


**About the terminology.** Let $R$ be a commutative domain, $M$ a torsion-free module over $R$ and $N$ an $R$-submodule of $M$. Let us call $N$ a *primitive submodule of $M$* if there is no non-invertible element $d \in R$ such that $N = dN'$ for some submodule $N'$ of $M$. If $R$ is moreover Noetherian, then every submodule $N$ is contained a primitive submodule of $M$. If $M$ is free of finite rank and if $R$ is an elementary divisor ring (e.g., a principal ideal domain), then a finitely generated submodule $N$ is a primitive submodule of $M$ if and only if the minimal number of generators of $M/N$ is strictly less that $\text{rk}(M)$, if and only if $N$ has a generating set containing a basis vector of $M$, or *primitive vector of $M$*. 
In the theory of orders in quadratic number fields, the terminology *primitive ideal* is standard and has a meaning which is close to our definition.


**About affine submodules.** Let $R$ be any commutative ring with identity and let $M$ be an $R$-module. Let $N\_1, N\_2$ be two submodules of $M$.
Let $a\_1, a\_2 \in M$ and set $A\_i = a\_i + N\_i$ for $i = 1,2$. Then $A\_1 \cap A\_2$ is non-empty if and only if $a\_1 - a\_2 \in N\_1 + N\_2$. If $A\_1 \cap A\_2$ is not empty, then it is an affine $R$-module of the form $s + N\_1 \cap N\_2$ where $s$ is any element of $A\_1 \cap A\_2$. From now on, we assume that $R$ is a domain or a reduced Noetherian ring with total ring fractions $K$. In this case, the rank of $N\_1 \cap N\_2$ is subject to the relation of the above claim. If $M$ is moreover torsion-free of finite rank and $N\_1$ and $N\_2$ are both finitely generated, then deciding whether $A\_1 \cap A\_2$ is $\{0\}$ boils down to deciding whether $AX = B$ has a solution $X \in R^n$ for some $m$-by-$n$ matrix $A$ over a field and some $B \in R^n$. This can be handled by linear algebra if $B = 0$. Let us assume now that $R$ is a domain and both $N\_1$ and $N\_2$ are finitely generated over $R$. Compute a minimal generating set of $V\_1 \cap V\_2$ is manageable if $R$ is an [elementary divisor ring](https://commalg.subwiki.org/wiki/Elementary_divisor_ring) (see also this [MO post](https://mathoverflow.net/questions/31275/does-smith-normal-form-imply-pid/31306#31306)), e.g., a principal ideal ring. In this case, we can use the Smith Normal Form of $A$ to solve $AX = 0$. If $M$ is free of finite rank over $R$, we can do the same for the equation $AX = B$ under the same assumptions.


As the localization at any prime $\mathfrak{p}$ of a Dedekind ring $R$ is principal ideal domain, we obtain a Smith Normal Form of $A$ over $R\_{\mathfrak{p}}$ for any such $\mathfrak{p}$. This yields an algorithm to decide on the existence of solutions for the system $AX = B$: we only need to check existence for the minimal prime ideals containing the *Fitting ideal of $A$*, see [5, Proposition 20.7 and subsequent comment].


**Addendum.** Here is an example of what can be achieved by [sage](http://doc.sagemath.org/html/en/).



```
K = CyclotomicField(4)
R = K.maximal_order() # R = Z[i], the ring of Gaussian integers. The 
ring R is Euclidean.
i = K.gen();

# Definition of the intersection problem of two affine planes in R^3
b_1 = vector([4 * i + 6, -7 * i , -19 + 17 * i])
b_2 = vector([-1, 35, 0])
A_1 = Matrix(R, [[ 0, 2 - i], [ 3 - 2 * i,  -i ], [ 0, 1 + 7 * i]])
A_2 = Matrix(R, [[ 2 - i, 1 + 2 * i], [ 0, 1 - i], [ 1, 0]])

# Concatenating A_1 with -A_2
A_2 = - A_2
C = [ c for c in A_1.columns() ]
C += [ c for c in A_2.columns() ] 
A = Matrix(R, C).transpose();

# Finding one solution
# Note: solve_right() may find a solution with coordinates in the fraction field of R but not in R
# I don't know if in the latter case this indicates that there is no solution.
A.solve_right(b_2 - b_1); # In our example, it finds (7*zeta4 + 8, -3*zeta4 - 2, 0, 0) where zeta4 stands for i.

# Using is_submodule() to check existence of solutions
M = R^3
N = M.submodule(A.transpose()) # This is the submodule generated by the columns of A.
L = M.span(Matrix(R, b_1 - b_2))
ans = L.is_submodule(M); 
ans; # The answer is yes, our linear system has at least one solution in R^3.

# Using intersection() to describe the whole solution set
N_1 = M.span(A_1.transpose())
N_2 = M.span(A_2.transpose())
N_1.intersection(N_2); # This is the rank 1 R-module generated by [4*zeta4 + 7 -7*zeta4 - 35 17*zeta4 - 19] in our example

# Using kernel() to describe the whole solution set
kerA = kernel(A.transpose())
solution_dim = len(kerA.basis()) # This is 1 in our example.
basis_vector = kerA.basis()[0];
x_1 = vector([ basis_vector[index] for index in range(0, 2)]) 
n_1 = Matrix(R, A_1) * x_1; # This vector generates N_1 \cap N_2 over R in our example.

# Using smith_form() to describe the whole solution set
# With the invariant factor matrix and the two change-of-basis matrices
# you can decide whether the linear system has a solution and describe the full set of solutions
A.smith_form();

```

**Edit.** As explained above, the resolution of linear systems of the form $AX = B$ over an arbitrary commutative case is particularly relevant to the question when each module $M\_i \, (i = 1, 2)$ is given with an explicit embedding in some free module $R^{k\_i}$. I just realized that there exist general theorems by means of which one can decide on the existence and uniqueness of solutions.


MacCoy's Theorem [2, Th. 51] addresses the problem as to whether the system $AX = 0$ has a non-trivial solution $X \in R^n$ for $A$ an $m \times n$ matrix over an arbitrary commutative ring $R$: a non-trivial solution exists if and only if the *determinantal rank* of $A$ is less than $n$. 


[3, Proposition 1] shows that $AX = B$ has a solution in $R^n$ if and only if the localized system at $\mathfrak{m}$ has a solution in $R\_{\mathfrak{m}}^n$ for every maximal ideal $\mathfrak{m}$ of $R$, an arbitrary commutative ring. [3, Theorem 6] and [4, Theorem 10] give (the same) necessary and sufficient conditions for the existence of solutions of the system $AX = B$ when $R$ is a Prüfer domain, generalizing a result of E. Steinitz [1] established for Dedekind rings.




---


[1] E. Steinitz, "Rechteckige systeme and moduln in algebraischen zahlkorpern", 1912.


[2] N. MacCoy, "Rings and Ideals", 1948. 


[3] P. Camion, L. Levy and H. Mann, "Linear equations over a commutative ring", 1971. 


[4] J. Hermida and T. Sanchez-Giralda, "Linear equations and commutative rings", 1986. 


[5] D. Eisenbud, "Commutative Algebra with a View Toward Algebraic Geometry", 2004.


