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(tactic/cancel_denoms): try to remove numeral denominators #3109

Closed
wants to merge 5 commits into from

Conversation

robertylewis
Copy link
Member


This is another linarith preprocessing step that I've factored out.

variables {α : Type} [linear_ordered_field α] (a b c d : α)

example (h : a / 5 + b / 4 < c) : 4*a + 5*b < 20*c :=
begin
  cancel_denoms at h,
  exact h
end

example (h : a > 0) : a / 5 > 0 :=
begin
  cancel_denoms,
  exact h
end

This tactic is not particularly refined. I think it's only mildly useful as a standalone thing, and linarith doesn't care much about its output being clean. But it can occasionally be convenient. Improving the standalone version would be a good project for someone learning metaprogramming -- maybe not as a first tactic, but as a second or third.

@robertylewis robertylewis added the awaiting-review The author would like community review of the PR label Jun 18, 2020
@bryangingechen bryangingechen added the t-meta Tactics, attributes or user commands label Jun 18, 2020
@jcommelin
Copy link
Member

How is this related to field_simp? I guess there is a certain overlap. Should field_simp call this tactic?

@robertylewis
Copy link
Member Author

field_simp doesn't solve either example in my first post, and cancel_denoms will certainly fail most/all of the field_simp tests. My instinct is that they serve different purposes and should be kept separate. If people turn out to use them both together in practice, we could reconsider.

@bryangingechen
Copy link
Collaborator

Is the difference between this and field_simp that field_simp can only cancel denominators on equalities? Someone looking for field_simp might find cancel_denoms instead (or vice versa), so maybe they should be mentioned in each other's doc strings / tactic docs.

@robertylewis
Copy link
Member Author

I've pushed an addition to the docs to try to clarify the relation with field_simp.

@bryangingechen
Copy link
Collaborator

bors r+

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jun 21, 2020
@bryangingechen
Copy link
Collaborator

bors r-

@bors
Copy link

bors bot commented Jun 21, 2020

Canceled.

@bryangingechen
Copy link
Collaborator

bors r+

bors bot pushed a commit that referenced this pull request Jun 21, 2020
Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
@bors
Copy link

bors bot commented Jun 21, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(tactic/cancel_denoms): try to remove numeral denominators [Merged by Bors] - feat(tactic/cancel_denoms): try to remove numeral denominators Jun 21, 2020
@bors bors bot closed this Jun 21, 2020
@bors bors bot deleted the cancel_denoms branch June 21, 2020 18:31
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
…rover-community#3109)

Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants