Documentation

Mathlib.Order.Defs.Unbundled

Orders #

Defines classes for preorders, partial orders, and linear orders and proves some basic lemmas about them.

Unbundled classes #

def EmptyRelation {α : Sort u_1} :
ααProp

An empty relation does not relate any elements.

Equations
Instances For
class IsRefl (α : Sort u_1) (r : ααProp) :

IsRefl X r means the binary relation r on X is reflexive.

  • refl (a : α) : r a a
Instances
@[instance 100]
instance IsAsymm.toIsAntisymm {α : Sort u_1} (r : ααProp) [IsAsymm α r] :
class IsTrans (α : Sort u_1) (r : ααProp) :

IsTrans X r means the binary relation r on X is transitive.

  • trans (a b c : α) : r a br b cr a c
Instances
instance instTransOfIsTrans {α : Sort u_1} {r : ααProp} [IsTrans α r] :
Trans r r r
Equations
@[instance 100]
instance instIsTransOfTrans {α : Sort u_1} {r : ααProp} [Trans r r r] :
IsTrans α r
class IsPreorder (α : Sort u_1) (r : ααProp) extends IsRefl α r, IsTrans α r :

IsPreorder X r means that the binary relation r on X is a pre-order, that is, reflexive and transitive.

  • refl (a : α) : r a a
  • trans (a b c : α) : r a br b cr a c
Instances
class IsPartialOrder (α : Sort u_1) (r : ααProp) extends IsPreorder α r, IsAntisymm α r :

IsPartialOrder X r means that the binary relation r on X is a partial order, that is, IsPreorder X r and IsAntisymm X r.

  • refl (a : α) : r a a
  • trans (a b c : α) : r a br b cr a c
  • antisymm (a b : α) : r a br b aa = b
Instances
class IsLinearOrder (α : Sort u_1) (r : ααProp) extends IsPartialOrder α r, IsTotal α r :

IsLinearOrder X r means that the binary relation r on X is a linear order, that is, IsPartialOrder X r and IsTotal X r.

  • refl (a : α) : r a a
  • trans (a b c : α) : r a br b cr a c
  • antisymm (a b : α) : r a br b aa = b
  • total (a b : α) : r a b r b a
Instances
class IsEquiv (α : Sort u_1) (r : ααProp) extends IsPreorder α r, IsSymm α r :

IsEquiv X r means that the binary relation r on X is an equivalence relation, that is, IsPreorder X r and IsSymm X r.

  • refl (a : α) : r a a
  • trans (a b c : α) : r a br b cr a c
  • symm (a b : α) : r a br b a
Instances
class IsStrictWeakOrder (α : Sort u_1) (lt : ααProp) extends IsStrictOrder α lt :

IsStrictWeakOrder X lt means that the binary relation lt on X is a strict weak order, that is, IsStrictOrder X lt and ¬lt a b ∧ ¬lt b a → ¬lt b c ∧ ¬lt c b → ¬lt a c ∧ ¬lt c a.

  • irrefl (a : α) : ¬lt a a
  • trans (a b c : α) : lt a blt b clt a c
  • incomp_trans (a b c : α) : ¬lt a b ¬lt b a¬lt b c ¬lt c b¬lt a c ¬lt c a
Instances
class IsStrictTotalOrder (α : Sort u_1) (lt : ααProp) extends IsTrichotomous α lt, IsStrictOrder α lt :

IsStrictTotalOrder X lt means that the binary relation lt on X is a strict total order, that is, IsTrichotomous X lt and IsStrictOrder X lt.

Instances
instance eq_isEquiv (α : Sort u_1) :
IsEquiv α fun (x1 x2 : α) => x1 = x2

Equality is an equivalence relation.

Iff is an equivalence relation.

