In the fourth book of his Essay, Locke proceeds to apply these results so as to determine the nature and extent of knowledge. As ideas are the sole immediate object of the mind, knowledge can be nothing else than “the perception of the connexion of and agreement, or disagreement and repugnancy of any of our ideas.” This agreement or disagreement is said to be of four sorts: identity or diversity; relation; co-existence or necessary connection; real existence. Each of these kinds of knowledge raises its own questions; but, broadly speaking, one distinction may be taken as fundamental. In the same paragraph in which he restricts knowledge to the agreement or disagreement of our ideas, he admits one kind of knowledge which goes beyond the ideas themselves to the significance which they have for real existence. When the reference does not go beyond the ideas “in the mind,” the problems that arise are of one order; when there is a further reference to real things, another problem arises. The preceding books have prepared the way for the solution of both sets of problems.
When ideas are together in the mind, we can discover their relations to one another; so long as they are not taken to represent archetypes outside the mind, there is no obstacle to certainty of knowledge: for “all relation terminates in, and is ultimately founded on, those simple ideas we have got from sensation or reflection.” In this way, Locke vindicates the certainty of mathematics: the science is merely ideal, and its propositions do not hold of things outside the mind. He thinks, also, that “morality is capable of demonstration as well as mathematics.” But, in spite of the entreaties of his friend Molyneux, he never set out his ethical doctrine in detail. In the second book he has reduced moral good and evil to the pleasure and pain which—as reward and punishment—come to us from some lawgiver; thus they point to a source outside the mind. But his ground for maintaining the demonstrative character of morality is that moral ideas are “mixed modes” and, therefore, mental products, so that their “precise real essence … may be perfectly known.” He ventures upon two examples only of this demonstrative morality; and neither of them is more than verbal or gives any information about good or evil. Yet the doctrine is significant as showing the influence upon Locke of another type of thought, of which there are many traces, both in the Essay and in his other works.