Day 33 — Fallacies

Updated

July 30, 2026

Day 33 — Fallacies

Stage III · concept day
Goal: Recognize and name common logical and proof fallacies; debug broken proofs; avoid illicit quantifier shifts, converse/inverse errors, circular reasoning, false dichotomy, proof by example, and off-by-one induction mistakes.

Why this matters

Most wrong proofs look locally plausible. Reviewing pull requests of mathematics—your own included—means spotting invalid steps, not merely arithmetic slips. Fallacies also model real software bugs: affirming the consequent is “the metric is high, so the feature works”; illicit quantifier shift is “for every user there is a password” misread as one global password.

Theory

Propositional fallacies

Affirming the consequent. From \(P\rightarrow Q\) and \(Q\), infer \(P\). Invalid.
Counter-model: \(P\) false, \(Q\) true makes \(P\rightarrow Q\) true.

Denying the antecedent. From \(P\rightarrow Q\) and \(\neg P\), infer \(\neg Q\). Invalid.
Same truth-table family: \(P\) false, \(Q\) true.

Valid related forms.

  • Modus ponens: \(P\rightarrow Q\), \(P\)\(Q\).
  • Modus tollens: \(P\rightarrow Q\), \(\neg Q\)\(\neg P\).
  • Hypothetical syllogism: \(P\rightarrow Q\), \(Q\rightarrow R\)\(P\rightarrow R\).

Converse and inverse errors

From \(P\rightarrow Q\) infer \(Q\rightarrow P\) (converse) or \(\neg P \rightarrow \neg Q\) (inverse). Both invalid in general. Only the contrapositive \(\neg Q \rightarrow \neg P\) is equivalent.

Quantifier fallacies

Illicit shift \(\forall\exists\) to \(\exists\forall\).
From \(\forall x \exists y\, P(x,y)\) infer \(\exists y \forall x\, P(x,y)\). Invalid (Day 27).

Illicit shift for \(\exists\) witnesses.
From \(\exists x\, P(x)\) and \(\exists x\, Q(x)\) infer \(\exists x\,(P(x)\wedge Q(x))\). Invalid.

Wrong restricted quantifier.
Writing \(\forall x\,(P(x)\wedge Q(x))\) for “all \(P\)s are \(Q\)s.”

Negation errors.
\(\neg\forall x\, P\) treated as \(\forall x\, \neg P\) (too strong).

Circular reasoning (begging the question)

Using the claim (or a thinly renamed form) as a premise in its own proof. Different from induction’s legitimate IH (which is smaller/previous, not the goal).

False dichotomy

Assuming \(C_1 \vee C_2\) when a third possibility exists—missing case in case analysis.

Proof by example / anecdote

Showing \(P(3)\) and concluding \(\forall n\, P(n)\). Valid only for \(\exists\), or when the domain has one element.

Proof by picture / intuition alone

Diagrams help discovery; they are not substitutes for cases at boundaries.

Induction fallacies

  • Horses: invalid step at \(n=1\) (Day 31).
  • Base missing or wrong.
  • Off-by-one: \(P(n)\) stated for \(n\ge 1\) but step uses \(n-1\) at \(n=1\).
  • IH applied to a larger instance (circular).
  • Assuming \(P(k+1)\) inside the step.

Algebra / definition fallacies

  • Division by zero.
  • Treating non-equivalent rewrites as \(\equiv\).
  • Using \(a\mid bc \Rightarrow a\mid b\) without coprimality/prime hypothesis.

How to debug a proof

  1. Underline each inference; ask “what rule?”
  2. Instantiate universals carefully; track free variables.
  3. Try small counter-models if the claim is universal.
  4. Check boundaries (\(0\), empty, \(n=1\)).
  5. Negate the claim—does the proof still “work”? Then it proved nothing.

Fallacies vs honest mistakes

Honest algebra errors are not “fallacies” in the rhetorical sense but still invalidate proofs. Label both: invalid step vs false premise.

Worked examples

Example 1 — Affirming consequent

Spec: if admin then 2FA enabled. Observe 2FA enabled. Conclude admin. Fallacy. Guest could have 2FA.

Example 2 — Denying antecedent

If authenticated then access. User not authenticated. Conclude no access. Invalid if access can occur through internal network path without that flag—or mathematically \(P\rightarrow Q\) and \(\neg P\) allow \(Q\).

