Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 37 · Getting Started

Arguments, Validity and Fallacies

Learn the difference between valid and sound arguments, how to test validity with counterexamples, and how to spot common logical fallacies, with Python checks.

An argument is a list of statements called premises followed by a statement called the conclusion. The whole point of logic is to tell good arguments from bad ones. This lesson gives you the vocabulary (validity, soundness, counterexample) and the most common ways arguments go wrong.

Validity

An argument is valid when it is impossible for all the premises to be true while the conclusion is false. Equivalently, there is no counterexample: no situation in which the premises hold and the conclusion fails.

Two things to notice:

  1. Validity says nothing about whether the premises are actually true. "All fish can fly; Nemo is a fish; so Nemo can fly" is valid and absurd.
  2. Validity is a property of form. Swap the content and the verdict stays.

An argument is sound when it is valid and all its premises are true. Only sound arguments guarantee a true conclusion.

Valid? Premises all true? Conclusion
Yes Yes (sound) Must be true
Yes No Could be true or false
No Yes Could be true or false
No No Could be true or false

Testing validity: look for a counterexample

To show an argument is invalid, produce one assignment that makes every premise true and the conclusion false. To show it is valid (in propositional logic), check that no such assignment exists. The function below does exactly that for any premises and conclusion written as Python functions.

Python A general validity checker

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

An empty list means no counterexample exists, so those three famous forms are valid.

Valid forms worth memorizing

Name Form Example
Modus ponens p → q, p ⊢ q If the test fails the build breaks; the test fails; so the build breaks
Modus tollens p → q, ¬q ⊢ ¬p If it compiled it has no syntax errors; it has one; so it did not compile
Hypothetical syllogism p → q, q → r ⊢ p → r Chaining implications
Disjunctive syllogism p ∨ q, ¬p ⊢ q The bug is in A or B; not A; so B
Resolution p ∨ q, ¬p ∨ r ⊢ q ∨ r Basis of SAT solvers

The symbol ⊢ (turnstile) reads "therefore" or "proves".

Two classic fallacies

A fallacy is an invalid argument form that looks convincing. Two of the most common are formal fallacies of implication.

  • Affirming the consequent: p → q, q ⊢ p. "If it rained the grass is wet; the grass is wet; so it rained." (A sprinkler may be responsible.)
  • Denying the antecedent: p → q, ¬p ⊢ ¬q. "If you study you pass; you did not study; so you fail." (You might pass anyway.)

The checker finds the counterexample for each, which is the cleanest way to prove an argument is bad.

Python Finding counterexamples to fallacies

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

In both outputs the counterexample has p false and q true: it did not rain, yet the grass is wet; you did not study, yet you passed.

Informal fallacies

Not every bad argument is a bad form. These informal fallacies attack the content or relevance:

  • Ad hominem: attacking the speaker instead of the claim.
  • Straw man: refuting a distorted version of the position.
  • False dilemma: presenting two options as if there were no others.
  • Circular reasoning (begging the question): assuming the conclusion in the premises.
  • Slippery slope: claiming a chain of consequences without support.
  • Appeal to authority: treating "an expert said it" as proof rather than evidence.

Formal logic cannot detect these automatically because they depend on meaning, but knowing their names helps in code review debates as much as in philosophy.

Arguments in everyday engineering

Validity shows up in software constantly:

  • A type checker certifies "if every function call matches its signature then no type error occurs at runtime", a conditional guarantee.
  • A failing test is a counterexample to a program's correctness claim.
  • A bug report that says "steps to reproduce" is literally a counterexample.
  • A code review objection of the form "this fails when the list is empty" is a counterexample search.

Counterexamples versus examples

Finding one example where an argument works never proves validity; finding one counterexample always proves invalidity. This asymmetry (one counterexample refutes, many examples do not prove) is a theme that returns in predicate logic and in proof techniques.

Check your understanding

Quick check · 5 questions

of 5 answered You scored / 5 · perfect!

  1. 1. An argument is sound when...

    Soundness adds true premises to validity, which guarantees a true conclusion.
  2. 2. Which form is invalid?

    That is affirming the consequent. With p false and q true all premises hold but the conclusion fails.
  3. 3. How do you show an argument is invalid?

    A single counterexample is enough to refute validity.
  4. 4. Which is an informal fallacy?

    A straw man distorts the opponent's position; the others are valid forms.
  5. 5. Can a valid argument have a false conclusion?

    Validity only rules out true premises with a false conclusion; false premises can still give a false conclusion.

Summary

  • Valid means no counterexample exists; sound means valid with true premises.
  • To refute an argument, find one assignment where premises hold and the conclusion fails.
  • Modus ponens, modus tollens, hypothetical and disjunctive syllogism and resolution are valid forms.
  • Affirming the consequent and denying the antecedent are the classic invalid forms.
  • Informal fallacies depend on content and relevance, not on truth tables.

Next: Connectives and Truth Tables