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(algebra/ordered_monoid): inequalities involving mul/add #6171

Closed
wants to merge 5 commits into from

Conversation

benjamindavidson
Copy link
Collaborator

I couldn't find some statements about inequalities, so I'm adding them. I included all the useful variants I could think of.

@benjamindavidson benjamindavidson added the awaiting-review The author would like community review of the PR label Feb 11, 2021
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.

Pretty much all these lemmas take an h argument only to apply either le.trans or le.trans_lt on it with an existing proof. I'm not sure some_long_name h ... is really better than (some_short_name ...).trans h, and therefore whether these lemmas are worth having,

@benjamindavidson
Copy link
Collaborator Author

benjamindavidson commented Feb 11, 2021

I think in cases like this it's always worth adding the exact statement, even if it's just so it will be generated by library_search (which makes things easier and more accessible for those less familiar with the repository). Moreover, by way of example,

example {a b c : ℝ} (h : a^2 + b^2 < c) : -sqrt c < a ∧ a < sqrt c :=
begin
  have : a^2 < c,
  { simpa only [add_zero] using (add_le_add_left (pow_two_nonneg b) (a^2)).trans_lt h },
  exact sqr_lt.mp this,
end

is significantly longer and more convoluted than

example {a b c : ℝ} (h : a^2 + b^2 < c) : -sqrt c < a ∧ a < sqrt c :=
sqr_lt.mp (lt_of_add_lt_left h (pow_two_nonneg b))

I also believe that @jcommelin is in favor of adding these lemmas -Johan, can you please confirm (or correct me if I'm wrong)?

@semorrison
Copy link
Collaborator

I think in cases like this it's always worth adding the exact statement, even if it's just so it will be generated by library_search (which makes things easier and more accessible for those less familiar with the repository). Moreover, by way of example,

I'm in favour of adding lemmas like these. I don't think their existence causes any harm, and easy inequalities have such a high Lean-effort : IRL-effort ratio that any help (e.g. library_search) is useful.

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@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 Feb 17, 2021
bors bot pushed a commit that referenced this pull request Feb 17, 2021
I couldn't find some statements about inequalities, so I'm adding them. I included all the useful variants I could think of.
@bors
Copy link

bors bot commented Feb 17, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(algebra/ordered_monoid): inequalities involving mul/add [Merged by Bors] - feat(algebra/ordered_monoid): inequalities involving mul/add Feb 17, 2021
@bors bors bot closed this Feb 17, 2021
@bors bors bot deleted the lt_of_mul_lt branch February 17, 2021 15:28
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
I couldn't find some statements about inequalities, so I'm adding them. I included all the useful variants I could think of.
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+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants