Skip to content

[Merged by Bors] - doc: Improve Field's fields docstrings#11508

Closed
YaelDillies wants to merge 4 commits intomasterfrom
field_field_docs
Closed

[Merged by Bors] - doc: Improve Field's fields docstrings#11508
YaelDillies wants to merge 4 commits intomasterfrom
field_field_docs

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor

Reduce the diff of #11203


Open in Gitpod

@YaelDillies YaelDillies added documentation Improvements or additions to documentation awaiting-review t-algebra Algebra (groups, rings, fields, etc) labels Mar 19, 2024
Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux left a comment

Choose a reason for hiding this comment

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

A few minor comments.

Comment on lines +51 to +52
-- Check that we have not imported `Mathlib.Tactic.Common` yet.
assert_not_exists Mathlib.Tactic.LibrarySearch.librarySearch
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.

seems like a strange way to test for this, especially because something like that might move to Std at some point. (EDIT: nevermind, I see you just pulled this from the bottom of the file. Is there a reason for moving it?)

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.

The reason is that the content of a file doesn't change whether an assert_not_exists in it succeeds or not, so we might as well put it as early as possible.

I believe @semorrison started by putting them at the end, but eventually decided to put them first.

Comment on lines +118 to +119
Set this to `qsmulRec _` unless there is a risk of a `Module ℚ _` instance diamond.
Do not use directly. Instead use the `•` notation. -/
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.

I don't think we want to explicitly advocate for the default values.

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.

Nono, this is not advocating for default values. This is saying that people shouldn't be writing DivisionRing.qsmul q a but q • a

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.

No, above that it says, "Set this to qsmulRec unless ..."

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, I didn't write that. @eric-wieser just added it in #11262

Comment on lines 186 to 187
instance RatCast.toOfScientific [RatCast K] : OfScientific K where
ofScientific (m : ℕ) (b : Bool) (d : ℕ) := Rat.ofScientific m b d
Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux Mar 19, 2024

Choose a reason for hiding this comment

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

Not for this PR: is it possible to have an ofScientific instance for ℚ≥0 (or types with an NNRatCast instance)? I guess it would probably require interpreting -1.2 as 1.2.

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.

I think that would be a big trap. Certainly if people want it they can add it, but I won't do so myself

@j-loreaux
Copy link
Copy Markdown
Contributor

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Mar 24, 2024
mathlib-bors bot pushed a commit that referenced this pull request Mar 24, 2024
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 24, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title doc: Improve Field's fields docstrings [Merged by Bors] - doc: Improve Field's fields docstrings Mar 24, 2024
@mathlib-bors mathlib-bors bot closed this Mar 24, 2024
@mathlib-bors mathlib-bors bot deleted the field_field_docs branch March 24, 2024 11:48
utensil pushed a commit that referenced this pull request Mar 26, 2024
xgenereux pushed a commit that referenced this pull request Apr 15, 2024
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation 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.

2 participants