Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore(data/equiv/basic): arrow_congr preserves properties of binary operators #4759

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/data/equiv/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,27 @@ rfl
(arrow_congr e₁ e₂).symm = arrow_congr e₁.symm e₂.symm :=
rfl

section binary_op

variables (f : α → α → α) (e : α ≃ β)
eric-wieser marked this conversation as resolved.
Show resolved Hide resolved

instance [is_associative α f] : is_associative β (equiv.arrow_congr e (equiv.arrow_congr e e) f) :=
⟨λ x y z, by simp [@is_associative.assoc _ f]⟩

instance [is_idempotent α f] : is_idempotent β (equiv.arrow_congr e (equiv.arrow_congr e e) f) :=
⟨λ x, by simp [@is_idempotent.idempotent _ f]⟩

instance [is_left_cancel α f] : is_left_cancel β (equiv.arrow_congr e (equiv.arrow_congr e e) f) :=
⟨λ x y z hx, equiv.injective e.symm $
by { simp at hx, rw @is_left_cancel.left_cancel _ f _ _ _ _ hx }⟩

instance [is_right_cancel α f] :
is_right_cancel β (equiv.arrow_congr e (equiv.arrow_congr e e) f) :=
⟨λ x y z hx, equiv.injective e.symm $
by { simp at hx, rw @is_right_cancel.right_cancel _ f _ _ _ _ hx }⟩

end binary_op

/--
A version of `equiv.arrow_congr` in `Type`, rather than `Sort`.

Expand Down