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

[refl] tag depends on order of instance arguments #2505

Open
LukasMias opened this issue Feb 26, 2023 · 0 comments
Open

[refl] tag depends on order of instance arguments #2505

LukasMias opened this issue Feb 26, 2023 · 0 comments
Labels
t-meta Tactics, attributes or user commands

Comments

@LukasMias
Copy link
Collaborator

The [refl] tag applies to refl theorems or definitions only if the instance arguments of the associated structure are ordered in a specific way, apparently, see also this Zulip thread. MWE testing some combinations:

import Mathlib.Algebra.Group.Opposite
import Mathlib.Algebra.Hom.Ring

structure RingEquiv0 (R S : Type _) [Mul R] [Mul S] [Add R] [Add S] extends R ≃ S, R ≃* S, R ≃+ S

structure RingEquiv1 (R S : Type _) [Mul S] [Mul R] [Add R] [Add S] extends R ≃ S, R ≃* S, R ≃+ S

structure RingEquiv2 (R S : Type _) [Mul R] [Mul S] [Add S] [Add R] extends R ≃ S, R ≃* S, R ≃+ S

structure RingEquiv3 (R S : Type _) [Mul R] [Add R] [Mul S] [Add S] extends R ≃ S, R ≃* S, R ≃+ S

structure RingEquiv4 (R S : Type _) [Mul R] [Add S] [Mul S] [Add R] extends R ≃ S, R ≃* S, R ≃+ S

@[refl] -- works
def RingEquiv0.refl [Mul α] [Add α] : RingEquiv0 α α := sorry

@[refl] -- works
def RingEquiv1.refl [Mul α] [Add α] : RingEquiv1 α α := sorry

@[refl] -- works
def RingEquiv2.refl [Mul α] [Add α] : RingEquiv2 α α := sorry

@[refl] /- @[refl] attribute only applies to lemmas proving x ∼ x, got {α : Type u_1} →
  [inst : Mul α] → [inst_1 : Add α] → RingEquiv3 α α -/
def RingEquiv3.refl [Mul α] [Add α] : RingEquiv3 α α := sorry

@[refl] /- @[refl] attribute only applies to lemmas proving x ∼ x, got {α : Type u_1} →
  [inst : Mul α] → [inst_1 : Add α] → RingEquiv4 α α -/
def RingEquiv4.refl [Mul α] [Add α] : RingEquiv4 α α := sorry
@LukasMias LukasMias added the t-meta Tactics, attributes or user commands label Feb 26, 2023
bors bot pushed a commit that referenced this issue Feb 27, 2023
Worked around #2505, but finally everything works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-meta Tactics, attributes or user commands
Projects
None yet
Development

No branches or pull requests

1 participant