Example 3 — Converse

If sorted then binary search correct. Binary search returned index. Conclude array sorted. No.

Example 4 — Quantifier shift

“Every student has a counselor” \(\forall s\exists c\). Infer \(\exists c\forall s\) “one counselor for all.” Fallacy.

Example 5 — Dual witnesses

\(\exists\) even and \(\exists\) odd integer; not \(\exists\) number both even and odd.

Example 6 — Circular

\(n\) even because \(n=2k\) and \(2k\) is even because \(n\) is even.” Circular witness.

Example 7 — Horses

Identify non-overlap at \(k=1\) (Day 31).

Example 8 — Proof by example

\(n^2+n+41\) prime for \(n=0,1,2,\ldots,10\) hence for all \(n\).” False at \(n=40\) or \(n=41\).

Example 9 — Bad negation

Claim: all tests pass. “Negation: all tests fail.” Wrong; some fail is enough.

Example 10 — False dichotomy

“Either \(n\) even or prime” for case proof of property of all \(n\)—misses \(9\), \(15\), etc.

Example 11 — Induction off-by-one

\(P(n): 1+2+\cdots+n = n(n+1)/2\). Step assumes formula for \(k\) including \(k=0\) but starts base at \(1\) only—OK here; broken variant uses empty sum wrongly as \(1\).

Example 12 — Division by zero

From \(x=y\) conclude \(x/x=y/x\) then \(1=1\) “proves” all equal after cancel—invalid if \(x=0\). Famous fake \(1=2\) proofs.

Example 13 — Illicit divisibility

\(4 \mid 2\cdot 2\) but \(4\nmid 2\). Inferring \(a\mid b\) from \(a\mid bc\) fails.

Example 14 — Debugging transcript

Broken: “Assume \(n^2\) even. Then \(n\) even because even squares come from even \(n\).” Uses the claim as reason. Fix: prove contrapositive properly or cite proved lemma.

Exercises

For each broken argument (1–12), name the fallacy and give a counterexample or pinpoint the bad step.

  1. If the build is red, tests failed. Tests failed. Therefore the build is red.
  2. If \(n\) is multiple of \(6\), \(n\) even. \(n\) even; therefore multiple of \(6\).
  3. Every request has a server. So there is a server that handles every request.
  4. Some user is admin. Some user is banned. So some admin is banned.
  5. Checked \(n=1..20\) for primality of \(n^2+n+41\)—all prime—so always prime.
  6. Horses same color “proof.”
  7. \(P\rightarrow Q\) proved by assuming \(Q\) and deriving \(Q\).
  8. To prove \(A\subseteq B\), show one element of \(A\) lies in \(B\).
  9. From \(\neg(P \wedge Q)\) conclude \(\neg P \wedge \neg Q\).
  10. Base \(n=0\) false but step OK ⇒ still conclude \(\forall n\,P(n)\)?
  11. From \(p\rightarrow q\) and \(\neg p\) conclude \(\neg q\).
  12. “Proof” \(1=2\) via hidden division by zero—find the step.

Construct / repair:

  1. Write a valid modus tollens security argument.
  2. Correctly negate “all packets are authenticated.”
  3. Give a valid case split for parity of \(n^2\).
  4. Repair a circular “proof” that \(\sqrt{2}\) irrational that assumes unique factorization vaguely—outline a clean version.
  5. Is “proof by minimal counterexample” circular? Explain why not (when well-ordering used).
  6. Find a real-world blog/docs sentence that affirms the consequent; rewrite.
  7. Show with assignments that converse of \(p\rightarrow q\) is not entailed.
  8. Quantifiers: write valid and invalid English for \(\forall\exists\) friendship.
  9. Induction: craft a false \(P\) with true base and false step; show.
  10. Induction: true step for \(k\ge 2\), false at \(k=1\)—relate to horses.
  11. Explain why \(\exists x\,(P\rightarrow Q(x))\) is not \(\forall x\, P \rightarrow \exists x\, Q\) mess—parse two different formulas and evaluate on a tiny model.
  12. Debug: “Since \(n\) and \(n+1\) coprime always, and \(n(n+1)\) even, both factors… wait”—what can and cannot be concluded.
  13. Portfolio: invent three fallacious one-paragraph proofs for true claims (sound conclusion, bad argument) and fix them.

