How to introduce notions of flat, projective and free modules? In the coming spring semester I will be teaching for the first time an introductory (graduate) course in Commutative Algebra.  As many people know, I have been plugging away for a while at this subject and keeping my own lecture notes.  So I feel relatively prepared to teach the course in the sense that I know more than enough theorems and proofs to cover.  However, there is more to teaching a graduate course than just theorems and proofs.  Commutative algebra has a reputation for being somewhat dry and unmotivated.  After something like 10 years of hard work (over a period of about 15 years!), I am at a point where I find the subject both interesting in and of itself and useful.  But how to communicate this to students?  
Looking through my notes, the technicalities begin with the introduction of various fundamental classes of modules, especially free, projective and flat modules (but also including other things like finite generation and finite presentation).  I remember well that when I first learned this material, projective and (especially) flat modules were a tough sell: for instance, the first time  I picked up Bourbaki's Commutative Algebra out of curiosity, I saw that the very first chapter was on flat modules, and I put it down in horror.  
How would you introduce these concepts to an early career graduate student?  What are the fundamental differences between these classes of modules, and why do we care?
Here are some of my preliminary thoughts:
1) Free modules are of course an easy sell: for such things the usual notions of linear algebra work well, including that of dimension (called "rank" in this case: note that my rings are commutative!).  One can easily prove that for a commutative ring R, all R-modules are free iff R is a field, so the need to move beyond free modules is easily linked to the ideal theory of R.
2) Projective modules are important for at least the following reasons.
a) Geometric: A finitely generated module over a ring R is projective iff it is locally free (in the stronger sense of an open cover of $\operatorname{Spec} R$).  In other words, projective modules are the way to express vector bundles in algebraic language.  I plan to drive this point home by discussing Swan's theorem on modules over $C^{\infty}(M)$. 
b) Homological: projective modules play a distinguished role in homological algebra, i.e., in the construction of left-derived functors.  
c) K-theoretic: It is of interest to know to what extent finitely generated projective modules must be free.  This leads to the construction of $K_0(R)$ -- i.e., stable isomorphism classes of projective modules -- and in the rank one case, to the Picard group $\operatorname{Pic}(R)$.  
(After writing the above, I feel that in some sense it is a good enough answer -- certainly these are three important reasons for studying projective modules.  But I'm not sure how to explain them to beginning students.  Let's be clear that this is part of the question.)
3) Flat modules: this is harder to explain!  
a) Geometric: Flatness is the "right" condition for things to vary nicely in families, but this is more of a mantra than an explanation.  I think that most people hear this at one point and come to believe and understand it slowly over time.
b) Homological: Flat modules are those which are acyclic for the Tor functors.  But this is not a homological algebra course: I would be happiest not to mention Tor at all.  
c) Near equivalence with projective modules in the finitely generated case: the difference between finitely generated flat and finitely generated projective modules is very subtle.  Recall for instance:
Theorem: For a finitely generated flat module $M$ over a commutative ring $R$, TFAE:
(i) $M$ is projective.
(ii) $M$ is finitely presented.
(iii) The associated rank function is locally constant.
Thus in almost all of the cases of importance to a beginning algebra student -- e.g. if $R$ is Noetherian or is an integral domain -- finitely generated flat modules are projective.
d) However infinitely generated flat modules are a much bigger class, since flatness is preserved under direct limits.  In particular, there are large classes of domains $R$ for which a module is flat iff it is torsionfree (namely this holds iff $R$ is a Prufer domain; even the case $R = \mathbb{Z}$ is useful).  Perhaps this is significant?
Your insight will be much appreciated.  

Update: the prevailing sentiment of the answers thus far seems to be that a very little bit of homological algebra will go a long way in presenting the basic definitions in a unified and useful way.  Duly noted.  
 A: This was one of the aspects of algebra that I enjoyed the most while first learning it. This is the way I would develop the subject:
