Let (A,m) be a local ring and M be a finitely generated A-module contained in a free module F of rank r with length(F/M) < $\infty$. Then I have the following question : Is the statement "M doesn't have a non-trivial free summand if and only if M$\subset$mF " true? I was trying around Nakayama's lemma
[Math] Free direct summand of a module
ac.commutative-algebra
Related Solutions
It is impossible to produce an example of a finitely generated flat $R$-module that is not projective when $R$ is an integral domain. See: Cartier, "Questions de rationalité des diviseurs en géométrie algébrique," here, Appendice, Lemme 5, p. 249. Also see Bourbaki Algèbre Chapitre X (Algèbre Homologique, "AH") X.169 Exercise Sect. 1, No. 13. I also sketch an alternate proof that there are no such examples for $R$ an integral domain below.
Observe that, for finitely generated $R$-modules $M$, being locally free in the weaker sense is equivalent to being flat [Bourbaki, AC II.3.4 Pr. 15, combined with AH X.169 Exercise Sect. 1, No. 14(c).]. ($R$ doesn't have to be noetherian for this, though many books seem to assume it.)
There's a concrete way to interpret projectivity for finitely generated flat modules. We begin by translating Bourbaki's criterion into the language of invariant factors. For any finitely generated flat $R$-module $M$ and any nonnegative integer $n$, the $n$-th invariant factor $I_n(M)$ is the annihilator of the $n$-th exterior power of $M$.
Lemma. (Bourbaki's criterion) A finitely generated flat $R$-module $M$ is projective if and only if, for any nonnegative integer $n$, the set $V(I_n(M))$ is open in $\mathrm{Spec}(R)$.
This openness translates to finite generation.
Proposition. If $M$ is a finitely generated flat $R$-module, then $M$ is projective iff its invariant factors are finitely generated.
Corollary. The following conditions are equivalent for a ring $R$: (1) Every flat cyclic $R$-module is projective. (2) Every finitely generated flat $R$-module is projective.
Corollary. Over an integral domain $R$, every finitely generated flat $R$-module is projective.
Corollary. A flat ideal $I$ of $R$ is projective iff its annihilator is finitely generated.
Example. Let me try to give an example of a principal ideal of a ring $R$ that is locally free in the weak sense but not projective. Of course my point is not the nature of this counterexample itself, but rather the way in which one uses the criteria above to produce it.
Let $S:=\bigoplus_{n=1}^{\infty}\mathbf{F}_2$, and let $R=\mathbf{Z}[S]$. (The elements of $R$ are thus expressions $\ell+s$, where $\ell\in\mathbf{Z}$ and $s=(s_1,s_2,\dots)$ of elements of $\mathbf{F}_2$ that eventually stabilize at $0$.) Consider the ideal $I=(2+0)$.
I first claim that for any prime ideal $\mathfrak{p}\in\mathrm{Spec}(R)$, the $R_{\mathfrak{p}}$-module $I_{\mathfrak{p}}$ is free of rank $0$ or $1$. There are three cases: (1) If $x\notin\mathfrak{p}$, then $I_{\mathfrak{p}}=R_{\mathfrak{p}}$. (2) If $x\in\mathfrak{p}$ and $\mathfrak{p}$ does not contain $S$, then $I_{\mathfrak{p}}=0$. (3) Finally, if both $x\in\mathfrak{p}$ and $S\subset\mathfrak{p}$, then $I_{\mathfrak{p}}$ is a principal ideal of $R_{\mathfrak{p}}$ with trivial annihilator.
It remains to show that $I$ is not projective as an $R$-module. But its annihilator is $S$, which is not finitely generated over $R$.
[This answer was reorganized on the recommendation of Pete Clark.]
Let $\{V_i\}$ be representatives from each of the isomorphism classes of simple left $S$-modules. For any finite length module ${}_S M$, let $\ell_S(M; V_i)$ denote the number of times that $V_i$ occurs in a composition series for $M$. Then the following formula holds (where almost all $\ell(M;V_i)$ are zero because $M$ has finite length, but any single $\ell_R(V_i)$ could be infinite, and $\infty \cdot 0 = 0$):$$\ell_R(M) = \sum \ell_R(V_i) \cdot \ell_S(M; V_i).$$
Thus, a finite length $S$-module $M$ has finite $R$-length if and only if every simple $S$-module that occurs in $M$ has finite $R$-length. This makes it clear that every finite length left $S$-module has finite $R$-length if and only if all simple left $S$-modules have finite $R$-length. The above discussion is true with no requirements on the ring $S$.
Now let's assume that $S$ is finitely generated as an $R$-module. (I'm not sure if this is what you meant by "finitely generated as an $R$-algebra," but it's probably true in the cases that you're studying if you're looking at maximal orders.) I'll prove that $S$ has finitely many simple modules, each of which has finite $R$-length. Let $J(A)$ denote the Jacobson radical of any ring $A$. Then $\mathfrak{m} = J(R) \subseteq J(S)$ because $S$ is a module-finite $R$-algebra; for a proof of this fact, see Lam's A First Course in Noncommutative Rings, Proposition 5.7. Now the simple $S$-modules are the same as the simple $S/J(S)$ modules (see Proposition 4.8 of the same text). But $S/\mathfrak{m} S \twoheadrightarrow S/J(S)$. Because $S$ is module-finite over $R$, $S/\mathfrak{m} S$ has finite $R$-length. Thus $S/J(S)$ has finite $R$-length. So $S/J(S)$ is artinian (the terminology here is that $S$ is a semilocal ring) and thus has finitely many simple modules, each of which has finite $R$-length. The same must be true for the simple $S$-modules
The formula above also verifies your formula in the case of a matrix ring. In case $S = \mathbb{M}_n(R)$, $S$ has a unique simple left module $V = (R/\mathfrak{m} \ \cdots \ R/\mathfrak{m})^T$, the set of all column vectors of length $n$ with entries in $R/\mathfrak{m}$. (At least one way to see that this is the only simple $S$-module is through Morita theory: the Morita equivalence between $R$-$\operatorname{Mod}$ and $S$-$\operatorname{Mod}$ sends the unique simple $R$-module $R/\mathfrak{m}$ to $V$, so that $V$ must be the unique simple $S$-module.) Since $\ell_R(V) = n$, the formula above reduces to $\ell_R(M) = n \cdot \ell_S(M)$.
(If something above doesn't make sense, you may want to review Jordan-Hoelder theory.)
Best Answer
The answer to your question is: no, it is not true. Here is a counterexample.
$(A,\mathfrak m)=(\mathbb Z_p,p\mathbb Z_p)$ is the (local Noetherian commutative) ring (PID) of $p$-adic integers (you can construct this ring in many ways... probably the standard one is to complete $\mathbb Z$ with respect to the $p$-adic topology -a base for this topology is given by the powers of the maximal ideal $p\mathbb Z$- the result is that $\mathbb Z_p$ is the inverse limit of the groups of the form $\mathbb Z/p^n$ with the canonical transition maps).
Now, take $F=A$ and $M=p^2 A$. It follows essentially by the definition of $\mathbb Z_p$ that I gave you, that $F/M\cong \mathbb Z/p^2$ that has composition length $2$, in particular this is finite. Anyway, $M\cong A$ as modules (just consider the morphism $A\to M$ such that $x\mapsto p^2x$... then surjectivity is obvious and injectivity follows by the fact that $A$ is a domain and so multiplication by $p^2$ has trivial kernel). Thus $M$ has not only free summands but it is itself free. Finally, notice that $pA\supsetneq p^2A=M$ so $M$ is properly contained in $\mathfrak m F$.