CS connection

  • Metrics as consequents: latency drop does not prove a specific optimization caused it (causal affirming).
  • AuthZ bugs: wrong direction of implications in policies.
  • Distributed specs: \(\forall\exists\) vs \(\exists\forall\) leadership.
  • Flaky tests: “passed on my machine” as proof by example.
  • Code review: demand valid proof structure for critical concurrent invariants.
  • Type errors sometimes encode fallacious “conversions” (unsafe cast ≈ illicit implication).

Common pitfalls

Pitfall What to do instead
Naming a fallacy without a counter-model Always give assignment or object
Calling induction circular IH is previous; goal is next
Over-accusing “fallacy” for algebra slips Separate error types
Fixing English only Fix the formal step
Using invalid converse in “optimization” of proof Use contrapositive only if equivalent

Checkpoint

  • Name and refute affirming consequent & denying antecedent
  • Converse vs contrapositive
  • Illicit \(\forall\exists\) shift example
  • Proof by example vs valid \(\exists\)
  • Horses / induction step failure
  • Circular vs legitimate IH
  • Debug a provided broken proof
  • Exercises done or logged

Two takeaways:


Deep dive — a reviewer’s checklist

Before accepting a proof (or merging a “correctness argument” in a design doc):

  1. Are all variables quantified?
  2. Is each inference a named rule or a cited lemma?
  3. Are base cases of inductions explicit?
  4. Is \(\forall\exists\) order respected?
  5. Is any \(\rightarrow\) used in converse form?
  6. Is “without loss of generality” justified by symmetry?
  7. Are empty/zero edge cases covered?

Fallacy → bug dictionary

Fallacy Software analogue
Affirming consequent Metric moved ⇒ feature caused it
\(\forall\exists\) shift Per-tenant resource ⇒ one global resource
Proof by example “Works on my laptop”
False dichotomy if/else missing a state
Bad induction step Off-by-one in loop for \(n=1\)
Circular reasoning Spec cites implementation as justification

Repair patterns

  • Converse error → prove contrapositive or find counterexample.
  • Illicit shift → provide dependence \(y(x)\) or abandon claim.
  • Circular → push the claim into a lemma proved independently.
  • Incomplete cases → add the missing residue/sign/branch.

More worked examples

Example 15 — Hidden division by zero
From \(a=b\) derive \(a^2=ab\), then \(a^2-b^2=ab-b^2\), \((a-b)(a+b)=b(a-b)\), cancel \(a-b\) to get \(a+b=b\), so \(a=0\)… the cancel assumes \(a\neq b\) false when \(a=b\). Classic.

Example 16 — Quantifier negation fallacy
“Not every packet is corrupted” ≠ “every packet is uncorrupted.”

Example 17 — Valid-looking induction with false claim
\(P(n): n=n+1\) with step adding 1 to both sides of IH equality—step valid from false IH, base false.

Example 18 — Affirming in security
Alarm triggered ⇒ intrusion. Alarm triggered. Conclude intrusion—false positives exist.

Additional exercises

  1. Debug a written fake proof that \(1=2\) (find illegal cancel).
  2. Write a fallacious and a correct proof that sum of evens is even.
  3. Identify fallacy: from \(\exists x P(x)\rightarrow Q\) infer \(\exists x(P(x)\rightarrow Q)\)—compare meanings on a model.
  4. Give a counter-model to converse of “if sorted, binary search correct.”
  5. Portfolio: collect five fallacies from real life/docs this week.

Extended practice workshop

Name the fallacy (and refute)

  1. If compiled, then syntax OK. Syntax OK. Therefore compiled.
  2. If admin then access. No admin. Therefore no access.
  3. Every API has a rate limit config. So one global rate limit config exists.
  4. Some tests failed. Some tests are flaky. So some flaky tests failed.
  5. \(n^2-n+41\) prime for many \(n\), hence all \(n\).
  6. Horses same color.
  7. From \(p\rightarrow q\) conclude \(\neg p\rightarrow\neg q\).
  8. From \(\neg(p\wedge q)\) conclude \(\neg p\wedge\neg q\).
  9. To prove \(\forall n\,P(n)\), show \(P(1),P(2),P(3)\).
  10. Case split: \(n\) prime or \(n\) even—for a property of all \(n\).

