-
Notifications
You must be signed in to change notification settings - Fork 297
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] - refactor(analysis/normed_space): merge normed_space
and semi_normed_space
#8218
Conversation
For reasons I don't understand, this change breaks: example (𝕜 ι : Type*) (E : ι → Type*)
[nondiscrete_normed_field 𝕜] [Π i, normed_group (E i)] [Π i, normed_space 𝕜 (E i)] :
Π i, module 𝕜 (E i) := by apply_instance but this works fine example (𝕜 ι : Type*) (E : ι → Type*)
[nondiscrete_normed_field 𝕜] [Π i, normed_group (E i)] [Π i, normed_space 𝕜 (E i)] :
Π i, module 𝕜 (E i) := λ _, by apply_instance I'm increasingly of the opinion that mixin typeclasses are broken in nasty ways in Lean 3; this is the dfinsupp problem all over again, and has come up multiple times on Zulip. Edit: I found a workaround which I posted in this Zulip thread, and have committed it. This problem is not a new breakage, it already existed for |
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.
LGTM! And it's very nice we can remove some @
!
a0feba4
to
bf3bc33
Compare
13012d7
to
a46da74
Compare
It took 6 months, but all the timeouts are gone! |
/-- A special case of `pi.algebra` for non-dependent types. Lean get stuck on the definition | ||
below without this. -/ | ||
instance _root_.function.algebra (I : Type*) {R : Type*} (A : Type*) {r : comm_semiring R} | ||
[semiring A] [algebra R A] : algebra R (I → A) := | ||
pi.algebra _ _ |
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.
I introduced function.has_scalar
and function.smul_comm_class
in another recent PR, and discussed with @madvorak about adding function.has_add
etc to fix a similar problem - I'd prefer to leave collecting all those instances together into the right place to a follow-up PR.
d362dad
to
c0be454
Compare
I plan to come back to this and check whether those last two commits remove the need for some of the downstream changes |
33bde92
to
919347c
Compare
919347c
to
b4f5cf0
Compare
Looks good to me, and since it compiles it is probably a good idea to merge it soon. |
After all your work to get it to compile, the final diff is rather small in the end :) . It looks good to me! |
…d_space` (#8218) There are no theorems which are true for `[normed_group M] [normed_space R M]` but not `[normed_group M] [semi_normed_space R M]`; so there is about as much value to the `semi_normed_space` / `normed_space` distinction as there was between `module` / `semimodule`. Since we eliminated `semimodule`, we should eliminte `semi_normed_space` too. This relaxes the typeclass arguments of `normed_space` to make it a drop-in replacement for `semi_normed_space`; or viewed another way, this removes `normed_space` and renames `semi_normed_space` to replace it. This does the same thing to `normed_algebra` and `seminormed_algebra`, but these are hardly used anyway. [Zulip](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/semi_normed_space.20vs.20normed_space/near/245089933) As with any typeclass refactor, this randomly breaks elaboration in a few places; presumably, it was able to unify arguments from one particular typeclass path, but not from another. To fix this, some type ascriptions have to be added where previously none were needed. In a few rare cases, the elaborator gets so confused that we have to enter tactic mode to produce a term. This isn't really a new problem - this PR just makes these issues all visible at once, whereas normally we'd only run into one or two at a time. Optimistically Lean 4 will fix all this, but we won't really know until we try.
Pull request successfully merged into master. Build succeeded: |
normed_space
and semi_normed_space
normed_space
and semi_normed_space
There are no theorems which are true for
[normed_group M] [normed_space R M]
but not[normed_group M] [semi_normed_space R M]
; so there is about as much value to thesemi_normed_space
/normed_space
distinction as there was betweenmodule
/semimodule
. Since we eliminatedsemimodule
, we should elimintesemi_normed_space
too.This relaxes the typeclass arguments of
normed_space
to make it a drop-in replacement forsemi_normed_space
; or viewed another way, this removesnormed_space
and renamessemi_normed_space
to replace it.This does the same thing to
normed_algebra
andseminormed_algebra
, but these are hardly used anyway.Zulip
As with any typeclass refactor, this randomly breaks elaboration in a few places; presumably, it was able to unify arguments from one particular typeclass path, but not from another. To fix this, some type ascriptions have to be added where previously none were needed. In a few rare cases, the elaborator gets so confused that we have to enter tactic mode to produce a term.
This isn't really a new problem - this PR just makes these issues all visible at once, whereas normally we'd only run into one or two at a time. Optimistically Lean 4 will fix all this, but we won't really know until we try.
linear_isometry_equiv.reflections_generate_dim_aux
#11443