OrientedCmp cmp asserts that cmp is determined by the relation cmp x y = .lt.
The comparator operation is symmetric, in the sense that if
cmp x yequals.ltthencmp y x = .gtand vice versa.
Instances
TransCmp cmp asserts that cmp induces a transitive relation.
- le_trans {x y z : α} : cmp x y ≠ Ordering.gt → cmp y z ≠ Ordering.gt → cmp x z ≠ Ordering.gt
The comparator operation is transitive.
Instances
LTCmp cmp asserts that cmp x y = .lt and x < y coincide.
cmp x y = .ltholds iffx < yis true.
Instances
LECmp cmp asserts that cmp x y ≠ .gt and x ≤ y coincide.
cmp x y ≠ .gtholds iffx ≤ yis true.
Instances
LawfulCmp cmp asserts that the LE, LT, BEq instances are all coherent with each other
and with cmp, describing a strict weak order (a linear order except for antisymmetry).
Instances
OrientedOrd α asserts that the Ord instance satisfies OrientedCmp.
Equations
Instances For
Local instance for OrientedOrd lexOrd.
Local instance for OrientedOrd ord.opposite.
Local instance for OrientedOrd (ord.on f).
Local instance for OrientedOrd (oα.lex oβ).
Local instance for OrientedOrd (oα.lex' oβ).
Pull back a comparator by a function f, by applying the comparator to both arguments.
Equations
- Ordering.byKey f cmp a b = cmp (f a) (f b)