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] - feat: more NNRat lemmas #12586

Closed
wants to merge 19 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented May 1, 2024

Note that the previous version of Rat.ofScientific_eq_ofScientific was not well-formed, as it did not include the necessary ofNats.


Some steps towards

open OfNat in
theorem _root_.ofScientific_def {K} [DivisionSemiring K] (m : ℕ) (s : Bool) (e : ℕ) :
    (OfScientific.ofScientific m s e : K)
      = (ofNat m : ℕ) * (10 : K) ^ (cond s (-(ofNat e)) (ofNat e) : ℤ) := by

Open in Gitpod

YaelDillies and others added 13 commits April 29, 2024 10:06
Prove `(q ^ n).num = q.num ^ n` and `(q ^ n).den = q.den ^ n` by making those defeq. It is somewhat painful. `(q ^ n).den = q.den ^ n` is also defeq for `NNRat`, but not `(q ^ n).num = q.num ^ n` due to the `Int.natAbs` in the definition of `NNRat.num`.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR awaiting-CI t-algebra Algebra (groups, rings, fields etc) labels May 1, 2024
Copy link
Collaborator

@Ruben-VandeVelde Ruben-VandeVelde left a comment

Choose a reason for hiding this comment

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

maintainer merge

Mathlib/Algebra/Field/Defs.lean Outdated Show resolved Hide resolved
Copy link

github-actions bot commented May 5, 2024

🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde.

Copy link

github-actions bot commented May 5, 2024

🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde.

Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Sorry I didn't see earlier!

Mathlib/Data/Rat/Field.lean Outdated Show resolved Hide resolved
Mathlib/Data/Rat/Field.lean Outdated Show resolved Hide resolved
@@ -367,6 +367,7 @@ theorem natAbs_num_coe : (q : ℚ).num.natAbs = q.num := rfl

lemma coprime_num_den (q : ℚ≥0) : q.num.Coprime q.den := by simpa [num, den] using Rat.reduced _

-- TODO: Rename `Rat.coe_nat_num`, `Rat.intCast_den`, `Rat.ofNat_num`, `Rat.ofNat_den` to match
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you take the updated version I gave instead? Rat.coe_nat_num has already been renamed.

@Ruben-VandeVelde
Copy link
Collaborator

Back on the queue, then.

maintainer merge

Copy link

github-actions bot commented May 5, 2024

🚀 Pull request has been placed on the maintainer queue by Ruben-VandeVelde.

@sgouezel
Copy link
Contributor

sgouezel commented May 5, 2024

bors r+

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels May 5, 2024
mathlib-bors bot pushed a commit that referenced this pull request May 5, 2024
Note that the previous version of `Rat.ofScientific_eq_ofScientific` was not well-formed, as it did not include the necessary `ofNat`s.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
@mathlib-bors
Copy link

mathlib-bors bot commented May 5, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: more NNRat lemmas [Merged by Bors] - feat: more NNRat lemmas May 5, 2024
@mathlib-bors mathlib-bors bot closed this May 5, 2024
@mathlib-bors mathlib-bors bot deleted the eric-wieser/nnrat-ofScientific-lemma branch May 5, 2024 19:07
apnelson1 pushed a commit that referenced this pull request May 12, 2024
Note that the previous version of `Rat.ofScientific_eq_ofScientific` was not well-formed, as it did not include the necessary `ofNat`s.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
callesonne pushed a commit that referenced this pull request May 16, 2024
Note that the previous version of `Rat.ofScientific_eq_ofScientific` was not well-formed, as it did not include the necessary `ofNat`s.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-merge 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.

None yet

4 participants