I was always suspicious of
analogies because I knew that any two objects could be grouped together for whatever reason. But I never bothered to find a logical proof of that. Well, here's how Peirce does it in just one paragraph for any group of objects*,
This principle is that any plurality or lot of objects whatever have some character in common (no matter how insignificant) which is peculiar to them and not shared by anything else. The word "character" here is taken in such a sense as to include negative characters, such as incivility, inequality, etc., as well as their positives, civility, equality, etc. To prove the theorem, I will show what character any two things, A and B, have in common, not shared by anything else. The things, A and B, are each distinguished from all other things by the possession of certain characters which may be named A-ness and B-ness. Corresponding to these positive characters, are the negative characters un-A-ness, which is possessed by everything except A, and un-B-ness, which is possessed by everything except B. These two characters are united in everything except A and B; and this union of the characters un-A-ness and un-B-ness makes a compound character which may be termed A-B-lessness. This is not possessed by either A or B, but it is possessed by everything else. This character, like every other, has its corresponding negative un-A-B-lessness, and this last is the character possessed by both A and B, and by nothing else. It is obvious that what has thus been shown true of two things is, mutatis mutandis, true of any number of things. Q. E. D.
In any world whatever, then, there must be a character peculiar to each possible group of objects.
He gives his proof in a free text form because the modern notation for propositional logic has not been invented yet. In any case, in a true Pragmatist fashion he doesn't stop with the proof, but goes further,
so long as we regard characters abstractly, without regard to their relative importance, etc., there is no possibility of a more or less degree of orderliness in the world, the whole system of relationship between the different characters being given by mere logic; that is, being implied in those facts which are tacitly admitted as soon as we admit that there is any such thing as reasoning.
In other words, unless we have a system of value judgments that enables us to make decisions about relative importance, the logic itself can't settle issues.
*Source: ILLUSTRATIONS OF THE LOGIC OF SCIENCE. BY C. S. PEIRCE, ASSISTANT IN THE UNITED STATES COAST SURVEY. Popular Science Monthly | Volume 13 | June 1878.