RFC: replace `compareOfLessAndEq` with `compareOfLT`
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Proposal
I suggest replacing compareOfLessAndEq with the following definition:
def compareOfLT {α} [LT α] [DecidableLT α] (x y : α) : Ordering :=
if x < y then Ordering.lt
else if y < x then Ordering.gt
else Ordering.eq
It can be used for any Std.LawfulBOrd without le_antisymm, and it also makes the proofs of basic lemmas simpler. Currently, lemmas like compareOfLessAndEq_eq_gt require some hypotheses about LE and Eq.
Community Feedback
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documented compareOfLessAndEq entry point and the compareOfLessAndEq_eq_gt lemma linked in the issue. Check the linked Zulip discussion before changing the ordering definition. Done means compareOfLT is available as proposed, the old comparison is replaced, and the affected basic lemmas still hold without the former hypotheses.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100