leanprover / leanprover/reference-manual
Document new order classes
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 129
- Forks
- 67
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 16
Description
What question should the reference manual answer?
How should I implement orderings for my type?
Additional context
The system of ordering relations was recently revamped, and should be documented.
The overall description is in this thread, and I got these further details to add:
Most order-related stuff can be found in
Init.Data.Order.
Lemmas about linear orders are not required to require all the basic operations (like
LE,LT,Ord,BEq,Minand so on). The need to requireLEandIsLinearOrder, and for each additional operationX,LawfulOrderX. How this plays out formax?_eq_some_iffcan be seen in the linked post.
Assume that you are writing a lemma about a linear order and only want to require
LE. It is possible to use lemmas requiring more operations: OpeningClassical.Orderactivates default instances for the operations, derived fromLE. For example, theOrientedOrdinstance inInit.Data.Order.Lemmas, which does not mentionLT, can rely on the lemmacompare_eq_lt [Ord α] [LT α] [LE α] [LawfulOrderOrd α] [LawfulOrderLT α] {a b : α} : compare a b = .lt ↔ a < b.
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 Init.Data.Order and the linked Zulip feedback thread to understand the revamped ordering relations and their required operations. Document how to implement orderings for a type, including the LE and IsLinearOrder requirements, LawfulOrderX classes, and Classical.Order defaults. Done means the reference manual answers the stated implementation question and covers these details.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100