# mathlibdocumentation

data.set.intervals.unordered_interval

# Intervals without endpoints ordering

In any decidable linear order α, we define the set of elements lying between two elements a and b as Icc (min a b) (max a b).

Icc a b requires the assumption a ≤ b to be meaningful, which is sometimes inconvenient. The interval as defined in this file is always the set of things lying between a and b, regardless of the relative order of a and b.

For real numbers, Icc (min a b) (max a b) is the same as segment a b.

## Notation

We use the localized notation [a, b] for interval a b. One can open the locale interval to make the notation available.

def set.interval {α : Type u}  :
α → α → set α

interval a b is the set of elements lying between a and b, with a and b included.

Equations
@[simp]
theorem set.interval_of_le {α : Type u} {a b : α} :
a b b = b

@[simp]
theorem set.interval_of_ge {α : Type u} {a b : α} :
b a b = a

theorem set.interval_swap {α : Type u} (a b : α) :
b = a

theorem set.interval_of_lt {α : Type u} {a b : α} :
a < b b = b

theorem set.interval_of_gt {α : Type u} {a b : α} :
b < a b = a

theorem set.interval_of_not_le {α : Type u} {a b : α} :
¬a b b = a

theorem set.interval_of_not_ge {α : Type u} {a b : α} :
¬b a b = b

@[simp]
theorem set.interval_self {α : Type u} {a : α} :
a = {a}

@[simp]
theorem set.nonempty_interval {α : Type u} {a b : α} :

@[simp]
theorem set.left_mem_interval {α : Type u} {a b : α} :
a b

@[simp]
theorem set.right_mem_interval {α : Type u} {a b : α} :
b b

theorem set.Icc_subset_interval {α : Type u} {a b : α} :
b b

theorem set.Icc_subset_interval' {α : Type u} {a b : α} :
a b

theorem set.mem_interval_of_le {α : Type u} {a b x : α} :
a xx bx b

theorem set.mem_interval_of_ge {α : Type u} {a b x : α} :
b xx ax b

theorem set.interval_subset_interval {α : Type u} {a₁ a₂ b₁ b₂ : α} :
a₁ b₂b₁ b₂ b₁ b₂

theorem set.interval_subset_interval_iff_mem {α : Type u} {a₁ a₂ b₁ b₂ : α} :
b₁ b₂ a₁ b₂ b₁ b₂

theorem set.interval_subset_interval_iff_le {α : Type u} {a₁ a₂ b₁ b₂ : α} :
b₁ b₂ min a₂ b₂ min a₁ b₁ max a₁ b₁ max a₂ b₂

theorem set.interval_subset_interval_right {α : Type u} {a b x : α} :
x b b b

theorem set.interval_subset_interval_left {α : Type u} {a b x : α} :
x b x b

theorem set.bdd_below_bdd_above_iff_subset_interval {α : Type u} (s : set α) :
∃ (a b : α), s b

@[simp]
theorem set.preimage_const_add_interval {α : Type u} (a b c : α) :
(λ (x : α), a + x) ⁻¹' c = set.interval (b - a) (c - a)

@[simp]
theorem set.preimage_add_const_interval {α : Type u} (a b c : α) :
(λ (x : α), x + a) ⁻¹' c = set.interval (b - a) (c - a)

@[simp]
theorem set.preimage_neg_interval {α : Type u} (a b : α) :
- b = (-b)

@[simp]
theorem set.preimage_sub_const_interval {α : Type u} (a b c : α) :
(λ (x : α), x - a) ⁻¹' c = set.interval (b + a) (c + a)

@[simp]
theorem set.preimage_const_sub_interval {α : Type u} (a b c : α) :
(λ (x : α), a - x) ⁻¹' c = set.interval (a - b) (a - c)

@[simp]
theorem set.image_const_add_interval {α : Type u} (a b c : α) :
(λ (x : α), a + x) '' c = set.interval (a + b) (a + c)

@[simp]
theorem set.image_add_const_interval {α : Type u} (a b c : α) :
(λ (x : α), x + a) '' c = set.interval (b + a) (c + a)

@[simp]
theorem set.image_const_sub_interval {α : Type u} (a b c : α) :
(λ (x : α), a - x) '' c = set.interval (a - b) (a - c)

@[simp]
theorem set.image_sub_const_interval {α : Type u} (a b c : α) :
(λ (x : α), x - a) '' c = set.interval (b - a) (c - a)

theorem set.image_neg_interval {α : Type u} (a b : α) :
= (-b)

theorem set.abs_sub_le_of_subinterval {α : Type u} {a b x y : α} :
y babs (y - x) abs (b - a)

If [x, y] is a subinterval of [a, b], then the distance between x and y is less than or equal to that of a and b

theorem set.abs_sub_left_of_mem_interval {α : Type u} {a b x : α} :
x babs (x - a) abs (b - a)

If x ∈ [a, b], then the distance between a and x is less than or equal to that of a and b

theorem set.abs_sub_right_of_mem_interval {α : Type u} {a b x : α} :
x babs (b - x) abs (b - a)

If x ∈ [a, b], then the distance between x and b is less than or equal to that of a and b

@[simp]
theorem set.preimage_mul_const_interval {k : Type u} {a : k} (ha : a 0) (b c : k) :
(λ (x : k), x * a) ⁻¹' c = set.interval (b / a) (c / a)

@[simp]
theorem set.preimage_const_mul_interval {k : Type u} {a : k} (ha : a 0) (b c : k) :
(λ (x : k), a * x) ⁻¹' c = set.interval (b / a) (c / a)

@[simp]
theorem set.preimage_div_const_interval {k : Type u} {a : k} (ha : a 0) (b c : k) :
(λ (x : k), x / a) ⁻¹' c = set.interval (b * a) (c * a)

@[simp]
theorem set.image_mul_const_interval {k : Type u} (a b c : k) :
(λ (x : k), x * a) '' c = set.interval (b * a) (c * a)

@[simp]
theorem set.image_const_mul_interval {k : Type u} (a b c : k) :
(λ (x : k), a * x) '' c = set.interval (a * b) (a * c)

@[simp]
theorem set.image_div_const_interval {k : Type u} (a b c : k) :
(λ (x : k), x / a) '' c = set.interval (b / a) (c / a)