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] - feat(*): generalise+add algebraic instances #18947

Closed
wants to merge 6 commits into from

Conversation

ericrbg
Copy link
Collaborator

@ericrbg ericrbg commented May 5, 2023

These are needed for #18857 (splitting field diamond), and I feel as though it's getting unwieldy so having these separately for review may be nice.


Open in Gitpod

@ericrbg ericrbg added awaiting-review The author would like community review of the PR awaiting-CI The author would like to see what CI has to say before doing more work. labels May 5, 2023
@ericrbg ericrbg requested a review from eric-wieser May 5, 2023 16:17
@github-actions github-actions bot added the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label May 5, 2023
{ rat_cast := λ a, of f (a : K),
rat_cast_mk := λ a b h1 h2,
begin
letI : group_with_zero (adjoin_root f) := ideal.quotient.group_with_zero _,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good compromise over what I pushed, thanks!

ericrbg and others added 2 commits May 5, 2023 21:59
Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>
Comment on lines +127 to +133
-- seems to be causing a diamond in the below proof
-- however, this may be a fluke and the proof below uses non-canonical `algebra` instances:
-- when I replaced all the instances inside the proof with the "canonical" instances we have,
-- I had the (unprovable) goal (of the form) `adjoin_root.mk f (C x) = adjoin_root.mk f X`
-- for some `x, f`. So maybe this is indeed the correct approach and rewriting this proof is
-- salient in the future, or at least taking a closer look at the algebra instances it uses.
local attribute [-instance] adjoin_root.has_smul
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to check, this still applies after the PR split?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was the issue that I had to merge this file over

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #18952 I've completely removed the adjoin_root.has_smul instance. It works in this proof, let's see what CI thinks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI seems to be happy, so maybe there is no need to add the has_smul instance manually?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's needed for the splitting_field stuff; I can try remove it there and see?

Copy link
Member

@eric-wieser eric-wieser May 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think removing it is any better than locally de-instancing. The proof happens to work because the instance priorities find the letI before the distrib_smul. We might in future find we need to deinstance the whole family of instances, and I don't think removing them makes sense

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with some nits.

I think we should consider this blocked by some combination of

@Hagb, do you have time to update your forward-port PR (leanprover-community/mathlib4#3604), or do you need someone else to take over?

@Hagb
Copy link
Collaborator

Hagb commented May 5, 2023

@Hagb, do you have time to update your forward-port PR (leanprover-community/mathlib4#3604), or do you need someone else to take over?

@eric-wieser Sorry for the delay. I had my conputer broken days ago, and I can update my PR before 2023-05-06 12:00 UTC (but maybe not now).

@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label May 6, 2023
@ericrbg
Copy link
Collaborator Author

ericrbg commented May 7, 2023

Actually, it seems that half of the slowdown of this lemma is not tactics, but actually elaboration

@ericrbg
Copy link
Collaborator Author

ericrbg commented May 8, 2023

I think we should consider this blocked by some combination of

2/3 of these have been resolved, and the out of sync queue is now at 10 - are we good to go?

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

Thanks!

@leanprover-community-bot-assistant leanprover-community-bot-assistant added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels May 8, 2023
bors bot pushed a commit that referenced this pull request May 8, 2023
These are needed for #18857 (splitting field diamond), and I feel as though it's getting unwieldy so having these separately for review may be nice.



Co-authored-by: Eric Rodriguez <37984851+ericrbg@users.noreply.github.com>
@bors
Copy link

bors bot commented May 9, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat(*): generalise+add algebraic instances [Merged by Bors] - feat(*): generalise+add algebraic instances May 9, 2023
@bors bors bot closed this May 9, 2023
@bors bors bot deleted the ericrbg/some_instances branch May 9, 2023 01:22
@eric-wieser
Copy link
Member

Don't forget to forward-port this!

@ericrbg
Copy link
Collaborator Author

ericrbg commented May 10, 2023

Is it possible to make port-dashboard make the author that changed things a sortable column? It'd be really good to have that

@eric-wieser
Copy link
Member

You can type your name in the search box, which is almost as good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants