-
Notifications
You must be signed in to change notification settings - Fork 259
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
refactor: drop most CoeFun instances #1219
Conversation
My guess is that stuff like this will make |
Ping @gebner . At first glance this seems incorrect - we just need to make sure that any CoeFun instances are wrapped in functions with the |
@digama0 Lean 4 does not unfold An alternative approach is to have something like (non-dependent version for simplicity): structure BundledHom (α β : Type _) (p : (α → β) → Sort _) [∀ f, Subsingleton (p f)] :=
(toFun : α → β)
(prop : p toFun) with generic |
Mathlib/Algebra/Hom/Group.lean
Outdated
@[simp] | ||
theorem MonoidWithZeroHom.coe_mk [MulZeroOneClass M] [MulZeroOneClass N] (f h1 hmul) : | ||
(MonoidWithZeroHom.mk f h1 hmul : M → N) = (f : M → N) := rfl | ||
#align monoid_with_zero_hom.coe_mk MonoidWithZeroHom.coe_mk | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this lemma moved? Does this order make it more or less similar to lean3?
Mathlib/Order/RelIso/Basic.lean
Outdated
-- see Note [function coercion] | ||
instance : CoeFun (r ↪r s) fun _ => α → β := | ||
⟨fun o => o.toEmbedding⟩ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have a #noalign
or porting comment?
I think this PR is the right choice. If we want to have |
Okay, I retract my concern then. |
I'll merge |
For some reason, the coercion of a |
This PR/issue depends on:
|
All the good parts were moved to other PRs and merged, so I'm closing this one. |
If we define a
CoeFun
instance instead of aFunLike
instance, then Lean unfolds the definition. We don't want this, at least until we find a way to make it work with*HomClass
es or find an equally convenient machinery.FunLike
and anEmbeddingLike
instance #1488