theorem irrefl {α : Sort u_1} {r : ααProp} [IsIrrefl α r] (a : α) :
¬r a a
theorem refl {α : Sort u_1} {r : ααProp} [IsRefl α r] (a : α) :
r a a
theorem trans {α : Sort u_1} {r : ααProp} {a b c : α} [IsTrans α r] :
r a br b cr a c
theorem symm {α : Sort u_1} {r : ααProp} {a b : α} [IsSymm α r] :
r a br b a
theorem antisymm {α : Sort u_1} {r : ααProp} {a b : α} [IsAntisymm α r] :
r a br b aa = b
theorem asymm {α : Sort u_1} {r : ααProp} {a b : α} [IsAsymm α r] :
r a b¬r b a
theorem trichotomous {α : Sort u_1} {r : ααProp} [IsTrichotomous α r] (a b : α) :
r a b a = b r b a
@[instance 90]
instance isAsymm_of_isTrans_of_isIrrefl {α : Sort u_1} {r : ααProp} [IsTrans α r] [IsIrrefl α r] :
IsAsymm α r
instance IsIrrefl.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsIrrefl α r] :
IsIrrefl α fun (a b : α) => Decidable.decide (r a b) = true
instance IsRefl.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsRefl α r] :
IsRefl α fun (a b : α) => Decidable.decide (r a b) = true
instance IsTrans.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsTrans α r] :
IsTrans α fun (a b : α) => Decidable.decide (r a b) = true
instance IsSymm.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsSymm α r] :
IsSymm α fun (a b : α) => Decidable.decide (r a b) = true
instance IsAntisymm.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsAntisymm α r] :
IsAntisymm α fun (a b : α) => Decidable.decide (r a b) = true
instance IsAsymm.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsAsymm α r] :
IsAsymm α fun (a b : α) => Decidable.decide (r a b) = true
instance IsTotal.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsTotal α r] :
IsTotal α fun (a b : α) => Decidable.decide (r a b) = true
instance IsTrichotomous.decide {α : Sort u_1} {r : ααProp} [DecidableRel r] [IsTrichotomous α r] :
IsTrichotomous α fun (a b : α) => Decidable.decide (r a b) = true
@[elab_without_expected_type]
theorem irrefl_of {α : Sort u_1} (r : ααProp) [IsIrrefl α r] (a : α) :
¬r a a
@[elab_without_expected_type]
theorem refl_of {α : Sort u_1} (r : ααProp) [IsRefl α r] (a : α) :
r a a
@[elab_without_expected_type]
theorem trans_of {α : Sort u_1} (r : ααProp) {a b c : α} [IsTrans α r] :
r a br b cr a c
@[elab_without_expected_type]
theorem symm_of {α : Sort u_1} (r : ααProp) {a b : α} [IsSymm α r] :
r a br b a
@[elab_without_expected_type]
theorem asymm_of {α : Sort u_1} (r : ααProp) {a b : α} [IsAsymm α r] :
r a b¬r b a
@[elab_without_expected_type]
theorem total_of {α : Sort u_1} (r : ααProp) [IsTotal α r] (a b : α) :
r a b r b a
@[elab_without_expected_type]
theorem trichotomous_of {α : Sort u_1} (r : ααProp) [IsTrichotomous α r] (a b : α) :
r a b a = b r b a
def Reflexive {α : Sort u_1} (r : ααProp) :

IsRefl as a definition, suitable for use in proofs.

Equations
def Symmetric {α : Sort u_1} (r : ααProp) :

IsSymm as a definition, suitable for use in proofs.

Equations
def Transitive {α : Sort u_1} (r : ααProp) :

IsTrans as a definition, suitable for use in proofs.

Equations
  • Transitive r = ∀ ⦃x y z : α⦄, r x yr y zr x z
def Irreflexive {α : Sort u_1} (r : ααProp) :

IsIrrefl as a definition, suitable for use in proofs.

Equations
def AntiSymmetric {α : Sort u_1} (r : ααProp) :

IsAntisymm as a definition, suitable for use in proofs.

Equations
def Total {α : Sort u_1} (r : ααProp) :

IsTotal as a definition, suitable for use in proofs.

Equations
theorem Equivalence.reflexive {α : Sort u_1} (r : ααProp) (h : Equivalence r) :
theorem Equivalence.symmetric {α : Sort u_1} (r : ααProp) (h : Equivalence r) :
theorem Equivalence.transitive {α : Sort u_1} (r : ααProp) (h : Equivalence r) :
theorem InvImage.trans {α : Sort u_1} {β : Sort u_2} (r : ββProp) (f : αβ) (h : Transitive r) :
theorem InvImage.irreflexive {α : Sort u_1} {β : Sort u_2} (r : ββProp) (f : αβ) (h : Irreflexive r) :

