-
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] - feat(field_theory/intermediate_field): generalize algebra
instances
#8761
Conversation
✌️ Vierkantor can now approve this pull request. To approve and merge a pull request, simply reply with |
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.
bors d+
Looks like the timeout is due to a bad, but terminating, interaction with the |
I don't really understand what is going on. The issue is that typeclass search gets stuck when it makes a wrong turn at Here's some test code. Above two examples that should, and do, fail fast. Then the problem where Lean gets stuck. def should_fail_fast1 (α : p.splitting_field) : is_scalar_tower F p.splitting_field p.splitting_field :=
@gal.is_scalar_tower _ _ p p.splitting_field _ _ _ -- failed to synthesize class instance
def should_fail_fast2 : fact
(@splits F p.splitting_field _inst_1 (@splitting_field.field F _inst_1 p)
(@algebra_map F p.splitting_field
(@comm_ring.to_comm_semiring F (@euclidean_domain.to_comm_ring F (@field.to_euclidean_domain F _inst_1)))
(@ring.to_semiring p.splitting_field
(@division_ring.to_ring p.splitting_field
(@field.to_division_ring p.splitting_field (@splitting_field.field F _inst_1 p))))
(@splitting_field.algebra F _inst_1 p))
p) := infer_instance -- failed to synthesize class instance
def should_work_but_loops (α : p.splitting_field) : is_scalar_tower F F⟮α⟯ p.splitting_field :=
@@intermediate_field.is_scalar_tower_mid _ _ _ _ _ _ _ (@gal.is_scalar_tower _ _ p p.splitting_field _ _ _)
-- timeout, keeps trying to find the above instance |
The `algebra` and `is_scalar_tower` instances for `intermediate_field` are (again) as general as those for `subalgebra`.
b8e512b
to
af3ffa7
Compare
Ah nevermind, there's another similar failure, this case for |
Ah this is bad, even the following times out: example (S : intermediate_field K L) (T : intermediate_field K S) : is_scalar_tower K T S := infer_instance |
Use a specialized instance for the common case `is_scalar_tower K S L`, which was the only instance in the old situation.
Sorry, I was away for a couple of days. Is there some zulip discussion about this problem? |
The issue seems to have been resolved by providing a shortcut, which @eric-wieser seems to agree with. |
Thanks 🎉 bors merge |
…#8761) The `algebra` and `is_scalar_tower` instances for `intermediate_field` are (again) as general as those for `subalgebra`.
Build failed (retrying...): |
…#8761) The `algebra` and `is_scalar_tower` instances for `intermediate_field` are (again) as general as those for `subalgebra`.
Pull request successfully merged into master. Build succeeded: |
algebra
instancesalgebra
instances
The
algebra
andis_scalar_tower
instances forintermediate_field
are (again) as general as those forsubalgebra
.