Skip to content

Commit

Permalink
feat(data/equiv/basic): add a small lemma for simplifying map between…
Browse files Browse the repository at this point in the history
… equivalent quotient spaces induced by equivalent relations (#8617)

Just adding a small lemma that allows us to compute the composition of the map given by `quot.congr` with `quot.mk`
  • Loading branch information
Paul-Lez committed Aug 11, 2021
1 parent 3ebf9f0 commit 7b5c60d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/data/equiv/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2263,6 +2263,11 @@ protected def congr {ra : α → α → Prop} {rb : β → β → Prop} (e : α
left_inv := by { rintros ⟨a⟩, dunfold quot.map, simp only [equiv.symm_apply_apply] },
right_inv := by { rintros ⟨a⟩, dunfold quot.map, simp only [equiv.apply_symm_apply] } }

@[simp]
lemma congr_mk {ra : α → α → Prop} {rb : β → β → Prop} (e : α ≃ β)
(eq : ∀ (a₁ a₂ : α), ra a₁ a₂ ↔ rb (e a₁) (e a₂)) (a : α) :
quot.congr e eq (quot.mk ra a) = quot.mk rb (e a) := rfl

/-- Quotients are congruent on equivalences under equality of their relation.
An alternative is just to use rewriting with `eq`, but then computational proofs get stuck. -/
protected def congr_right {r r' : α → α → Prop} (eq : ∀a₁ a₂, r a₁ a₂ ↔ r' a₁ a₂) :
Expand All @@ -2285,6 +2290,12 @@ protected def congr {ra : setoid α} {rb : setoid β} (e : α ≃ β)
quotient ra ≃ quotient rb :=
quot.congr e eq

@[simp]
lemma congr_mk {ra : setoid α} {rb : setoid β} (e : α ≃ β)
(eq : ∀ (a₁ a₂ : α), setoid.r a₁ a₂ ↔ setoid.r (e a₁) (e a₂)) (a : α):
quotient.congr e eq (quotient.mk a) = quotient.mk (e a) :=
rfl

/-- Quotients are congruent on equivalences under equality of their relation.
An alternative is just to use rewriting with `eq`, but then computational proofs get stuck. -/
protected def congr_right {r r' : setoid α}
Expand Down

0 comments on commit 7b5c60d

Please sign in to comment.