Minimal and maximal #

def Minimal {α : Type u_1} [LE α] (P : αProp) (x : α) :

Minimal P x means that x is a minimal element satisfying P.

Equations
def Maximal {α : Type u_1} [LE α] (P : αProp) (x : α) :

Maximal P x means that x is a maximal element satisfying P.

Equations
theorem Minimal.prop {α : Type u_1} [LE α] {P : αProp} {x : α} (h : Minimal P x) :
P x
theorem Maximal.prop {α : Type u_1} [LE α] {P : αProp} {x : α} (h : Maximal P x) :
P x
theorem Minimal.le_of_le {α : Type u_1} [LE α] {P : αProp} {x y : α} (h : Minimal P x) (hy : P y) (hle : y x) :
x y
theorem Maximal.le_of_ge {α : Type u_1} [LE α] {P : αProp} {x y : α} (h : Maximal P x) (hy : P y) (hge : x y) :
y x
def MinimalFor {ι : Sort u_1} {α : Type u_2} [LE α] (P : ιProp) (f : ια) (i : ι) :

MinimalFor P f i means that f i is minimal over all i satisfying P.

Equations
def MaximalFor {ι : Sort u_1} {α : Type u_2} [LE α] (P : ιProp) (f : ια) (i : ι) :

MaximalFor P f i means that f i is maximal over all i satisfying P.

Equations
theorem MinimalFor.prop {ι : Sort u_1} {α : Type u_2} [LE α] {P : ιProp} {f : ια} {i : ι} (h : MinimalFor P f i) :
P i
theorem MaximalFor.prop {ι : Sort u_1} {α : Type u_2} [LE α] {P : ιProp} {f : ια} {i : ι} (h : MaximalFor P f i) :
P i
theorem MinimalFor.le_of_le {ι : Sort u_1} {α : Type u_2} [LE α] {P : ιProp} {f : ια} {i j : ι} (h : MinimalFor P f i) (hj : P j) (hji : f j f i) :
f i f j
theorem MaximalFor.le_of_le {ι : Sort u_1} {α : Type u_2} [LE α] {P : ιProp} {f : ια} {i j : ι} (h : MaximalFor P f i) (hj : P j) (hij : f i f j) :
f j f i

Upper and lower sets #

def IsUpperSet {α : Type u_1} [LE α] (s : Set α) :

An upper set in an order α is a set such that any element greater than one of its members is also a member. Also called up-set, upward-closed set.

Equations
def IsLowerSet {α : Type u_1} [LE α] (s : Set α) :

A lower set in an order α is a set such that any element less than one of its members is also a member. Also called down-set, downward-closed set.

Equations
structure UpperSet (α : Type u_1) [LE α] :
Type u_1

The type of upper sets of an order.

An upper set in an order α is a set such that any element greater than one of its members is also a member. Also called up-set, upward-closed set.

Instances For
structure LowerSet (α : Type u_1) [LE α] :
Type u_1

The type of lower sets of an order.

A lower set in an order α is a set such that any element less than one of its members is also a member. Also called down-set, downward-closed set.

Instances For
def IsRelUpperSet {α : Type u_1} [LE α] (s : Set α) (P : αProp) :

An upper set relative to a predicate P is a set such that all elements satisfy P and any element greater than one of its members and satisfying P is also a member.

Equations
def IsRelLowerSet {α : Type u_1} [LE α] (s : Set α) (P : αProp) :

A lower set relative to a predicate P is a set such that all elements satisfy P and any element less than one of its members and satisfying P is also a member.

Equations
structure RelUpperSet {α : Type u_1} [LE α] (P : αProp) :
Type u_1

The type of upper sets of an order relative to P.

An upper set relative to a predicate P is a set such that all elements satisfy P and any element greater than one of its members and satisfying P is also a member.