Repair the argument

  1. Circular “proof” that \(\sqrt{2}\) irrational—rewrite cleanly.
  2. Induction with missing base—add it.
  3. Quantifier shift in a system design doc—correct the English.
  4. Fake \(1=2\) via cancel—mark illegal step.

Valid forms practice

  1. Write a modus ponens security argument.
  2. Write a modus tollens testing argument.
  3. Write a valid \(\forall\exists\) claim and an invalid \(\exists\forall\) strengthening.

Meta

  1. When is “proof by example” valid?
  2. Why induction’s IH is not circular.
  3. Reviewer checklist: 5 questions you always ask.

Fallacy flashcards

Fallacy One-line form
Affirm consequent \(P\to Q,Q\Rightarrow P\)
Deny antecedent \(P\to Q,\neg P\Rightarrow\neg Q\)
Converse \(P\to Q\Rightarrow Q\to P\)
Inverse \(P\to Q\Rightarrow\neg P\to\neg Q\)
Quantifier shift \(\forall\exists\Rightarrow\exists\forall\)
Proof by example \(P(a)\Rightarrow\forall x P(x)\)

Synthesis

Fallacies are invalid inference patterns—local steps that look like reasoning but do not preserve truth. Gate III will mix them with correct proofs; your job is to name, refute (counter-model), and repair. The same skills catch bugs in design docs: wrong implication direction, \(\forall\exists\) leadership claims, and “works on my machine” universals.

Reviewer protocol (run on every suspicious paragraph)

  1. Underline each “therefore.”
  2. Ask: which rule? (MP, MT, UI, EG, IH, cases, …)
  3. If no rule, demand a counter-model or a fix.
  4. Check quantifier order and \(\rightarrow\) vs \(\wedge\) in restricted forms.
  5. For induction: base present? step for all \(k\ge n_0\)?
  6. For cases: exhaustiveness?

More worked examples

Example 19 — Inverse error in ops.
Policy: “if maintenance mode then reads-only.” Infer: “if not maintenance then not reads-only.” Invalid (inverse). Reads-only may hold for other reasons.

Example 20 — Dual \(\exists\) fusion.
“There is a failed test” and “there is a flaky test” do not yield “there is a failed flaky test.” Witnesses may differ.

Example 21 — False dichotomy in API design.
“Every request is either cached or hits origin.” Misses: rejected before cache, redirected, streamed from third party. Case proof of a total classification needs a true partition.

Example 22 — Circular definition vs circular proof.
Defining \(e\) as “the identity” and then proving uniqueness of identity is fine if the axioms are independent. Using “\(n\) is even because \(n\) is even” inside a divisibility proof is circular. Distinguish definitional unfolding from assuming the theorem.

Example 23 — Valid-looking algebra, invalid cancel.
From \(a=b\) derive \(a^2=ab\), rearrange to \((a-b)(a+b)=b(a-b)\), “cancel” \(a-b\) to conclude \(a+b=b\). Illegal when \(a=b\) (the hypothesis), i.e. dividing by zero in disguise.

Extra exercises (synthesis)

  1. Give truth assignments showing affirming the consequent and denying the antecedent are invalid.
  2. Write English and formal forms of a \(\forall\exists\) claim and an illicit \(\exists\forall\) strengthening; refute the latter on \(\mathbb{Z}\).
  3. Repair: “\(n^2\) even ⇒ \(n\) even because even squares come from even \(n\).”
  4. Is minimal-counterexample reasoning circular? Defend in \(\le 5\) sentences.
  5. Find or invent a docs sentence that treats a metric movement as proof of a specific cause; rewrite carefully.
  6. Portfolio: three fallacious proofs of true claims (bad argument, good conclusion) and their repairs.

Fallacy ↔︎ Stage III topic map

Fallacy Closest concept day
Converse / inverse 25 equivalence, 29 contrapositive
Quantifier shift 26–27 quantifiers
Proof by example 28–30 proof methods
Horses / bad induction 31–32 induction
False dichotomy 30 cases
Circular reasoning 28–29 proof hygiene

Before Gate III, rework flashcards cold and debug one fake \(\sqrt{2}\) proof and one horses write-up from blank paper.

Tomorrow

Day 34 — Gate III. Portfolio check: truth tables, quantifier negation, three full proofs (direct, contra/contrapositive, induction), fallacy identification.