I really enjoyed reading Kripke's Naming and Necessity. In this post I'll try to describe (what I found to be) the most interesting ideas in the book. But first, I need to explain some terminological distinctions.
1) A priori vs. Empirical: This is an epistemic distinction. A proposition is said to be 'a priori' if we can know it on the basis of reason alone, without appeal to experience. My knowledge that '2 + 2 = 4' is an example of a priori knowledge. Scientific knowledge, by contrast, is empirical (or 'a posteriori').
2) Necessary vs. Contingent: a metaphysical distinction. A proposition is necessarily true if it could not have been false (e.g. 2+2=4, again). Contingent propositions are ones that could (in principle) have had different truth values. For example, it is merely contingently true that you are reading this right now. We can imagine some other possible world where you are instead watching T.V., so a karma-faerie comes along and turns you into an elephant, then kills you for your ivory tusks. (Hey, it's possible.)
3) Analytic vs. Synthetic: a linguistic distinction. Analytic sentences are true merely in virtue of the meanings of the words ("All bachelors are unmarried" is the usual example). The 'truthmaker' of synthetic statements, by contrast, is the external world (at least to some degree).
When I first learnt of these distinctions, I thought they were all equivalent - that any proposition must either line up with the first of every column, or the second of every column, with no mixing. Kripke denies this. Although analytic truths are both necessary and a priori, it is possible to identify statements that are a priori yet contingent, and others that are empirical but necessary.
This seems odd at first. After all, if we can know something a priori, without appealing to our worldly experience at all, then how could it be false in any other possible world? Conversely, if we must rely upon our experience (of this world) to know X, then how could we ever know it to be true in all other possible worlds? To answer this, we must first highlight another distinction:
4) Sense vs. Reference:
The reference of a word or phrase is the actual (real-world) object(s) denoted by that word, without any further connotations. 'Sense', however, encompasses the full meaning of a phrase, and so extends beyond the merely actual.
A 'rigid designator' is some phrase that refers to the same object throughout all possible worlds (and so lacks any deeper 'sense'). Names are the typical examples of rigid designators, whereas descriptions are the opposite.
As an example, compare the name 'George W. Bush' to the description 'President of the United States'. The phrases have identical reference (since both refer to the same actual person). However, they have a very different meaning (or 'sense'), since we can imagine other possible worlds where Al Gore (for example) is president instead. Note that 'George W. Bush' refers to the same person in all possible worlds where he exists, whereas the referent of 'President of the United States' will vary from world to world.
Now, when we define a new word X in terms of a known Y, we can do so in two ways. We can define X to be synonymous with Y (i.e. define it to have the same sense). Or we can merely use Y to fix the reference of X - in which case X then becomes a rigid designator, and so X and Y have different meanings in just the same way that 'George W. Bush' and 'President of the United States' have different meanings.
(Incidentally, I think sense/reference mirrors the de dicto/de re distinction that is crucial to the 'longer than it is' puzzle.)
Now on to the main point...
An example of the contingent a priori:
Kripke asks us to consider that particular stick or bar in Paris that is used to define the standard length of one meter. Let's call that stick 'S'. Now, let's consider the proposition that "S is one meter long". We can know this a priori, since it is true by definition. But is it a necessary truth? Presumably not - the stick could have been longer or shorter, after all, in which case it would no longer be one meter long. (We might still call it "one meter", but those words would have a different meaning from 'one meter' as we mean it.)
It is tempting to think of definitions as giving the meaning of a phrase, but this is not always the case. Kripke argues that S merely fixes the reference of "one meter", at which point the phrase becomes a rigid designator, and so differs in meaning from 'the length of S'.
So, strange though it may seem, the statement "S is one meter long" is both contingent and a priori. More generally, this sort of mix will occur whenever we use an object (e.g. S) to fix our reference to a property (e.g. one meter) that it has only contingently. As another example, if I were to define the rigid designator 'byellow' by fixing the referent as the (actual) colour of bananas, then the claim "Bananas are byellow" would similarly be contingent yet a priori. If (in some other possible world) bananas were instead purple then they would no longer be byellow, despite the fact that "bananas are byellow" is true by definition in our own world.
To state the underlying principle in the most general way possible, I think we're considering propositions roughly of the form: "X has a property that X has actually". The claim is clearly knowable a priori (since it is true by definition), yet it is also clear that it could be false in other possible worlds (where the properties of X will differ from those it has actually).
An example of the necessary a posteriori:
This mix is slightly trickier. Stated loosely, it depends upon the idea that we might use a rigid designator X to refer to whatever Y (actually) is, where Y requires empirical knowledge. Thus, a priori, we wouldn't yet know what X is, but we would at least know that whatever it is, it is that necessarily (being 'rigid' and all).
Kripke borrows Putnam's example of "cats are animals". Of course, we all think that cats are animals, and with good reason. But it might turn out that we were mistaken, and they are actually strange demons. If we were to discover such a thing, would you say "oh, cats don't exist after all", or "oh, so cats aren't what we thought they were"? Surely the latter, I would think. So, contrary to my initial expectation, 'animality' is not an essential part of our 'cat' concept. So we cannot know a priori that cats are animals, we must discover this empirically.
But suppose that the cats we know and love really are animals. (That shouldn't be too difficult to imagine.) Would "cats are animals" then be a merely contingent fact? Well, imagine a possible world where there are entities that look and behave just like our cats, but in fact are strange demons. Surely we would say "those aren't really cats!". (Again, the world's inhabitants might call them "cats", but we are only concerned with our language here.)
I should emphasise that there is no contradiction here. As Kripke put it, "The original concept of cat is: that kind of thing, where the kind can be identified by paradigmatic instances". As in the earlier examples, our contingent pointing works to fix the reference of 'cat' in a rigid way; the pointing is not the meaning of the word. I could point at something different in other possible worlds, but that does not mean that the meaning of 'cat' varies from world to world. The meaning of 'cat' is fixed by whatever those creatures happen to be in OUR world. If they happen to be animals, then "cats are animals" is a necessary truth. (If they happen to be demons, then "cats are demons" would instead be the necessary truth.)
So whether cats are animals or demons is a matter for empirical discovery. (I do feel silly saying that. I'm not really suggesting there's any doubt here.) But either way, the result is a property that is necessary to cats. If some other entity were of a different nature to our cats (whatever that nature might be), then it would not be a cat. So "cats are animals" is an empirical yet necessary truth.
More generally, this sort of mix can arise when attempting to subsume one natural kind under another (e.g. Cats as animals, etc.). It can also arise when questioning whether two rigid designators name identical objects. Consider, for example, Elton John = Reggie Dwight. This is a necessary truth - someone couldn't be Elton John without also being Reggie Dwight (they're the same person!). Yet if you hadn't been told about their identity, it is not something you could deduce a priori - rather, it is an empirical fact; one that you would have to learn by experience. (Hmm, that's a lot simpler than the cat example. Not so fun though!)
Update: See this article for Soames' argument that propositions (as opposed to sentences) asserting true identities are actually knowable a priori after all. The 'natural kind' examples still work fine, however.