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: add slim_check generators for Rat #8759

Closed
wants to merge 1 commit into from

Conversation

semorrison
Copy link
Contributor


Open in Gitpod

@semorrison semorrison added the awaiting-review The author would like community review of the PR label Dec 1, 2023
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

bors merge

Am I misremembering? I thought we already had this in Lean 3...

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-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 Dec 2, 2023
mathlib-bors bot pushed a commit that referenced this pull request Dec 2, 2023
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -160,6 +160,10 @@ instance Fin.shrinkable {n : Nat} : Shrinkable (Fin n.succ) where
instance Int.shrinkable : Shrinkable Int where
shrink n := Nat.shrink n.natAbs |>.map (λ x => ([x, -x] : List ℤ)) |>.join

instance Rat.shrinkable : Shrinkable Rat where
shrink r :=
(Shrinkable.shrink r.num).bind fun d => Nat.shrink r.den |>.map fun n => Rat.divInt d n
Copy link
Member

Choose a reason for hiding this comment

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

Should this add the reciprocals too? I think this shrink will produce only integers if the input is an integer. Maybe that's a feature though!

@mathlib-bors
Copy link

mathlib-bors bot commented Dec 2, 2023

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: add slim_check generators for Rat [Merged by Bors] - feat: add slim_check generators for Rat Dec 2, 2023
@mathlib-bors mathlib-bors bot closed this Dec 2, 2023
@mathlib-bors mathlib-bors bot deleted the slim_check_rat branch December 2, 2023 12:45
awueth pushed a commit that referenced this pull request Dec 19, 2023
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants