lean2/tests/lean/run/rw_bug2.lean

13 lines
424 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import logic.eq
open prod
definition swap {A : Type} : A × A → A × A
| (a, b) := (b, a)
theorem swap_swap {A : Type} : ∀ p : A × A, swap (swap p) = p
| (a, b) := rfl
theorem eq_of_swap_eq {A : Type} : ∀ p₁ p₂ : A × A, swap p₁ = swap p₂ → p₁ = p₂ :=
take p₁ p₂, assume seqs,
assert h₁ : swap (swap p₁) = swap (swap p₂), from congr_arg swap seqs,
by rewrite *swap_swap at h₁; exact h₁