∴LeanProofs
Logic

Reverse a logical equivalence

For propositions P and Q, (P ↔ Q) implies (Q ↔ P).

Compiled with official native Lean 4.33.1 on 25 November 2026, core library only. The browser checker uses a separately identified experimental fork. Intended-statement comparison, independent axiom audit and mathematical review are pending.

The statement

For propositions P and Q, (P ↔ Q) implies (Q ↔ P).

theorem iff_symmetry (P Q : Prop) (h : P ↔ Q) : Q ↔ P := by
  constructor
  · intro hq
    exact h.mpr hq
  · intro hp
    exact h.mp hp

Why these steps?

  1. An equivalence contains two directions: h.mp maps P to Q, while h.mpr maps Q to P.
  2. The target Q ↔ P also requires two directions. Its first direction begins from Q, so it uses h.mpr.
  3. The second branch begins from P, so it uses h.mp. The mathematics is symmetry of equivalence, not equality of proposition syntax.
  4. Expanding both directions makes the orientation visible. A library shortcut may be shorter, but does not replace understanding which direction is required.

Try a variation

Replace the tactic proof by exact h.symm in a local environment, then return to the expanded version to identify its two functions.

A mistake to understand

theorem iff_symmetry (P Q : Prop) (h : P ↔ Q) : Q ↔ P := by
  constructor
  · intro hq
    exact h.mp hq
  · intro hp
    exact h.mpr hp

Expected teaching failure, not recorded compiler output: The directions are reversed: h.mp expects P, but the first branch supplies Q. Use the implication matching each branch.

Sources & reuse

Native compilation evidence (JSON)

Code and explanation: original LeanProofs teaching content, CC0-1.0. Linked references retain their own licenses. Editorial date: 24 November 2026; independent mathematical review pending.