Association fallacy

The association fallacy is a formal logical fallacy that asserts that properties of one thing must also be properties of another thing, if both things belong to the same group. For example, a fallacious arguer may claim that "bears are animals, and bears are dangerous; therefore your dog, which is also an animal, must be dangerous."

When it is an attempt to win favor by exploiting the audience's preexisting spite or disdain for something else, it is called guilt by association or an appeal to spite (Latin: argumentum ad odium). Guilt by association is similar to ad hominem arguments which attack the speaker rather than addressing the claims, but in this case the ill feeling is not created by the argument; it already exists.

Formal version
Using the language of set theory, the formal fallacy can be written as follows:
 * Premise: A is in set S1
 * Premise: A is in set S2
 * Premise: B is also in set S2
 * Conclusion: Therefore, B is in set S1.

In the notation of first-order logic, this type of fallacy can be expressed as (∃x ∈ S : φ(x)) ⇒ (∀x ∈ S : φ(x)).

The fallacy in the argument can be illustrated through the use of an Euler diagram: A satisfies the requirement that it is part of both sets S1 and S2, but representing this as an Euler diagram makes it clear that B could be in S2 but not S1.

Guilt by association
This form of the argument is as follows:
 * Group A makes a particular claim.
 * Group B, which is currently viewed negatively by some, makes the same claim as Group A.
 * Therefore, Group A is viewed as associated with Group B, and is now also viewed negatively.

An example of this fallacy would be "My opponent for office just received an endorsement from the Puppy Haters Association. Is that the sort of person you would want to vote for?"

Examples
Some syllogistic examples of guilt by association:

Guilt by association can sometimes also be a type of ad hominem, if the argument attacks a person because of the similarity between the views of someone making an argument and other proponents of the argument.
 * John is a con artist. John has black hair. Therefore, people with black hair are necessarily con artists.
 * Lyle is a crooked salesman. Lyle proposes a monorail. Therefore, the proposed monorail is necessarily folly.
 * Country X is a dangerous country. Country X has a national postal service. Therefore, countries with national postal services are necessarily dangerous.
 * Simon and Karl live in Nashville, and they are both petty criminals. Jill lives in Nashville; therefore, Jill is necessarily a petty criminal.

Galileo gambit
A form of the association fallacy often used by those denying a well-established scientific or historical proposition is the so-called Galileo gambit or Galileo fallacy. The argument runs thus: Galileo was ridiculed in his time for his scientific observations, but was later acknowledged to be right; the proponent argues that since their non-mainstream views are provoking ridicule and rejection from other scientists, they will later be recognized as correct, like Galileo. The gambit is flawed in that being ridiculed does not necessarily correlate with being right and that many people who have been ridiculed in history were, in fact, wrong. Similarly, Carl Sagan has stated that people laughed at geniuses such as Christopher Columbus and the Wright brothers, but "they also laughed at Bozo the Clown". It is often committed by those whose theories reject common scientific consensus.