Skip to content

Conditional Statements and Implications

In this lesson you’ll learn how the if-then statement works in logic (including the part that surprises everyone), how to form the converse, inverse, and contrapositive of a conditional, which of those is equivalent to the original, and what a biconditional means.

A conditional statement, also called an implication, has the form “if pp, then qq.” We write it

pqp \rightarrow q

The part before the arrow, pp, is the hypothesis or antecedent. The part after, qq, is the conclusion or consequent.

Here’s the truth table, and it’s the one table in this whole subject worth staring at for a minute:

ppqqpqp \rightarrow q
TTT
TFF
FTT
FFT

An implication is false in exactly one case: when the hypothesis is true but the conclusion is false. That’s the only way a promise gets broken.

Laid out as a grid, the lopsidedness is obvious:

This is the part that feels wrong at first. Why should “if pp then qq” be true when pp is false?

Think of an implication as a promise. Suppose a teacher says:

“If you score above 90, you get an A.”

When does that promise get broken? Only if you score above 90 and don’t get an A. That’s row 2.

  • You score 95 and get an A. Promise kept. (Row 1)
  • You score 95 and get a B. Promise broken. (Row 2)
  • You score 70 and get an A. Maybe generous, but the promise said nothing about what happens below 90. Not broken. (Row 3)
  • You score 70 and get a C. Nothing was promised about this case. Not broken. (Row 4)

An implication makes no claim at all about what happens when the hypothesis fails. So it can’t be violated there, and in logic “not violated” means true. When pp is false, the implication is called vacuously true.

“If pigs can fly, then 2+2=52 + 2 = 5” is a true statement. Weird, but harmless, because pigs can’t fly so the claim never gets tested.

Compare the implication table to ¬pq\neg p \vee q from the truth tables lesson. They match. So:

pq¬pqp \rightarrow q \equiv \neg p \vee q

This is how you negate an implication. Apply De Morgan:

¬(pq)¬(¬pq)p¬q\neg(p \rightarrow q) \equiv \neg(\neg p \vee q) \equiv p \wedge \neg q

The negation of an if-then statement is not another if-then statement. It’s an AND. To deny “if pp then qq,” you assert that pp happened and qq didn’t. That’s exactly the single false row.

Given pqp \rightarrow q, there are three standard variations:

NameFormReads as
Originalpqp \rightarrow qIf pp, then qq
Converseqpq \rightarrow pIf qq, then pp
Inverse¬p¬q\neg p \rightarrow \neg qIf not pp, then not qq
Contrapositive¬q¬p\neg q \rightarrow \neg pIf not qq, then not pp

The truth table:

ppqqpqp \rightarrow qqpq \rightarrow p¬p¬q\neg p \rightarrow \neg q¬q¬p\neg q \rightarrow \neg p
TTTTTT
TFFTTF
FTTFFT
FFTTTT

Read the columns carefully:

  • The contrapositive is equivalent to the original. Columns 3 and 6 match exactly.
  • The converse is not. Rows 2 and 3 disagree.
  • The inverse is not either. But notice the converse and inverse match each other, since each is the contrapositive of the other.
pq¬q¬pp \rightarrow q \equiv \neg q \rightarrow \neg p

The four statements pair up on the diagonals:

This single fact powers an entire proof technique, which is the next lesson. If a statement is awkward to prove directly, prove the contrapositive instead. It’s the same claim.

Mathematicians phrase pqp \rightarrow q several ways, and they all mean the same thing:

  • If pp, then qq
  • pp implies qq
  • pp is sufficient for qq (having pp is enough to guarantee qq)
  • qq is necessary for pp (pp can’t happen without qq)
  • qq whenever pp
  • pp only if qq

That last one trips people up. “You may enter only if you have a ticket” means having a ticket is necessary, so it translates to enterticket\text{enter} \rightarrow \text{ticket}, not the other way around.

The biconditional pqp \leftrightarrow q means ”pp if and only if qq,” often abbreviated iff. It’s true when both parts have the same truth value.

