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(data/fintype): drop a decidable_pred assumption #14971

Closed
wants to merge 1 commit into from

Conversation

urkud
Copy link
Member

@urkud urkud commented Jun 26, 2022

OTOH, now the proof depends on classical.choice.


Open in Gitpod

@urkud urkud added the awaiting-review The author would like community review of the PR label Jun 26, 2022
Comment on lines +1010 to +1011
fintype.of_bijective (sum.elim (coe : {b // b = a} → α) (coe : {b // b ≠ a} → α)) $
by { classical, exact (equiv.sum_compl (= a)).bijective }
Copy link
Collaborator

@vihdzp vihdzp Jun 26, 2022

Choose a reason for hiding this comment

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

Why is this new proof so much longer than the old one? Can't you just do?

Suggested change
fintype.of_bijective (sum.elim (coe : {b // b = a} → α) (coe : {b // b ≠ a} → α)) $
by { classical, exact (equiv.sum_compl (= a)).bijective }
by { classical, exact fintype.of_equiv _ (equiv.sum_compl (= a)) }

Copy link
Member Author

Choose a reason for hiding this comment

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

With my proof, it is clear that the "data" part of the definition does not depend on classical.choice. I don't know if your definition is computable.

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 just the old proof with classical slapped on top, so the data part should be computable as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Your definition is noncomputable. My definition still compiles if I remove type annotations from coe but I'm not sure how much this will affect readability.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is a bit more straightforward of an algorithm data-wise, but it still depends on classical.choice -- the goal is equivalent to x = a ∨ ¬x = a, and I wouldn't be surprised if LEM could be proved from this definition.

Suggested change
fintype.of_bijective (sum.elim (coe : {b // b = a} → α) (coe : {b // b ≠ a} → α)) $
by { classical, exact (equiv.sum_compl (= a)).bijective }
⟨((finset.univ : finset {b // b a}).map (function.embedding.subtype _)).cons a (by simp),
λ x, by { cases eq_or_ne x a; simp [*] }⟩

@vihdzp The reason it's not computable when you put classical at the beginning is that the generated term is of the form let I := foo in bar where foo is the noncomputable classical decidability instance.

Comment on lines +1010 to +1011
fintype.of_bijective (sum.elim (coe : {b // b = a} → α) (coe : {b // b ≠ a} → α)) $
by { classical, exact (equiv.sum_compl (= a)).bijective }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is a bit more straightforward of an algorithm data-wise, but it still depends on classical.choice -- the goal is equivalent to x = a ∨ ¬x = a, and I wouldn't be surprised if LEM could be proved from this definition.

Suggested change
fintype.of_bijective (sum.elim (coe : {b // b = a} → α) (coe : {b // b ≠ a} → α)) $
by { classical, exact (equiv.sum_compl (= a)).bijective }
⟨((finset.univ : finset {b // b a}).map (function.embedding.subtype _)).cons a (by simp),
λ x, by { cases eq_or_ne x a; simp [*] }⟩

@vihdzp The reason it's not computable when you put classical at the beginning is that the generated term is of the form let I := foo in bar where foo is the noncomputable classical decidability instance.

@sgouezel
Copy link
Collaborator

sgouezel commented Jul 6, 2022

bors r+
Thanks!

@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 Jul 6, 2022
bors bot pushed a commit that referenced this pull request Jul 6, 2022
OTOH, now the proof depends on `classical.choice`.
@bors
Copy link

bors bot commented Jul 6, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(data/fintype): drop a decidable_pred assumption [Merged by Bors] - chore(data/fintype): drop a decidable_pred assumption Jul 6, 2022
@bors bors bot closed this Jul 6, 2022
@bors bors bot deleted the YK-fintype-of-compl branch July 6, 2022 10:46
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