Skip to content

[Merged by Bors] - chore: remove duplicated definition of Invertible class in NormNum.Core.lean#1313

Closed
dwrensha wants to merge 2 commits intomasterfrom
remove_norm_num_invertible
Closed

[Merged by Bors] - chore: remove duplicated definition of Invertible class in NormNum.Core.lean#1313
dwrensha wants to merge 2 commits intomasterfrom
remove_norm_num_invertible

Conversation

@dwrensha
Copy link
Copy Markdown
Member

@dwrensha dwrensha commented Jan 3, 2023

inv : Invertible denom
/-- The element is equal to the fraction with the specified numerator and denominator. -/
eq : a = num * ⅟denom
eq : a = num * ⅟ denom
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We may want to define this syntax with prefix rather than notation here:

notation:1034
"⅟" =>-- This notation has the same precedence as `Inv.inv`.
Invertible.invOf

As is, we need to insert this space.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That seems reasonable to me. Are there any other side effects of making something prefix rather than notation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The usages of the syntax in that file (e.g. here:

theorem invOf_mul_self_assoc [Monoid α] (a b : α) [Invertible a] : ⅟ a * (a * b) = b := by
) would then need to remove their spaces. So it's not a one-line change. Unless someone knows a way to define the syntax that accepts both the space and no-space version?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ChrisHughes24 was there a reason for using notation rather than prefix here? It seems like prefix:max would be the most analogous to the Inv.inv notation:

postfix:max "⁻¹" => Inv.inv

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was mistaken-- the prefix:max version does not actually seem to require other changes, so I went ahead and did that.


/-- The inverse of an `Invertible` element -/
notation:1034
prefix:max
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note that this change makes this notation more closely match the Inv.inv notation:

postfix:max "⁻¹" => Inv.inv

and it makes the comment on the next line more true.

@hrmacbeth
Copy link
Copy Markdown
Member

LGTM. I'm delegating rather than merging in case there was a reason that you didn't mark it "awaiting review" yet.

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Jan 3, 2023

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

@github-actions github-actions bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jan 3, 2023
@dwrensha
Copy link
Copy Markdown
Member Author

dwrensha commented Jan 3, 2023

bors r+

bors bot pushed a commit that referenced this pull request Jan 3, 2023
…re.lean (#1313)

* Deletes the temporary `Invertible` class defined in `NormNum.Core`. This is possible because `Algebra.Invertible` landed in #930, and its dependence on `NormNum` was removed in #1055.
* Updates the definition of the `Invertible.toInv` syntax to not require a space and to more closely match the `Inv.inv` syntax.
@bors
Copy link
Copy Markdown

bors bot commented Jan 3, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore: remove duplicated definition of Invertible class in NormNum.Core.lean [Merged by Bors] - chore: remove duplicated definition of Invertible class in NormNum.Core.lean Jan 3, 2023
@bors bors bot closed this Jan 3, 2023
@bors bors bot deleted the remove_norm_num_invertible branch January 3, 2023 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants