All of the previous work that Locke has done in the Essay has been setting up the framework for the investigation of knowledge. In Book IV, Locke finally turns toward knowledge itself, asking what it is and in what areas we can hope to attain it. Locke defines knowledge as "the perception by reason of the connection and agreement or repulsion and disagreement between any two or more of our ideas" (IV.i.2). Because it has only to do with internal relations that hold between ideas knowledge, is not actually of the world itself. Locke identifies four different sorts of agreement and disagreement that reason can perceive in order to produce knowledge: identity and diversity (e.g. A=A); relation (e.g. a diamond is a square laid on its side); coexistence (e.g. that the area of a triangle always equals one half the base time the height); realizing that existence belongs to the very ideas themselves (e.g. the idea of God and of the self). To count as knowledge, the connection between ideas must be very strong. In the case of disagreement, the connection must be one of logical inconsistency, and in the case of agreement, it needs to be a necessary connection. For example, in order to know that A caused B you need to know that given A, B could not have failed to happen. In other words, to know that A caused B, you need to be able to deduce B given only the information that A, or derive B from A. In chapter ii Locke distinguishes between three grades or degrees of knowledge. The highest grade of knowledge is intuition. In intuition, we immediately perceive an agreement or disagreement the moment the ideas are understood. Example of intuitive knowledge are the knowledge that A=A and that all bachelors are unmarried. Understanding what it means to be a bachelor requires feeling the truth of this claim. One grade below intuition is demonstration. In demonstrative knowledge, one must go through some sort of proof to see the connection between ideas. Each step in the proof, however, must be a matter of intuition. An example of demonstrative knowledge would be any proof of geometry. Intuition and demonstration are the only truly legitimate forms of knowledge, so, ultimately all knowledge depends on intuition. There is also, however, a final grade of pseudo-knowledge. This is sensitive knowledge, which is treated at length in Chapter xi.
Locke's definition of knowledge was common among 17th century thinkers. Both Rene Descartes and David Hume defined knowledge in much the same way. However, it is tempting to think that this definition is too strong. Consider the following example: I notice that every time my cat makes a sound, it comes out as "meow." In addition, I notice that this same fact holds true of all the cats I have ever come across, and from the testimony of others I gather that the same is true of all cats that anyone has ever observed. While I am tempted to say that I know that all cats say "meow," I have no knowledge of any necessary connection between the cat and the sound "meow." I do not know anything about cats that would show me why cats must say only "meow," nor do I know anything to tell me why they must say "meow" at all. According to Locke, I do not know that all cats say "meow." I may believe this strongly, but I do not know it. Whether or not Locke's definition of knowledge is too strict (and it is not clear that it is; perhaps I really do not know that all cats say "meow), he had good reasons for holding to it. To return to the example above, imagine now that I happen across a cat that makes a sound more like "greck." It turns out I did not know that cats say "meow" after all, since this cat does not. The claim that all cats say "meow" is simply not true, and it is impossible to know something that is not true. I might have thought that I knew that all cats say "meow," but I was mistaken. Is it possible to imagine my coming across such a creature? It is, so long as I do not know of any necessary connection between cats and meows. If, on the other hand, I do know of any such connection, then I know that I will never come across such a cat. To grasp a necessary connection is to know that you will never come across a disconfirming instance. And until you know that you will never come across a disconfirming instance of a rule, can you really know the rule is true? In the absence of this guarantee, there is always the chance that you will happen across something that violates the rule, proving that the rule is wrong and that you could not have known it after all. In all likelihood, this is the reasoning behind Locke's strict definition of knowledge.