1) Introduction to exact sequences with an emphasis on short exact sequences. We can use these to illustrate how the properties of any module in such a sequence are related to those of others. Relevant here would be discussions of theorems such as, length of a module is additive, a module has ACC/DCC if and only if a submodule and quotient modulo the submodule have ACC/DCC. We can also develop direct sums via short exact sequences, the short five lemma, the snake lemma here. 
2) Projective modules: Given a short exact sequence, $0\to L\to M\to N\to 0$, of $R$-modules, and some other $R$-module $T$ and a homomorphism $T\to L$ there exists a homomorphism $T\to M$ via composition. We can ask the opposite question. When does giving a homomorphism $T\to M$ give a homomorphism $T\to L$. This can be used to motivate $Hom_R(T,-)$. Then we can go on to show this functor is left exact. Then we define projective modules as those which make this functor exact. 
3) At this point I would introduce Free modules and motivating them via vector spaces as you suggested. I would also discuss free resolutions since this is a very elegant machinery. Then, I would show that projective modules are just direct summands of free modules. 
4) Injective modules: A similar development as for projective modules, this time via the functor $Hom_R(-,T)$. I would also develop the characterizations of injective modules via Baer's theorem and divisible modules. 
5) Flat modules: I shall then introduce the functors $T\otimes -$ and $- \otimes T$ and show these are right exact. Then define flat modules as those which make the above functors exact. I shall also discuss that projective modules are flat.
To tie all of this together, I shall then discuss the adjointness of Hom and $\otimes$ followed by Homological algebra if that is part of the course.
A: Another student answer:
Considering 2b, it seems a bit strange that you want to mention derived functors and not to go into $\mathbf{Tor}$ and $\mathbf{Ext}$. The problem with derived functors is that first of all, categories usually have enough injective objects. Secondly, projectives are just a suitable collection of objects to use, but not always. However, the universal property is really important here. Lifting morphisms is something extremely natural to ask (which is the exactness of $\mathbf{Hom}$). This is also a way to mention that projective modules are direct summands of free (which fits perfectly into you sequence of presentation).
Speaking of flat modules, I'd avoid saying about "varying nicely". It's not very convincing the first time you see it (like telling a child that to have a baby one should kiss his partner). I'd also be nice to somehow sneak in the adjointness of $\otimes$ and $\mathbf{Hom}$.
A: In the question there have been already mentioned many deep applications of these notions for modules (flat, projective, free). However, I think that an introductory course should not focus on these aspects. It would be very nice (at least for the ones who can follow...) if some applications are at least mentioned and are partially worked out as exercises. The students will learn the "big story" later, perhaps even in the same course of commutative algebra. But as for the introduction of these notions, I would just use the standard definitions (see Sean Tilson's answer). They later also apply in abelian categories (whereas, "free" generalizes rather to left adjoint functors). I think an introductory course should show the students how to work with the new objects and what can be done with them.
For example, it is pretty useful that a short exact sequence $0 \to I \to M \to P \to 0$ splits if $P$ is projective, and that the converse is also true: If $P$ has the property that every short exact sequence of the above type splits, then $P$ is projective. By duality, there is a dual statement characterizing the injectivity of $I$. A propos, it should be partially pointed out that the notions of projective and injective are dual to each other, and the reason that they differ so horribly in $R$-Mod comes from the fact that this category has no autoequivalence.
Concerning flatness, it should be pointed out that they are stable under directed colimits and have various other nice local properties which fails for the notions of projective and free.
Here is a beautiful theorem which fascinated me when I started to learn commutative algebra and algebraic geometry. It basically says that freeness of a module "extends from points to open neighborhoods".
Let $M$ be a finitely presented $A$-module and $\mathfrak{p} \subseteq A$ a prime ideal such that $M_\mathfrak{p}$ is free. Then there is some $f \in A \backslash \mathfrak{p}$, such that $M_f$ is free.
I would certainly include this in the course. The proof is also pretty illuminating, using some of the devissage arguments which are important in commutative algebra and algebraic geometry.
A: You might perhaps mention Lazard's theorem.
A: All of this is coming from the point of view of being a student. I took a commutative algebra course last winter and am currently taking a homological algebra course, so maybe I can touch on your differentiation between those two perspectives.
It sounds like you want the motivating ideas, and I think those make the most sense homologically. I completely understand your not wanting to introduce Tor and/or Ext, but you don't have to. $Hom_R (P,-)$ is exact iff $P$ is projective, $Hom_R (-,I)$ is exact iff $I$ is injective, and $F \otimes_R -$ is exact iff $F$ is flat. These can even be taken as definitions (these are equivalent to $Tor_1$ and $Ext^1$ vanishing which is each equivalent to all the higher derived functors vanishing). 
Edit: What if you don't know why you should care about exact sequences as Pete asked in a comment? Well, you should still care about when functors preserve injections (tensor-ing with flat modules) and surjections (Hom-ing out of projective modules), and this is precisely what flat and projective do for you. This is the only place where exactness might fail, so just skip it and talk about injections and surjections and when they are preserved.
This is how I feel most comfortable thinking about these concepts. It is pretty concrete and not far away from Commutative Algebra (I think, meaning that this is how we talked about it in my commutative algebra class).
I should also mention I appreciate you posting all of those course notes, it is a great resource for us students out there.
A: For me, the most intuitive characterization of flatness of an $R$-module $M$ is the "principle of sufficient reason": Whenever elements $x_i$ of $M$ satisfy a linear equation with coefficients in $R$, say $\sum_{i=1}^n r_ix_i=0$, then this is "because" of linear equations holding in $R$; that is, the $x_i$ can be expressed as linear combinations of other elements $y_j\in M$, say $x_i=\sum_j s_{ij}y_j$ (where $s_{ij}\in R$), such that $\sum_i r_is_{ij}=0$ for all $j$.  Thus the original linear relation among the $x$'s follows from the expressions in terms of the $y$'s plus properties in $R$ of the coefficients $r_i$ and $s_{ij}$.  
Admittedly, this description of flatness doesn't help much with geometry, but it clarifies the algebraic situation.  The same intuition also applies, for example, to the notion of "flat functor" that occurs in the study of classifying topoi.
A: Hi Pete, this sounds like a lot of fun! I wish I could be there (-:
Here is a  concrete and useful property of flatness, you can explain it without using Tor. Suppose $R\to S$ is a flat extension. 
Then if $I$ is an ideal of $R$, tensoring the exact sequence:
$$ 0 \to I \to R \to R/I \to 0$$ 
with $S$ gives that $I\otimes_RS = IS$. The left hand side is somewhat abstract object, but the right hand side is very concrete. 
There are very natural extensions which are flat but not projective. For example, if $R$ is Noetherian and $\dim R>0$, then $S=R[[X]]$ is flat but never projective over $R$.   
A: The question reminds me of the time when I was studying mathematics. I had attended a course on algebra (some basic theory of group, rings, categories, loads of Galois theory and some valuation theory, which was the main area of research of the lecturer). Commutative algebra was the first subject I studied on my own, because I wanted to attend a course on algebraic curves, and because I needed some commutative algebra for my diploma thesis. This is not a direct answer to your question, but maybe some thoughts from that time are of use...
Literature: As a student I found Bourbaki, Nagata (local rings) and Matsumura (Comm. rings) too difficult as a starting point. I liked the book of Atiyah-MacDonald and I loved the book "Kommutative Algebra" of Brüske, Ischebeck, Vogel. The Brüske-Ischebeck-Vogel book is out of print and available online http://wwwmath.uni-muenster.de/u/ischebeck/SkriptBrskeIschebeckVogel.pdf. If I had to teach a course on commutative algebra, then I would surely have this book on my desk again. Unfortunately it is written in German, but nevertheless it might be worth to have a look...
Free, projective and flat modules: I remember that I needed them for my thesis project and my thesis contained a section summarizing these things. I think at that time I was fine with the account in the BIV book. They define M projective iff $Hom(M, -)$ is exact, flat iff $M\otimes -$ is exact and injective if $Hom(-, M)$ is exact. I found this natural at a first reading, and later on the step to $Ext$ and $Tor$ was quite natural as well. (Maybe I was influenced a bit by the fact that categories and functors were always in the air in Munich at that time and were mentioned in my algebra course.) Having these definitions at hand, one can directly go into the proof of theorems comparing these classes of modules...
A: Please forgive these very naïve remarks.  I am enjoying the chance to learn something about flatness in trying to contribute to this question.  First of all, since as pointed out here, the definition of flatness is that the object behaves as simply as possible under tensor product, it follows that the primary use of the concept is in applications of the tensor product.  Now there are three of these that come to mind, (after some review of the literature), namely
1)  forming fibers,
2)  localizing, (and changing rings)
3)  completions.
These are all local operations, looking at the inverse image of one point, restricting to a Zariski neighborhood of a point, and restriction to an analytic or formal neighborhood of one point.
Thus one wants to compare the geometry at a point with the geometry near that point.  E.g. given an algebraic subvariety through a point, one can take its algebraic germ, formal germ, or analytic germ, and then ask whether one can recover the original germ from these.  This is equivalent to asking whether one recovers the original ideal after extending to the localization or completion, and then restricting back to the original ring.
Flatness is the property that tells us yes to all these questions.  I.e. both the localization and the completion are flat over the original ring.  Moreover, the algebraic and analytic local rings form a “flat pair”, slightly stronger than one being flat over the other, and this apparently implies they have the same completions.  This lets us compare analytic and algebraic local rings, by comparing both with their completions. It follows e.g. that the algebraic dimension of an algebraic variety equals the analytic dimension of the associated analytic variety.
Reasoning of this sort allows Serre to prove geometric results such as those mentioned above as well as homological ones.  Homological results desired are of the sort that compare the analytic cohomology to the algebraic cohomology.  The simplest way to do this is to show that the analytic sheaves and their analytic cohomology is obtained from the algebraic ones by tensoring with flat objects, i.e. changing rings in the simplest way.  Then the desired results say that homomorphisms of sheaves, and cohomology of sheaves, commutes with this process of tensoring, i.e. of applying the functor of making these objects analytic.  Flatness is the key to all these results.
Thus flatness of one object over another seems to imply a relation between their local geometric structures.  This is my take on Serre’s lovely paper GAGA, available free online at NUMDAM, after a brief perusal.  It certainly looks worth a careful read.
We have mentioned before the result that a surjective morphism of smooth varieties is flat if and only if the fibers have constant dimension.  From perusing Matsumura, other geometric properties of flat maps seem to be: the dimension of (non empty) fibers is always the expected one, i.e. dim(source) - dim(target); the going down theorem holds, hence every subvariety through the point f(p) is the image of a subvariety through p, in particular a flat map cannot separate branches at a point; indeed flat maps cannot remove singularities in any fashion, i.e. f is flat and if f(p) is a regular point, so is p; and a birational flat map is an open immersion.
Another remark building on those above is that flatness is a natural weakening of the property of projectiveness, and hence for local rings, of freeness.  If  finite map behaves well locally when it defines a locally free module, what about a map that lowers dimension?  What is the closest thing to locally free that still holds when the fibers vary nicely but not smoothly?  I.e. a flat map is a slight weakening of a smooth map.  I am struggling here from ignorance.  Thanks for the question!
A: Pete I agree that locally free is a good geometric intuition for projective.  In my algebra class I gave an exercise for the students to prove that the module of tangent vector fields on a 2-sphere is locally free over the ring of smooth functions, and challenged them to show it is not free.
If you introduce direct limits, maybe the fact you mentioned about flatness being preserved is a way to motivate it.  I.e. you want to take direct limits of finite generated projectives, but they lose the property of projectivity.  So what property do they keep?
But that may be artificial.  it is hard to get away from the points made by Sean Tilson.  I guess the difficulty there is that Hom is for many of us more intuitive than tensor.  So lifting and extension problems are more intuitive than the distinction between IM and ItensorM.
You might review your reasons why flat modules are in the course.  If you have an application for them in mind, maybe the application can motivate the concept.
In the spirit of "flat families", I used to cling to the geometric fact that a surjective morphism of smooth algebraic varieties is flat if and only if the fiber dimension is constant, but I don't know if you can use that. Those "local criteria for flatness" are usually among the more advanced flatness topics.  E.g. that is treated in the books of Matsumura near the end.
But this suggests that in some contexts flatness is the algebraic version of locally constant geometry. 
I have heard that Serre focused on the concept in some of his work relating algebraic and analytic varieties.  Maybe the properties he used are illuminating.
Great question.
A: Coincidentally, I was on the verge of posing a flatness question.  But it concerned flat homomorphisms of commutative rings, rather than flat modules.
I finally slogged through Durov's proof of the "affine base change theorem" for his generalized rings.  As far as I can tell, the only use he makes of flatness is the fact that it forces base change to preserve finite products.
No one has mentioned that motivation so far.  Is that a typical use?
