Note about Mathlib/Init/ #
The files in Mathlib/Init are leftovers from the port from Mathlib3.
(They contain content moved from lean3 itself that Mathlib needed but was not moved to lean4.)
We intend to move all the content of these files out into the main Mathlib directory structure.
Contributions assisting with this are appreciated.
#align statements without corresponding declarations
(i.e. because the declaration is in Batteries or Lean) can be left here.
These will be deleted soon so will not significantly delay deleting otherwise empty Init files.
Helper definitions and instances for Ordering #
Equations
- instReprOrdering_mathlib = { reprPrec := reprOrdering✝ }
@[inline]
Combine two Orderings lexicographically.
Equations
- x✝.orElse x = match x✝, x with | Ordering.lt, x => Ordering.lt | Ordering.eq, o => o | Ordering.gt, x => Ordering.gt
Instances For
The relation corresponding to each Ordering constructor (e.g. .lt.toProp a b is a < b).
Equations
- x.toRel = match (motive := Ordering → α → α → Prop) x with | Ordering.lt => fun (x x_1 : α) => x < x_1 | Ordering.eq => Eq | Ordering.gt => fun (x x_1 : α) => x > x_1
Instances For
Lift a decidable relation to an Ordering,
assuming that incomparable terms are Ordering.eq.
Equations
- cmpUsing lt a b = if lt a b then Ordering.lt else if lt b a then Ordering.gt else Ordering.eq