structure RelLowerSet {α : Type u_1} [LE α] (P : αProp) :
Type u_1

The type of lower sets of an order relative to P.

A lower set relative to a predicate P is a set such that all elements satisfy P and any element less than one of its members and satisfying P is also a member.

theorem of_eq {α : Type u_1} {r : ααProp} [IsRefl α r] {a b : α} :
a = br a b
theorem comm {α : Type u_1} {r : ααProp} [IsSymm α r] {a b : α} :
r a b r b a
theorem antisymm' {α : Type u_1} {r : ααProp} [IsAntisymm α r] {a b : α} :
r a br b ab = a
theorem antisymm_iff {α : Type u_1} {r : ααProp} [IsRefl α r] [IsAntisymm α r] {a b : α} :
r a b r b a a = b
@[elab_without_expected_type]
theorem antisymm_of {α : Type u_1} (r : ααProp) [IsAntisymm α r] {a b : α} :
r a br b aa = b

A version of antisymm with r explicit.

This lemma matches the lemmas from lean core in Init.Algebra.Classes, but is missing there.

@[elab_without_expected_type]
theorem antisymm_of' {α : Type u_1} (r : ααProp) [IsAntisymm α r] {a b : α} :
r a br b ab = a

A version of antisymm' with r explicit.

This lemma matches the lemmas from lean core in Init.Algebra.Classes, but is missing there.

theorem comm_of {α : Type u_1} (r : ααProp) [IsSymm α r] {a b : α} :
r a b r b a

A version of comm with r explicit.

This lemma matches the lemmas from lean core in Init.Algebra.Classes, but is missing there.

theorem IsAsymm.isAntisymm {α : Type u_1} (r : ααProp) [IsAsymm α r] :
theorem IsAsymm.isIrrefl {α : Type u_1} {r : ααProp} [IsAsymm α r] :
theorem IsTotal.isTrichotomous {α : Type u_1} (r : ααProp) [IsTotal α r] :
@[instance 100]
instance IsTotal.to_isRefl {α : Type u_1} (r : ααProp) [IsTotal α r] :
IsRefl α r
theorem ne_of_irrefl {α : Type u_1} {r : ααProp} [IsIrrefl α r] {x y : α} :
r x yx y
theorem ne_of_irrefl' {α : Type u_1} {r : ααProp} [IsIrrefl α r] {x y : α} :
r x yy x
theorem not_rel_of_subsingleton {α : Type u_1} (r : ααProp) [IsIrrefl α r] [Subsingleton α] (x y : α) :
¬r x y
theorem rel_of_subsingleton {α : Type u_1} (r : ααProp) [IsRefl α r] [Subsingleton α] (x y : α) :
r x y
@[simp]
theorem empty_relation_apply {α : Type u_1} (a b : α) :
theorem rel_congr_left {α : Type u_1} {r : ααProp} [IsSymm α r] [IsTrans α r] {a b c : α} (h : r a b) :
r a c r b c
theorem rel_congr_right {α : Type u_1} {r : ααProp} [IsSymm α r] [IsTrans α r] {a b c : α} (h : r b c) :
r a b r a c
theorem rel_congr {α : Type u_1} {r : ααProp} [IsSymm α r] [IsTrans α r] {a b c d : α} (h₁ : r a b) (h₂ : r c d) :
r a c r b d
theorem trans_trichotomous_left {α : Type u_1} {r : ααProp} [IsTrans α r] [IsTrichotomous α r] {a b c : α} (h₁ : ¬r b a) (h₂ : r b c) :
r a c
theorem trans_trichotomous_right {α : Type u_1} {r : ααProp} [IsTrans α r] [IsTrichotomous α r] {a b c : α} (h₁ : r a b) (h₂ : ¬r c b) :
r a c
theorem transitive_of_trans {α : Type u_1} (r : ααProp) [IsTrans α r] :
theorem extensional_of_trichotomous_of_irrefl {α : Type u_1} (r : ααProp) [IsTrichotomous α r] [IsIrrefl α r] {a b : α} (H : ∀ (x : α), r x a r x b) :
a = b

In a trichotomous irreflexive order, every element is determined by the set of predecessors.