Logical negation, commonly called "not", is a fundamental unary logical operator that reverses the truth value of a proposition. If a statement P is true, its negation ¬P is false; if P is false, ¬P is true. The operator is written in several ways (for example ¬P, ~P, !P, or the word "not") depending on the formalism: ¬ is standard in formal logic, while many programming languages use ! or the keyword not.
Basic characteristics and truth table
Negation takes a single operand and returns the opposite truth-value; it is therefore called a unary connective. In classical (two-valued) logic the action of negation is simplest to present as a truth table:
- P = true → ¬P = false
- P = false → ¬P = true
Because it simply flips truth values, negation is involutive in classical logic: applying it twice returns the original value (¬¬P is equivalent to P). This involutive property underlies many algebraic and proof techniques.
Logical laws and notable facts
Two closely related classical principles involve negation. The law of non-contradiction states that P and ¬P cannot both be true at the same time (P ∧ ¬P is always false). The law of excluded middle asserts that at least one of P or ¬P must be true (P ∨ ¬P is always true). De Morgan's laws describe how negation distributes over conjunction and disjunction: ¬(P ∧ Q) is equivalent to (¬P ∨ ¬Q), and ¬(P ∨ Q) is equivalent to (¬P ∧ ¬Q).
Variants across logical systems
Not all formal systems treat negation identically. In intuitionistic logic, for example, double negation (¬¬P) does not generally allow one to infer P; proofs are constructive and reject some uses of the excluded middle. Modal logics and paraconsistent logics also modify how negation interacts with other connectives, allowing different behaviors for contradiction and implication. These distinctions matter in mathematical foundations and philosophical logic.
Uses and examples
Negation is pervasive across disciplines. In mathematics and formal proofs it is used to express the nonexistence or falsity of a claim. In programming, logical negation controls flow (if not condition) and appears in boolean algebra and bitwise operations—though bitwise complement (often ~) is distinct from logical negation in languages that separate booleans and integer bit patterns. In digital electronics the NOT gate inverts a binary signal and forms the basis for more complex circuits.
Practical considerations
When building complex expressions, negation is often combined with other operators to form implications, equivalences, and constraints. Careful attention to operator precedence, parentheses, and the specific syntax of a formal language or programming environment is important to avoid unintended meanings. Simple natural-language examples help: if P is "It is raining", then ¬P is "It is not raining", and ¬(P ∨ Q) reads "neither P nor Q"—a direct illustration of De Morgan's transformation.