ppqqpqp \leftrightarrow q
TTT
TFF
FTF
FFT

It’s the same as asserting both directions at once:

pq(pq)(qp)p \leftrightarrow q \equiv (p \rightarrow q) \wedge (q \rightarrow p)

This is why proving an “if and only if” theorem always takes two proofs. You show pp forces qq, then you show qq forces pp.

Definitions in math are almost always biconditionals. “An integer is even if and only if it is divisible by 2” works in both directions, which is what makes it a definition rather than just a fact.

Example 1: Form all three variations.

Statement: “If a number is divisible by 6, then it is divisible by 3.” (True.)

  • Converse: “If a number is divisible by 3, then it is divisible by 6.” False. 9 is divisible by 3 but not 6.
  • Inverse: “If a number is not divisible by 6, then it is not divisible by 3.” False. Same counterexample, 9.
  • Contrapositive: “If a number is not divisible by 3, then it is not divisible by 6.” True, as it must be, since it’s equivalent to the original.

Example 2: Negate an implication.

Negate: “If the alarm is armed, then the doors are locked.”

Solution. Using ¬(pq)p¬q\neg(p \rightarrow q) \equiv p \wedge \neg q:

“The alarm is armed and the doors are not locked.”

A very common wrong answer is “if the alarm is armed, then the doors are not locked.” That’s a different statement entirely, and it isn’t the negation.

Example 3: Spot the fallacy.

A system logs: “If the disk is full, the backup fails.” The backup failed. Did the disk fill up?

Solution. No. That’s using the converse, which doesn’t follow. The backup could have failed for a dozen other reasons: network timeout, bad credentials, corrupt file.

This mistake is called affirming the consequent, or the converse error.

What would be valid: the backup succeeded, therefore the disk was not full. That’s the contrapositive, and it’s airtight.

Example 4: Translate necessary and sufficient.

“Being a square is sufficient for being a rectangle. Being a rectangle is necessary for being a square.”

Solution. Both sentences say the same thing:

squarerectangle\text{square} \rightarrow \text{rectangle}

The converse is false: a 3-by-5 rectangle is not a square. So this is a one-directional implication, not a biconditional.

Example 5: A biconditional.

Is this a valid biconditional? “An integer nn is even if and only if n2n^2 is even.”

Solution. Check both directions.

Forward: if nn is even then n=2kn = 2k, so n2=4k2=2(2k2)n^2 = 4k^2 = 2(2k^2), which is even. True.

Backward: if n2n^2 is even, is nn even? Yes, and the easiest argument is the contrapositive: if nn is odd, then n=2k+1n = 2k+1 and n2=4k2+4k+1=2(2k2+2k)+1n^2 = 4k^2 + 4k + 1 = 2(2k^2+2k) + 1, which is odd. So an even n2n^2 forces an even nn.

Both directions hold, so the biconditional is valid.

The converse error is probably the single most common reasoning mistake in ordinary life, and knowing its name makes it easy to catch.

Medical testing runs on this. “If you have the disease, the test comes back positive” does not mean “if the test comes back positive, you have the disease.” The gap between those two statements is the false positive rate, and misunderstanding it leads to real harm.

Legal reasoning is full of necessary-versus-sufficient distinctions. Meeting a residency requirement might be necessary for a benefit without being sufficient.

In programming, the contrapositive shows up as guard clauses. Instead of nesting the happy path inside a condition, you check the negation of the conclusion and bail out early. It’s the same logic, restructured for readability.

Debugging is contrapositive reasoning almost end to end. “If the config loaded, the version string would be set. The version string is empty. Therefore the config did not load.” That’s valid, and it eliminates a whole branch of the search.

In which single case is the implication 'if p then q' false?
Which statement is logically equivalent to 'If it is snowing, then school is closed'?
What is the correct negation of 'If the file exists, then the backup ran'?
'You can board only if you have a boarding pass.' Which implication does this express?
To prove a biconditional statement 'p if and only if q', what must you establish?