Orders #
Defines classes for preorders, partial orders, and linear orders and proves some basic lemmas about them.
A preorder is a reflexive, transitive relation ≤
with a < b
defined in the obvious way.
Instances
<
is decidable if ≤
is.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Definition of PartialOrder
and lemmas about types with a partial order #
A partial order is a reflexive, transitive, antisymmetric relation ≤
.
Instances
Equality is decidable if ≤
is.
Equations
Instances For
Definition of LinearOrder
and lemmas about types with a linear order #
This attempts to prove that a given instance of compare
is equal to compareOfLessAndEq
by
introducing the arguments and trying the following approaches in order:
- seeing if
rfl
works - seeing if the
compare
at hand is nonetheless essentiallycompareOfLessAndEq
, but, because of implicit arguments, requires us to unfold the defs and split theif
s in the definition ofcompareOfLessAndEq
- seeing if we can split by cases on the arguments, then see if the defs work themselves out
(useful when
compare
is defined via amatch
statement, as it is forBool
)
Equations
- tacticCompareOfLessAndEq_rfl = Lean.ParserDescr.node `tacticCompareOfLessAndEq_rfl 1024 (Lean.ParserDescr.nonReservedSymbol "compareOfLessAndEq_rfl" false)
Instances For
A linear order is reflexive, transitive, antisymmetric and total relation ≤
.
We assume that every linear ordered type has decidable (≤)
, (<)
, and (=)
.
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- min : α → α → α
- max : α → α → α
- compare : α → α → Ordering
A linear order is total.
- decidableLE : DecidableRel fun (x x_1 : α) => x ≤ x_1
In a linearly ordered type, we assume the order relations are all decidable.
- decidableEq : DecidableEq α
In a linearly ordered type, we assume the order relations are all decidable.
- decidableLT : DecidableRel fun (x x_1 : α) => x < x_1
In a linearly ordered type, we assume the order relations are all decidable.
The minimum function is equivalent to the one you get from
minOfLe
.The minimum function is equivalent to the one you get from
maxOfLe
.- compare_eq_compareOfLessAndEq : ∀ (a b : α), compare a b = compareOfLessAndEq a b
Comparison via
compare
is equal to the canonical comparison given decidable<
and=
.
Instances
Equations
Equations
Equations
- instDecidableEq a b = LinearOrder.decidableEq a b
Equations
- (_ : IsTotalPreorder α fun (x x_1 : α) => x ≤ x_1) = (_ : IsTotalPreorder α fun (x x_1 : α) => x ≤ x_1)
Equations
- (_ : IsStrictWeakOrder α fun (x x_1 : α) => x < x_1) = (_ : IsStrictWeakOrder α fun (x x_1 : α) => x < x_1)
Equations
- (_ : IsStrictTotalOrder α fun (x x_1 : α) => x < x_1) = (_ : IsStrictTotalOrder α fun (x x_1 : α) => x < x_1)
Equations
- (_ : Std.TransCmp compare) = (_ : Std.TransCmp compare)