Skip to content

Commit

Permalink
feat(data/sym/sym2): simp lemma for quotient.eq (#14113)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmill committed May 12, 2022
1 parent 3d03098 commit 4b3988a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/data/sym/sym2.lean
Expand Up @@ -67,6 +67,14 @@ lemma rel.is_equivalence : equivalence (rel α) := by tidy; apply rel.trans; ass

instance rel.setoid (α : Type u) : setoid (α × α) := ⟨rel α, rel.is_equivalence⟩

@[simp] lemma rel_iff {x y z w : α} :
(x, y) ≈ (z, w) ↔ (x = z ∧ y = w) ∨ (x = w ∧ y = z) :=
begin
split; intro h,
{ cases h; simp },
{ cases h; rw [h.1, h.2], constructor }
end

end sym2

/--
Expand Down Expand Up @@ -111,11 +119,7 @@ by { split; intro h, { rw quotient.eq at h, cases h; refl }, rw h }

lemma eq_iff {x y z w : α} :
⟦(x, y)⟧ = ⟦(z, w)⟧ ↔ (x = z ∧ y = w) ∨ (x = w ∧ y = z) :=
begin
split; intro h,
{ rw quotient.eq at h, cases h; tidy },
{ cases h; rw [h.1, h.2], rw eq_swap }
end
by simp

lemma mk_eq_mk_iff {p q : α × α} :
⟦p⟧ = ⟦q⟧ ↔ p = q ∨ p = q.swap :=
Expand Down

0 comments on commit 4b3988a

Please sign in to comment.