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

feat: simple lemmas about LE and LT #372

Merged
merged 8 commits into from
Nov 19, 2023
Merged

feat: simple lemmas about LE and LT #372

merged 8 commits into from
Nov 19, 2023

Conversation

semorrison
Copy link
Collaborator

No description provided.

@semorrison semorrison added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Nov 17, 2023

@[simp] theorem gt_iff_lt [LT α] {x y : α} : x > y ↔ y < x := Iff.rfl

theorem le_of_eq_of_le {a b c : α} [LE α] (h₁ : a = b) (h₂ : b ≤ c) : a ≤ c := by subst h₁; exact h₂
Copy link
Contributor

Choose a reason for hiding this comment

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

These have dot notation aliases as well in mathlib (e.g. Eq.trans_le). How do you feel about adding those?

Copy link
Collaborator Author

@semorrison semorrison Nov 18, 2023

Choose a reason for hiding this comment

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

I'm not convinced they make sense without also upstreaming the primed versions e.g. le_of_eq_of_le', we could have Eq.trans_ge as well as Eq.trans_le.

(Edit: on second thoughts, done!)

More generally, I think with upstreaming PRs the right course of action instead of proposing "how about also upstreaming these?" is to make a second PR. I'd prefer to be able to move stuff that I know I need, without necessarily having to have a discussion about how much more to move at the same time.

There's also the danger of upstreaming cruft from Mathlib that isn't actually going to be used. :-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Eq.trans_le/Eq.trans_lt are both special cases of Eq.substr. I don't think we need to clutter the Eq namespace with special cases of Eq.subst/Eq.substr.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can see the utility for .trans_eq but I would prefer .congr_right or similar since I can't think of a precedent for trans_eq in std or core.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's no way I'm going to include in this PR a lemma I don't care about, moved from Mathlib, but changing it's name.

As there is needless controversy, I'm removing the aliases from this PR. If someone needs them in Std, or has opinions about their names in Mathlib, please PR those separately!

Std/Classes/Order.lean Outdated Show resolved Hide resolved
@digama0 digama0 merged commit 85f6436 into main Nov 19, 2023
2 checks passed
@digama0 digama0 deleted the le_of_eq_of_le branch November 19, 2023 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review This PR is ready for review; the author thinks it is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants