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] - chore(group_theory/perm/sign): remove classical for sign congr simp lemmas #5622

Closed
wants to merge 2 commits into from

Conversation

pechersky
Copy link
Collaborator

@pechersky pechersky commented Jan 5, 2021

Previously, some lemmas about how perm.sign simplifies across various congrs of permutations assumed classical, which prevented them from being applied by the simplifier. This makes the decidable_eq assumptions explicit.


@pechersky pechersky added the awaiting-review The author would like community review of the PR label Jan 5, 2021
rw [← finset.univ_product_univ, finset.prod_product, finset.prod_comm],
simp },
rw [finset.prod_mul_distrib, ←finset.univ_product_univ, finset.prod_product, finset.prod_comm],
simp [sign_prod_congr_left] },
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a great improvement!

I wasn't aware that using classical like this could be an issue. Are there other places where this pops up?

Copy link
Collaborator Author

@pechersky pechersky Jan 6, 2021

Choose a reason for hiding this comment

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

Yes, the sign lemmas simplifying various congr were causing me a lot of pain trying to simplify pretty obvious equiv_congr.map_equiv option, because the decidable_eq instance for option α is easily constructed from the [decidable_eq α], but the relevant lemma had no explicit decidable_eq! I was so confused, until I noticed the open_locale classical that was near the end of the file. Some new sign lemmas didn't have this issue because they used different Type arguments.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I found an earlier Zulip thread that discussed a similar issue and mentioned this PR on Zulip.

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.

Looks great, thanks!

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@github-actions github-actions bot 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 Jan 7, 2021
bors bot pushed a commit that referenced this pull request Jan 7, 2021
…emmas (#5622)

Previously, some lemmas about how `perm.sign` simplifies across various congrs of permutations assumed `classical`, which prevented them from being applied by the simplifier. This makes the `decidable_eq` assumptions explicit.
@bors
Copy link

bors bot commented Jan 7, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(group_theory/perm/sign): remove classical for sign congr simp lemmas [Merged by Bors] - chore(group_theory/perm/sign): remove classical for sign congr simp lemmas Jan 7, 2021
@bors bors bot closed this Jan 7, 2021
@bors bors bot deleted the pechersky/perm-sign-congr-simp branch January 7, 2021 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants