Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data/set/intervals/infinite): intervals are infinite (#4241)
- Loading branch information
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/- | ||
Copyright (c) 2020 Reid Barton. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Reid Barton | ||
-/ | ||
import data.set.finite | ||
|
||
/-! | ||
# Infinitude of intervals | ||
Bounded intervals in dense orders are infinite, as are unbounded intervals | ||
in orders that are unbounded on the appropriate side. | ||
-/ | ||
|
||
namespace set | ||
|
||
variables {α : Type*} [preorder α] | ||
|
||
section bounded | ||
|
||
variables [densely_ordered α] | ||
|
||
lemma Ioo.infinite {a b : α} (h : a < b) : infinite (Ioo a b) := | ||
begin | ||
rintro (f : finite (Ioo a b)), | ||
obtain ⟨m, hm₁, hm₂⟩ : ∃ m ∈ Ioo a b, ∀ x ∈ Ioo a b, ¬x < m, | ||
{ simpa [h] using finset.exists_minimal f.to_finset }, | ||
obtain ⟨z, hz₁, hz₂⟩ : ∃ z, a < z ∧ z < m := dense hm₁.1, | ||
exact hm₂ z ⟨hz₁, lt_trans hz₂ hm₁.2⟩ hz₂, | ||
end | ||
|
||
lemma Ico.infinite {a b : α} (h : a < b) : infinite (Ico a b) := | ||
infinite_mono Ioo_subset_Ico_self (Ioo.infinite h) | ||
|
||
lemma Ioc.infinite {a b : α} (h : a < b) : infinite (Ioc a b) := | ||
infinite_mono Ioo_subset_Ioc_self (Ioo.infinite h) | ||
|
||
lemma Icc.infinite {a b : α} (h : a < b) : infinite (Icc a b) := | ||
infinite_mono Ioo_subset_Icc_self (Ioo.infinite h) | ||
|
||
end bounded | ||
|
||
section unbounded_below | ||
|
||
variables [no_bot_order α] | ||
|
||
lemma Iio.infinite {b : α} : infinite (Iio b) := | ||
begin | ||
rintro (f : finite (Iio b)), | ||
obtain ⟨m, hm₁, hm₂⟩ : ∃ m < b, ∀ x < b, ¬x < m, | ||
{ simpa using finset.exists_minimal f.to_finset }, | ||
obtain ⟨z, hz⟩ : ∃ z, z < m := no_bot _, | ||
exact hm₂ z (lt_trans hz hm₁) hz | ||
end | ||
|
||
lemma Iic.infinite {b : α} : infinite (Iic b) := | ||
infinite_mono Iio_subset_Iic_self Iio.infinite | ||
|
||
end unbounded_below | ||
|
||
section unbounded_above | ||
|
||
variables [no_top_order α] | ||
|
||
lemma Ioi.infinite {a : α} : infinite (Ioi a) := | ||
by apply @Iio.infinite (order_dual α) | ||
|
||
lemma Ici.infinite {a : α} : infinite (Ici a) := | ||
infinite_mono Ioi_subset_Ici_self Ioi.infinite | ||
|
||
end unbounded_above | ||
|
||
end set |