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: Make sure WithOne doesn't import rings #10275

Closed
wants to merge 3 commits into from

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Feb 5, 2024

Reorder the WithOne material.


Open in Gitpod

Reorder the `WithOne` material. `Algebra.Group.WithOne.Defs` was hiding a `Ring` import! I credit Johan and Mario for leanprover-community/mathlib#2707.
@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR t-algebra Algebra (groups, rings, fields etc) awaiting-CI labels Feb 5, 2024
Comment on lines 125 to +126
"Deconstruct an `x : WithZero α` to the underlying value in `α`, given a proof that `x ≠ 0`."]
def unone {x : WithOne α} (hx : x ≠ 1) : α :=
WithBot.unbot x hx
def unone : ∀ {x : WithOne α}, x ≠ 1 → α | (x : α), _ => x
Copy link
Member

Choose a reason for hiding this comment

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

What's the motivation for this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You don't need to import WithBot anymore. It's weird that WithBot API was used in WithOne API.

Copy link
Contributor

@sgouezel sgouezel left a comment

Choose a reason for hiding this comment

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

bors d+
Thanks!

Mathlib/Algebra/Group/WithOne/Defs.lean Outdated Show resolved Hide resolved
end WithZero

-- Check that we haven't needed to import all the basic lemmas about groups,
-- by asserting a random sample don't exist here:
assert_not_exists inv_involutive
assert_not_exists div_right_inj
assert_not_exists pow_ite

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is on purpose: The comment above only applies to the three previous assert_not_exists, not to this one.

@mathlib-bors
Copy link

mathlib-bors bot commented Feb 6, 2024

✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added delegated and removed awaiting-review The author would like community review of the PR labels Feb 6, 2024
@YaelDillies
Copy link
Collaborator Author

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Feb 6, 2024
Reorder the `WithOne` material.
* `Algebra.Group.WithOne.Defs` was hiding a `Ring` import! I credit Johan and Mario for leanprover-community/mathlib#2707.
* `WithBot` is not needed to define `WithOne.unone`. It's simpler to redefine it by hand. In the future, we might want to have an `Option` version (but not sure how much that's worth, since it would basically be `Option.get` again).
@mathlib-bors
Copy link

mathlib-bors bot commented Feb 6, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: Make sure WithOne doesn't import rings [Merged by Bors] - chore: Make sure WithOne doesn't import rings Feb 6, 2024
@mathlib-bors mathlib-bors bot closed this Feb 6, 2024
@mathlib-bors mathlib-bors bot deleted the ring_with_zero branch February 6, 2024 16:08
atarnoam pushed a commit that referenced this pull request Feb 9, 2024
Reorder the `WithOne` material.
* `Algebra.Group.WithOne.Defs` was hiding a `Ring` import! I credit Johan and Mario for leanprover-community/mathlib#2707.
* `WithBot` is not needed to define `WithOne.unone`. It's simpler to redefine it by hand. In the future, we might want to have an `Option` version (but not sure how much that's worth, since it would basically be `Option.get` again).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants