Module docstring
{"# Orders
Defines classes for preorders, partial orders, and linear orders and proves some basic lemmas about them. ","### Unbundled classes ","### Minimal and maximal ","### Upper and lower sets "}
{"# Orders
Defines classes for preorders, partial orders, and linear orders and proves some basic lemmas about them. ","### Unbundled classes ","### Minimal and maximal ","### Upper and lower sets "}
EmptyRelation
definition
{α : Sort*}
/-- An empty relation does not relate any elements. -/
@[nolint unusedArguments] def EmptyRelation {α : Sort*} := fun _ _ : α ↦ False
IsIrrefl
structure
(α : Sort*) (r : α → α → Prop)
IsRefl
structure
(α : Sort*) (r : α → α → Prop)
IsSymm
structure
(α : Sort*) (r : α → α → Prop)
IsAsymm
structure
(α : Sort*) (r : α → α → Prop)
IsAntisymm
structure
(α : Sort*) (r : α → α → Prop)
/-- `IsAntisymm X r` means the binary relation `r` on `X` is antisymmetric. -/
class IsAntisymm (α : Sort*) (r : α → α → Prop) : Prop where
antisymm : ∀ a b, r a b → r b a → a = b
IsAsymm.toIsAntisymm
instance
{α : Sort*} (r : α → α → Prop) [IsAsymm α r] : IsAntisymm α r
instance (priority := 100) IsAsymm.toIsAntisymm {α : Sort*} (r : α → α → Prop) [IsAsymm α r] :
IsAntisymm α r where
antisymm _ _ hx hy := (IsAsymm.asymm _ _ hx hy).elim
IsTrans
structure
(α : Sort*) (r : α → α → Prop)
instTransOfIsTrans
instance
{α : Sort*} {r : α → α → Prop} [IsTrans α r] : Trans r r r
instance {α : Sort*} {r : α → α → Prop} [IsTrans α r] : Trans r r r :=
⟨IsTrans.trans _ _ _⟩
instIsTransOfTrans
instance
{α : Sort*} {r : α → α → Prop} [Trans r r r] : IsTrans α r
instance (priority := 100) {α : Sort*} {r : α → α → Prop} [Trans r r r] : IsTrans α r :=
⟨fun _ _ _ => Trans.trans⟩
IsTotal
structure
(α : Sort*) (r : α → α → Prop)
/-- `IsTotal X r` means that the binary relation `r` on `X` is total, that is, that for any
`x y : X` we have `r x y` or `r y x`. -/
class IsTotal (α : Sort*) (r : α → α → Prop) : Prop where
total : ∀ a b, r a b ∨ r b a
IsPreorder
structure
(α : Sort*) (r : α → α → Prop) : 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. -/
class IsPreorder (α : Sort*) (r : α → α → Prop) : Prop extends IsRefl α r, IsTrans α r
IsPartialOrder
structure
(α : Sort*) (r : α → α → Prop) : 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`. -/
class IsPartialOrder (α : Sort*) (r : α → α → Prop) : Prop extends IsPreorder α r, IsAntisymm α r
IsLinearOrder
structure
(α : Sort*) (r : α → α → Prop) : 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`. -/
class IsLinearOrder (α : Sort*) (r : α → α → Prop) : Prop extends IsPartialOrder α r, IsTotal α r
IsEquiv
structure
(α : Sort*) (r : α → α → Prop) : 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`. -/
class IsEquiv (α : Sort*) (r : α → α → Prop) : Prop extends IsPreorder α r, IsSymm α r
IsStrictOrder
structure
(α : Sort*) (r : α → α → Prop) : Prop extends IsIrrefl α r, IsTrans α r
/-- `IsStrictOrder X r` means that the binary relation `r` on `X` is a strict order, that is,
`IsIrrefl X r` and `IsTrans X r`. -/
class IsStrictOrder (α : Sort*) (r : α → α → Prop) : Prop extends IsIrrefl α r, IsTrans α r
IsStrictWeakOrder
structure
(α : Sort*) (lt : α → α → Prop) : 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`. -/
class IsStrictWeakOrder (α : Sort*) (lt : α → α → Prop) : Prop extends IsStrictOrder α lt where
incomp_trans : ∀ a b c, ¬lt a b¬lt a b ∧ ¬lt b a → ¬lt b c¬lt b c ∧ ¬lt c b → ¬lt a c¬lt a c ∧ ¬lt c a
IsTrichotomous
structure
(α : Sort*) (lt : α → α → Prop)
/-- `IsTrichotomous X lt` means that the binary relation `lt` on `X` is trichotomous, that is,
either `lt a b` or `a = b` or `lt b a` for any `a` and `b`. -/
class IsTrichotomous (α : Sort*) (lt : α → α → Prop) : Prop where
trichotomous : ∀ a b, lt a b ∨ a = b ∨ lt b a
IsStrictTotalOrder
structure
(α : Sort*) (lt : α → α → Prop) : 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`. -/
class IsStrictTotalOrder (α : Sort*) (lt : α → α → Prop) : Prop
extends IsTrichotomous α lt, IsStrictOrder α lt
iff_isEquiv
instance
: IsEquiv Prop Iff
/-- `Iff` is an equivalence relation. -/
instance iff_isEquiv : IsEquiv Prop Iff where
symm := @Iff.symm
trans := @Iff.trans
refl := @Iff.refl
irrefl
theorem
[IsIrrefl α r] (a : α) : ¬a ≺ a
lemma irrefl [IsIrrefl α r] (a : α) : ¬a ≺ a := IsIrrefl.irrefl a
refl
theorem
[IsRefl α r] (a : α) : a ≺ a
lemma refl [IsRefl α r] (a : α) : a ≺ a := IsRefl.refl a
trans
theorem
[IsTrans α r] : a ≺ b → b ≺ c → a ≺ c
lemma trans [IsTrans α r] : a ≺ b → b ≺ c → a ≺ c := IsTrans.trans _ _ _
symm
theorem
[IsSymm α r] : a ≺ b → b ≺ a
lemma symm [IsSymm α r] : a ≺ b → b ≺ a := IsSymm.symm _ _
antisymm
theorem
[IsAntisymm α r] : a ≺ b → b ≺ a → a = b
lemma antisymm [IsAntisymm α r] : a ≺ b → b ≺ a → a = b := IsAntisymm.antisymm _ _
asymm
theorem
[IsAsymm α r] : a ≺ b → ¬b ≺ a
lemma asymm [IsAsymm α r] : a ≺ b → ¬b ≺ a := IsAsymm.asymm _ _
trichotomous
theorem
[IsTrichotomous α r] : ∀ a b : α, a ≺ b ∨ a = b ∨ b ≺ a
lemma trichotomous [IsTrichotomous α r] : ∀ a b : α, a ≺ b ∨ a = b ∨ b ≺ a :=
IsTrichotomous.trichotomous
isAsymm_of_isTrans_of_isIrrefl
instance
[IsTrans α r] [IsIrrefl α r] : IsAsymm α r
instance (priority := 90) isAsymm_of_isTrans_of_isIrrefl [IsTrans α r] [IsIrrefl α r] :
IsAsymm α r :=
⟨fun a _b h₁ h₂ => absurd (_root_.trans h₁ h₂) (irrefl a)⟩
IsIrrefl.decide
instance
[DecidableRel r] [IsIrrefl α r] : IsIrrefl α (fun a b => decide (r a b) = true)
instance IsIrrefl.decide [DecidableRel r] [IsIrrefl α r] :
IsIrrefl α (fun a b => decide (r a b) = true) where
irrefl := fun a => by simpa using irrefl a
IsRefl.decide
instance
[DecidableRel r] [IsRefl α r] : IsRefl α (fun a b => decide (r a b) = true)
instance IsRefl.decide [DecidableRel r] [IsRefl α r] :
IsRefl α (fun a b => decide (r a b) = true) where
refl := fun a => by simpa using refl a
IsTrans.decide
instance
[DecidableRel r] [IsTrans α r] : IsTrans α (fun a b => decide (r a b) = true)
instance IsTrans.decide [DecidableRel r] [IsTrans α r] :
IsTrans α (fun a b => decide (r a b) = true) where
trans := fun a b c => by simpa using trans a b c
IsSymm.decide
instance
[DecidableRel r] [IsSymm α r] : IsSymm α (fun a b => decide (r a b) = true)
instance IsSymm.decide [DecidableRel r] [IsSymm α r] :
IsSymm α (fun a b => decide (r a b) = true) where
symm := fun a b => by simpa using symm a b
IsAntisymm.decide
instance
[DecidableRel r] [IsAntisymm α r] : IsAntisymm α (fun a b => decide (r a b) = true)
instance IsAntisymm.decide [DecidableRel r] [IsAntisymm α r] :
IsAntisymm α (fun a b => decide (r a b) = true) where
antisymm a b h₁ h₂ := antisymm (r := r) _ _ (by simpa using h₁) (by simpa using h₂)
IsAsymm.decide
instance
[DecidableRel r] [IsAsymm α r] : IsAsymm α (fun a b => decide (r a b) = true)
instance IsAsymm.decide [DecidableRel r] [IsAsymm α r] :
IsAsymm α (fun a b => decide (r a b) = true) where
asymm := fun a b => by simpa using asymm a b
IsTotal.decide
instance
[DecidableRel r] [IsTotal α r] : IsTotal α (fun a b => decide (r a b) = true)
instance IsTotal.decide [DecidableRel r] [IsTotal α r] :
IsTotal α (fun a b => decide (r a b) = true) where
total := fun a b => by simpa using total a b
IsTrichotomous.decide
instance
[DecidableRel r] [IsTrichotomous α r] : IsTrichotomous α (fun a b => decide (r a b) = true)
instance IsTrichotomous.decide [DecidableRel r] [IsTrichotomous α r] :
IsTrichotomous α (fun a b => decide (r a b) = true) where
trichotomous := fun a b => by simpa using trichotomous a b
irrefl_of
theorem
[IsIrrefl α r] (a : α) : ¬a ≺ a
refl_of
theorem
[IsRefl α r] (a : α) : a ≺ a
trans_of
theorem
[IsTrans α r] : a ≺ b → b ≺ c → a ≺ c
@[elab_without_expected_type] lemma trans_of [IsTrans α r] : a ≺ b → b ≺ c → a ≺ c := _root_.trans
symm_of
theorem
[IsSymm α r] : a ≺ b → b ≺ a
asymm_of
theorem
[IsAsymm α r] : a ≺ b → ¬b ≺ a
total_of
theorem
[IsTotal α r] (a b : α) : a ≺ b ∨ b ≺ a
@[elab_without_expected_type]
lemma total_of [IsTotal α r] (a b : α) : a ≺ b ∨ b ≺ a := IsTotal.total _ _
trichotomous_of
theorem
[IsTrichotomous α r] : ∀ a b : α, a ≺ b ∨ a = b ∨ b ≺ a
@[elab_without_expected_type]
lemma trichotomous_of [IsTrichotomous α r] : ∀ a b : α, a ≺ b ∨ a = b ∨ b ≺ a := trichotomous
Reflexive
definition
/-- `IsRefl` as a definition, suitable for use in proofs. -/
def Reflexive := ∀ x, x ≺ x
Symmetric
definition
/-- `IsSymm` as a definition, suitable for use in proofs. -/
def Symmetric := ∀ ⦃x y⦄, x ≺ y → y ≺ x
Transitive
definition
/-- `IsTrans` as a definition, suitable for use in proofs. -/
def Transitive := ∀ ⦃x y z⦄, x ≺ y → y ≺ z → x ≺ z
Irreflexive
definition
/-- `IsIrrefl` as a definition, suitable for use in proofs. -/
def Irreflexive := ∀ x, ¬x ≺ x
AntiSymmetric
definition
/-- `IsAntisymm` as a definition, suitable for use in proofs. -/
def AntiSymmetric := ∀ ⦃x y⦄, x ≺ y → y ≺ x → x = y
Total
definition
/-- `IsTotal` as a definition, suitable for use in proofs. -/
def Total := ∀ x y, x ≺ y ∨ y ≺ x
Equivalence.reflexive
theorem
(h : Equivalence r) : Reflexive r
theorem Equivalence.reflexive (h : Equivalence r) : Reflexive r := h.refl
Equivalence.symmetric
theorem
(h : Equivalence r) : Symmetric r
theorem Equivalence.symmetric (h : Equivalence r) : Symmetric r :=
fun _ _ ↦ h.symm
Equivalence.transitive
theorem
(h : Equivalence r) : Transitive r
theorem Equivalence.transitive (h : Equivalence r) : Transitive r :=
fun _ _ _ ↦ h.trans
InvImage.trans
theorem
(h : Transitive r) : Transitive (InvImage r f)
theorem InvImage.trans (h : Transitive r) : Transitive (InvImage r f) :=
fun (a₁ a₂ a₃ : α) (h₁ : InvImage r f a₁ a₂) (h₂ : InvImage r f a₂ a₃) ↦ h h₁ h₂
InvImage.irreflexive
theorem
(h : Irreflexive r) : Irreflexive (InvImage r f)
theorem InvImage.irreflexive (h : Irreflexive r) : Irreflexive (InvImage r f) :=
fun (a : α) (h₁ : InvImage r f a a) ↦ h (f a) h₁
Minimal
definition
(P : α → Prop) (x : α) : Prop
/-- `Minimal P x` means that `x` is a minimal element satisfying `P`. -/
def Minimal (P : α → Prop) (x : α) : Prop := P x ∧ ∀ ⦃y⦄, P y → y ≤ x → x ≤ y
Maximal
definition
(P : α → Prop) (x : α) : Prop
/-- `Maximal P x` means that `x` is a maximal element satisfying `P`. -/
def Maximal (P : α → Prop) (x : α) : Prop := P x ∧ ∀ ⦃y⦄, P y → x ≤ y → y ≤ x
Minimal.prop
theorem
(h : Minimal P x) : P x
lemma Minimal.prop (h : Minimal P x) : P x :=
h.1
Maximal.prop
theorem
(h : Maximal P x) : P x
lemma Maximal.prop (h : Maximal P x) : P x :=
h.1
Minimal.le_of_le
theorem
(h : Minimal P x) (hy : P y) (hle : y ≤ x) : x ≤ y
lemma Minimal.le_of_le (h : Minimal P x) (hy : P y) (hle : y ≤ x) : x ≤ y :=
h.2 hy hle
Maximal.le_of_ge
theorem
(h : Maximal P x) (hy : P y) (hge : x ≤ y) : y ≤ x
lemma Maximal.le_of_ge (h : Maximal P x) (hy : P y) (hge : x ≤ y) : y ≤ x :=
h.2 hy hge
MinimalFor
definition
(P : ι → Prop) (f : ι → α) (i : ι) : Prop
/-- `Minimal P i` means that `i` is an element with minimal image along `f` satisfying `P`. -/
def MinimalFor (P : ι → Prop) (f : ι → α) (i : ι) : Prop := P i ∧ ∀ ⦃j⦄, P j → f j ≤ f i → f i ≤ f j
MaximalFor
definition
(P : ι → Prop) (f : ι → α) (i : ι) : Prop
/-- `Maximal P i` means that `i` is an element with minimal image along `f` satisfying `P`. -/
def MaximalFor (P : ι → Prop) (f : ι → α) (i : ι) : Prop := P i ∧ ∀ ⦃j⦄, P j → f i ≤ f j → f j ≤ f i
MinimalFor.prop
theorem
(h : MinimalFor P f i) : P i
lemma MinimalFor.prop (h : MinimalFor P f i) : P i := h.1
MaximalFor.prop
theorem
(h : MaximalFor P f i) : P i
lemma MaximalFor.prop (h : MaximalFor P f i) : P i := h.1
MinimalFor.le_of_le
theorem
(h : MinimalFor P f i) (hj : P j) (hji : f j ≤ f i) : f i ≤ f j
lemma MinimalFor.le_of_le (h : MinimalFor P f i) (hj : P j) (hji : f j ≤ f i) : f i ≤ f j :=
h.2 hj hji
MaximalFor.le_of_le
theorem
(h : MaximalFor P f i) (hj : P j) (hij : f i ≤ f j) : f j ≤ f i
lemma MaximalFor.le_of_le (h : MaximalFor P f i) (hj : P j) (hij : f i ≤ f j) : f j ≤ f i :=
h.2 hj hij
IsUpperSet
definition
{α : Type*} [LE α] (s : Set α) : Prop
/-- 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. -/
def IsUpperSet {α : Type*} [LE α] (s : Set α) : Prop :=
∀ ⦃a b : α⦄, a ≤ b → a ∈ s → b ∈ s
IsLowerSet
definition
{α : Type*} [LE α] (s : Set α) : Prop
/-- 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. -/
def IsLowerSet {α : Type*} [LE α] (s : Set α) : Prop :=
∀ ⦃a b : α⦄, b ≤ a → a ∈ s → b ∈ s
UpperSet
structure
(α : Type*) [LE α]
@[inherit_doc IsUpperSet]
structure UpperSet (α : Type*) [LE α] where
/-- The carrier of an `UpperSet`. -/
carrier : Set α
/-- The carrier of an `UpperSet` is an upper set. -/
upper' : IsUpperSet carrier
LowerSet
structure
(α : Type*) [LE α]
@[inherit_doc IsLowerSet]
structure LowerSet (α : Type*) [LE α] where
/-- The carrier of a `LowerSet`. -/
carrier : Set α
/-- The carrier of a `LowerSet` is a lower set. -/
lower' : IsLowerSet carrier
of_eq
theorem
[IsRefl α r] : ∀ {a b}, a = b → r a b
comm
theorem
[IsSymm α r] {a b : α} : r a b ↔ r b a
theorem comm [IsSymm α r] {a b : α} : r a b ↔ r b a :=
⟨symm, symm⟩
antisymm'
theorem
[IsAntisymm α r] {a b : α} : r a b → r b a → b = a
theorem antisymm' [IsAntisymm α r] {a b : α} : r a b → r b a → b = a := fun h h' => antisymm h' h
antisymm_iff
theorem
[IsRefl α r] [IsAntisymm α r] {a b : α} : r a b ∧ r b a ↔ a = b
theorem antisymm_iff [IsRefl α r] [IsAntisymm α r] {a b : α} : r a b ∧ r b ar a b ∧ r b a ↔ a = b :=
⟨fun h => antisymm h.1 h.2, by
rintro rfl
exact ⟨refl _, refl _⟩⟩
antisymm_of
theorem
(r : α → α → Prop) [IsAntisymm α r] {a b : α} : r a b → r b a → a = 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 (r : α → α → Prop) [IsAntisymm α r] {a b : α} : r a b → r b a → a = b :=
antisymm
antisymm_of'
theorem
(r : α → α → Prop) [IsAntisymm α r] {a b : α} : r a b → r b a → b = a
/-- 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' (r : α → α → Prop) [IsAntisymm α r] {a b : α} : r a b → r b a → b = a :=
antisymm'
comm_of
theorem
(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 comm_of (r : α → α → Prop) [IsSymm α r] {a b : α} : r a b ↔ r b a :=
comm
IsAsymm.isAntisymm
theorem
(r) [IsAsymm α r] : IsAntisymm α r
protected theorem IsAsymm.isAntisymm (r) [IsAsymm α r] : IsAntisymm α r :=
⟨fun _ _ h₁ h₂ => (_root_.asymm h₁ h₂).elim⟩
IsAsymm.isIrrefl
theorem
[IsAsymm α r] : IsIrrefl α r
protected theorem IsAsymm.isIrrefl [IsAsymm α r] : IsIrrefl α r :=
⟨fun _ h => _root_.asymm h h⟩
IsTotal.isTrichotomous
theorem
(r) [IsTotal α r] : IsTrichotomous α r
protected theorem IsTotal.isTrichotomous (r) [IsTotal α r] : IsTrichotomous α r :=
⟨fun a b => or_left_comm.1 (Or.inr <| total_of r a b)⟩
IsTotal.to_isRefl
instance
(r) [IsTotal α r] : IsRefl α r
instance (priority := 100) IsTotal.to_isRefl (r) [IsTotal α r] : IsRefl α r :=
⟨fun a => or_self_iff.1 <| total_of r a a⟩
ne_of_irrefl
theorem
{r} [IsIrrefl α r] : ∀ {x y : α}, r x y → x ≠ y
theorem ne_of_irrefl {r} [IsIrrefl α r] : ∀ {x y : α}, r x y → x ≠ y
| _, _, h, rfl => irrefl _ h
ne_of_irrefl'
theorem
{r} [IsIrrefl α r] : ∀ {x y : α}, r x y → y ≠ x
theorem ne_of_irrefl' {r} [IsIrrefl α r] : ∀ {x y : α}, r x y → y ≠ x
| _, _, h, rfl => irrefl _ h
not_rel_of_subsingleton
theorem
(r) [IsIrrefl α r] [Subsingleton α] (x y) : ¬r x y
theorem not_rel_of_subsingleton (r) [IsIrrefl α r] [Subsingleton α] (x y) : ¬r x y :=
Subsingleton.elim x y ▸ irrefl x
rel_of_subsingleton
theorem
(r) [IsRefl α r] [Subsingleton α] (x y) : r x y
theorem rel_of_subsingleton (r) [IsRefl α r] [Subsingleton α] (x y) : r x y :=
Subsingleton.elim x y ▸ refl x
empty_relation_apply
theorem
(a b : α) : EmptyRelation a b ↔ False
@[simp]
theorem empty_relation_apply (a b : α) : EmptyRelationEmptyRelation a b ↔ False :=
Iff.rfl
instIsIrreflEmptyRelation
instance
: IsIrrefl α EmptyRelation
instance : IsIrrefl α EmptyRelation :=
⟨fun _ => id⟩
rel_congr_left
theorem
[IsSymm α r] [IsTrans α r] {a b c : α} (h : r a b) : r a c ↔ r b c
theorem rel_congr_left [IsSymm α r] [IsTrans α r] {a b c : α} (h : r a b) : r a c ↔ r b c :=
⟨trans_of r (symm_of r h), trans_of r h⟩
rel_congr_right
theorem
[IsSymm α r] [IsTrans α r] {a b c : α} (h : r b c) : r a b ↔ r a c
theorem rel_congr_right [IsSymm α r] [IsTrans α r] {a b c : α} (h : r b c) : r a b ↔ r a c :=
⟨(trans_of r · h), (trans_of r · (symm_of r h))⟩
rel_congr
theorem
[IsSymm α r] [IsTrans α r] {a b c d : α} (h₁ : r a b) (h₂ : r c d) : r a c ↔ r b d
theorem rel_congr [IsSymm α r] [IsTrans α r] {a b c d : α} (h₁ : r a b) (h₂ : r c d) :
r a c ↔ r b d := by
rw [rel_congr_left h₁, rel_congr_right h₂]
trans_trichotomous_left
theorem
[IsTrans α r] [IsTrichotomous α r] {a b c : α} (h₁ : ¬r b a) (h₂ : r b c) : r a c
theorem trans_trichotomous_left [IsTrans α r] [IsTrichotomous α r] {a b c : α}
(h₁ : ¬r b a) (h₂ : r b c) : r a c := by
rcases trichotomous_of r a b with (h₃ | rfl | h₃)
· exact _root_.trans h₃ h₂
· exact h₂
· exact absurd h₃ h₁
trans_trichotomous_right
theorem
[IsTrans α r] [IsTrichotomous α r] {a b c : α} (h₁ : r a b) (h₂ : ¬r c b) : r a c
theorem trans_trichotomous_right [IsTrans α r] [IsTrichotomous α r] {a b c : α}
(h₁ : r a b) (h₂ : ¬r c b) : r a c := by
rcases trichotomous_of r b c with (h₃ | rfl | h₃)
· exact _root_.trans h₁ h₃
· exact h₁
· exact absurd h₃ h₂
transitive_of_trans
theorem
(r : α → α → Prop) [IsTrans α r] : Transitive r
theorem transitive_of_trans (r : α → α → Prop) [IsTrans α r] : Transitive r := IsTrans.trans
extensional_of_trichotomous_of_irrefl
theorem
(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. -/
theorem extensional_of_trichotomous_of_irrefl (r : α → α → Prop) [IsTrichotomous α r] [IsIrrefl α r]
{a b : α} (H : ∀ x, r x a ↔ r x b) : a = b :=
((@trichotomous _ r _ a b).resolve_left <| mt (H _).2 <| irrefl a).resolve_right <| mt (H _).1
<| irrefl b