Skip to content

[Merged by Bors] - chore: Don't simplify Odd n to ¬ Even n, but the other way around#16024

Closed
YaelDillies wants to merge 4 commits intomasterfrom
not_even_iff_odd
Closed

[Merged by Bors] - chore: Don't simplify Odd n to ¬ Even n, but the other way around#16024
YaelDillies wants to merge 4 commits intomasterfrom
not_even_iff_odd

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor

This is simply not simpler

From LeanAPAP


Open in Gitpod

This is simply not simpler
@YaelDillies YaelDillies added the t-algebra Algebra (groups, rings, fields, etc) label Aug 21, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 21, 2024

PR summary 2a5ef0c35b

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ instance : DecidablePred (Odd : ℤ → Prop) := fun _ => decidable_of_iff _ not_even_iff_odd
+ mersenne_odd
++ not_even_iff_odd
++ not_odd_iff_even
++-- ne_of_odd_add
+--+ odd_mul
- instance : DecidablePred (Odd : ℤ → Prop) := fun _ => decidable_of_iff _ odd_iff_not_even.symm
- odd_mersenne_succ
-+-+ odd_iff_not_even

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

Thanks for doing this; I agree the new direction of the lemmas makes much more sense.
AIUI, this PR just flips the direction of these simp lemmas (but does not un-simp anything); can you please adjust the PR title to match this?

maintainer merge

cases even_or_odd n with
| inl h => exact Or.inl ⟨h, even_iff_not_odd.mp h⟩
| inr h => exact Or.inr ⟨h, odd_iff_not_even.mp h⟩
| inl h => exact Or.inl ⟨h, not_odd_iff_even.2 h⟩
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is minor, and not something I will insist on, but: I do find using .mp(r) clearer in such situations.
If we agree to disagree/not fuss about this as this is too minor, then please do not make such such unrelated changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh that's just a consequence of the grep I've done. It would be a bit complicated now to automatically find all the places where this change was not

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by grunweg.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Aug 21, 2024
@YaelDillies YaelDillies changed the title chore: Don't simplify Odd n to ¬ Even n chore: Don't simplify Odd n to ¬ Even n, but the other way around Aug 21, 2024
Copy link
Copy Markdown
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

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Aug 23, 2024
mathlib-bors bot pushed a commit that referenced this pull request Aug 23, 2024
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 23, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: Don't simplify Odd n to ¬ Even n, but the other way around [Merged by Bors] - chore: Don't simplify Odd n to ¬ Even n, but the other way around Aug 23, 2024
@mathlib-bors mathlib-bors bot closed this Aug 23, 2024
@mathlib-bors mathlib-bors bot deleted the not_even_iff_odd branch August 23, 2024 10:19
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants