mathlib documentation

order.​basic

order.​basic

Basic definitions about and <

Definitions

Predicates on functions

Transfering orders

Extra classes

Main theorems

TODO

See also

Tags

preorder, order, partial order, linear order, monotone, strictly monotone

theorem preorder.​ext {α : Type u_1} {A B : preorder α} :
(∀ (x y : α), x y x y)A = B

theorem partial_order.​ext {α : Type u_1} {A B : partial_order α} :
(∀ (x y : α), x y x y)A = B

theorem linear_order.​ext {α : Type u_1} {A B : linear_order α} :
(∀ (x y : α), x y x y)A = B

@[simp]
def order.​preimage {α : Sort u_1} {β : Sort u_2} :
(α → β)(β → β → Prop)α → α → Prop

Given a relation R on β and a function f : α → β, the preimage relation on α is defined by x ≤ y ↔ f x ≤ f y. It is the unique relation on α making f a rel_embedding (assuming f is injective).

Equations
@[instance]
def order.​preimage.​decidable {α : Sort u_1} {β : Sort u_2} (f : α → β) (s : β → β → Prop) [H : decidable_rel s] :

The preimage of a decidable order is decidable.

Equations
def monotone {α : Type u} {β : Type v} [preorder α] [preorder β] :
(α → β) → Prop

A function between preorders is monotone if a ≤ b implies f a ≤ f b.

Equations
theorem monotone_id {α : Type u} [preorder α] :

theorem monotone_const {α : Type u} {β : Type v} [preorder α] [preorder β] {b : β} :
monotone (λ (a : α), b)

theorem monotone.​comp {α : Type u} {β : Type v} {γ : Type w} [preorder α] [preorder β] [preorder γ] {g : β → γ} {f : α → β} :
monotone gmonotone fmonotone (g f)

theorem monotone.​iterate {α : Type u} [preorder α] {f : α → α} (hf : monotone f) (n : ) :

theorem monotone_of_monotone_nat {α : Type u} [preorder α] {f : → α} :
(∀ (n : ), f n f (n + 1))monotone f

theorem reflect_lt {α : Type u_1} {β : Type u_2} [linear_order α] [preorder β] {f : α → β} (hf : monotone f) {x x' : α} :
f x < f x'x < x'

def strict_mono {α : Type u} {β : Type v} [has_lt α] [has_lt β] :
(α → β) → Prop

A function f is strictly monotone if a < b implies f a < f b.

Equations
theorem strict_mono_id {α : Type u} [has_lt α] :

def strict_mono_incr_on {α : Type u} {β : Type v} [has_lt α] [has_lt β] :
(α → β)set α → Prop

A function f is strictly monotone increasing on t if x < y for x,y ∈ t implies f x < f y.

Equations
def strict_mono_decr_on {α : Type u} {β : Type v} [has_lt α] [has_lt β] :
(α → β)set α → Prop

A function f is strictly monotone decreasing on t if x < y for x,y ∈ t implies f y < f x.

Equations
theorem strict_mono.​comp {α : Type u} {β : Type v} {γ : Type w} [has_lt α] [has_lt β] [has_lt γ] {g : β → γ} {f : α → β} :

theorem strict_mono.​iterate {α : Type u} [has_lt α] {f : α → α} (hf : strict_mono f) (n : ) :

theorem strict_mono.​id_le {φ : } (h : strict_mono φ) (n : ) :
n φ n

theorem strict_mono.​lt_iff_lt {α : Type u} {β : Type v} [linear_order α] [preorder β] {f : α → β} (H : strict_mono f) {a b : α} :
f a < f b a < b

theorem strict_mono.​injective {α : Type u} {β : Type v} [linear_order α] [preorder β] {f : α → β} :

theorem strict_mono.​compares {α : Type u} {β : Type v} [linear_order α] [preorder β] {f : α → β} (H : strict_mono f) {a b : α} {o : ordering} :
o.compares (f a) (f b) o.compares a b

theorem strict_mono.​le_iff_le {α : Type u} {β : Type v} [linear_order α] [preorder β] {f : α → β} (H : strict_mono f) {a b : α} :
f a f b a b

theorem strict_mono.​nat {β : Type u_1} [preorder β] {f : → β} :
(∀ (n : ), f n < f (n + 1))strict_mono f

theorem strict_mono.​monotone {α : Type u} {β : Type v} [partial_order α] [preorder β] {f : α → β} :

theorem injective_of_lt_imp_ne {α : Type u} {β : Type v} [linear_order α] {f : α → β} :
(∀ (x y : α), x < yf x f y)function.injective f

theorem strict_mono_of_monotone_of_injective {α : Type u} {β : Type v} [partial_order α] [partial_order β] {f : α → β} :

theorem strict_mono_of_le_iff_le {α : Type u} {β : Type v} [preorder α] [preorder β] {f : α → β} :
(∀ (x y : α), x y f x f y)strict_mono f

def order_dual  :
Type u_1Type u_1

Type tag for a set with dual order: means and < means >.

Equations
@[instance]
def order_dual.​nonempty (α : Type u_1) [h : nonempty α] :

Equations
  • _ = h
@[instance]
def order_dual.​has_le (α : Type u_1) [has_le α] :

Equations
@[instance]
def order_dual.​has_lt (α : Type u_1) [has_lt α] :

Equations
theorem order_dual.​dual_le {α : Type u} [has_le α] {a b : α} :
a b b a

theorem order_dual.​dual_lt {α : Type u} [has_lt α] {a b : α} :
a < b b < a

@[instance]
def order_dual.​preorder (α : Type u_1) [preorder α] :

Equations
@[instance]

Equations
@[instance]
def order_dual.​inhabited {α : Type u} [inhabited α] :

Equations
@[instance]
def pi.​preorder {ι : Type u} {α : ι → Type v} [Π (i : ι), preorder (α i)] :
preorder (Π (i : ι), α i)

Equations
@[instance]
def pi.​partial_order {ι : Type u} {α : ι → Type v} [Π (i : ι), partial_order (α i)] :
partial_order (Π (i : ι), α i)

Equations
theorem comp_le_comp_left_of_monotone {α : Type u} {β : Type v} {γ : Type w} [preorder α] [preorder β] {f : β → α} {g h : γ → β} :
monotone fg hf g f h

theorem monotone.​order_dual {α : Type u} {γ : Type w} [preorder α] [preorder γ] {f : α → γ} :

theorem monotone_lam {α : Type u} {β : Type v} {γ : Type w} [preorder α] [preorder γ] {f : α → β → γ} :
(∀ (b : β), monotone (λ (a : α), f a b))monotone f

theorem monotone_app {α : Type u} {β : Type v} {γ : Type w} [preorder α] [preorder γ] (f : β → α → γ) (b : β) :
monotone (λ (a : α) (b : β), f b a)monotone (f b)

theorem strict_mono.​order_dual {α : Type u} {β : Type v} [has_lt α] [has_lt β] {f : α → β} :

def preorder.​lift {α : Type u_1} {β : Type u_2} [preorder β] :
(α → β)preorder α

Transfer a preorder on β to a preorder on α using a function f : α → β.

Equations
def partial_order.​lift {α : Type u_1} {β : Type u_2} [partial_order β] (f : α → β) :

Transfer a partial_order on β to a partial_order on α using an injective function f : α → β.

Equations
def linear_order.​lift {α : Type u_1} {β : Type u_2} [linear_order β] (f : α → β) :

Transfer a linear_order on β to a linear_order on α using an injective function f : α → β.

Equations
def decidable_linear_order.​lift {α : Type u_1} {β : Type u_2} [decidable_linear_order β] (f : α → β) :

Transfer a decidable_linear_order on β to a decidable_linear_order on α using an injective function f : α → β.

Equations
@[instance]
def subtype.​preorder {α : Type u_1} [preorder α] (p : α → Prop) :

Equations
@[instance]
def prod.​has_le (α : Type u) (β : Type v) [has_le α] [has_le β] :
has_le × β)

