In logic, a contradiction consists of a logical incompatibility between two or more propositions. It occurs when the propositions, taken together, yield two conclusions which form the logical inversions of each other. Illustrating a general tendency in applied logic, Aristotle’s law of noncontradiction states that “One cannot say of something that it is and that it is not in the same respect and at the same time.”
By extension, outside of formal logic, one can speak of contradictions between actions when one presumes that their motives contradict each other.
Contradiction in formal logic
In formal logic, particularly in propositional and first-order logic, a proposition is a contradiction if and only if . Since for contradictory it is true that for all (because ), one may prove any proposition from a set of axioms which contains contradictions.
Proof by contradiction
For a proposition it is true that , i. e. that is a tautology, i. e. that it is always true, if and only if , i. e. if the negation of is a contradiction. Therefore, a proof that also proves that is true. The use of this fact constitutes the technique of the proof by contradiction, which mathematicians use extensively. This applies only in a logic using the excluded middle as an axiom.
In mathematics, the symbol used to represent a contradiction within a proof varies.  Some symbols that may be used to represent a contradiction include ↯, ⇒⇐ , ⊥, ↮, and ※. It is not uncommon to see Q.E.D. or some variant immediately after a contradiction symbol; this occurs in a proof by contradiction, to indicate that the original assumption was false and that the theorem must therefore be true.
Contradictions and philosophy
Adherents of the epistemological theory of coherentism typically claim that as a necessary condition of the justification of a belief, that belief must form a part of a logically non-contradictory (consistent) system of beliefs. Some dialetheists, including Graham Priest, have argued that coherence may not require consistency.
Self-refuting statements and performative contradictions
It often occurs in philosophy that the content or presence of the argument contradicts the claims of the argument; for example: Heraclitus’s proposition that knowledge is impossible; or, arguably, Nietzsche’s statement that one should not obey others. These are self-refuting statements and performative contradictions.
Contradiction outside formal logic
In colloquial speech
Colloquial usage can label actions or statements (or both) as contradicting each other when due (or perceived as due) to presuppositions which are contradictory in the logical sense.
In dialectical materialism, contradiction, as derived by Karl Marx from Hegelianism, usually refers to an opposition of social forces. Most prominently (according to Marx), capitalism entails a social system that has contradictions because the social classes have conflicting collective goals. These contradictions stem from the social structure of society and inherently lead to class conflict, economic crisis, and eventually revolution, the existing order’s overthrow and the formerly oppressed classes’ ascension to political power.
Mao Zedong's most important philosophical essay furthered Marx and Lenin's thesis and suggested that all existence is the result of contradiction.