Equations
@[instance]
def prod.​preorder (α : Type u) (β : Type v) [preorder α] [preorder β] :
preorder × β)

Equations
@[instance]
def prod.​partial_order (α : Type u) (β : Type v) [partial_order α] [partial_order β] :

The pointwise partial order on a product. (The lexicographic ordering is defined in order/lexicographic.lean, and the instances are available via the type synonym lex α β = α × β.)

Equations

Additional order classes

@[class]
structure no_top_order (α : Type u) [preorder α] :
Prop
  • no_top : ∀ (a : α), ∃ (a' : α), a < a'

order without a top element; somtimes called cofinal

Instances
theorem no_top {α : Type u} [preorder α] [no_top_order α] (a : α) :
∃ (a' : α), a < a'

@[instance]
def nonempty_gt {α : Type u} [preorder α] [no_top_order α] (a : α) :
nonempty {x // a < x}

Equations
  • _ = _
@[class]
structure no_bot_order (α : Type u) [preorder α] :
Prop
  • no_bot : ∀ (a : α), ∃ (a' : α), a' < a

order without a bottom element; somtimes called coinitial or dense

Instances
theorem no_bot {α : Type u} [preorder α] [no_bot_order α] (a : α) :
∃ (a' : α), a' < a

@[instance]

Equations
  • _ = _
@[instance]

Equations
  • _ = _
@[instance]
def nonempty_lt {α : Type u} [preorder α] [no_bot_order α] (a : α) :
nonempty {x // x < a}

Equations
  • _ = _
@[class]
structure densely_ordered (α : Type u) [preorder α] :
Prop
  • dense : ∀ (a₁ a₂ : α), a₁ < a₂(∃ (a : α), a₁ < a a < a₂)

An order is dense if there is an element between any pair of distinct elements.

Instances
theorem dense {α : Type u} [preorder α] [densely_ordered α] {a₁ a₂ : α} :
a₁ < a₂(∃ (a : α), a₁ < a a < a₂)

@[instance]

Equations
  • _ = _
theorem le_of_forall_le_of_dense {α : Type u} [linear_order α] [densely_ordered α] {a₁ a₂ : α} :
(∀ (a₃ : α), a₃ > a₂a₁ a₃)a₁ a₂

theorem eq_of_le_of_forall_le_of_dense {α : Type u} [linear_order α] [densely_ordered α] {a₁ a₂ : α} :
a₂ a₁(∀ (a₃ : α), a₃ > a₂a₁ a₃)a₁ = a₂

theorem le_of_forall_ge_of_dense {α : Type u} [linear_order α] [densely_ordered α] {a₁ a₂ : α} :
(∀ (a₃ : α), a₃ < a₁a₃ a₂)a₁ a₂

theorem eq_of_le_of_forall_ge_of_dense {α : Type u} [linear_order α] [densely_ordered α] {a₁ a₂ : α} :
a₂ a₁(∀ (a₃ : α), a₃ < a₁a₃ a₂)a₁ = a₂

theorem dense_or_discrete {α : Type u} [linear_order α] (a₁ a₂ : α) :
(∃ (a : α), a₁ < a a < a₂) (∀ (a : α), a > a₁a₂ a) ∀ (a : α), a < a₂a a₁