Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: images of intervals under
(↑) : ℕ → ℤ
(#9927)
Also generalize `IsUpperSet.Ioi_subset` and `IsLowerSet.Iio_subset` from a `PartialOrder` to a `Preorder`.
- Loading branch information
Showing
3 changed files
with
76 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/- | ||
Copyright (c) 2024 Yury Kudryashov. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Yury Kudryashov | ||
-/ | ||
import Mathlib.Data.Nat.Cast.Order | ||
import Mathlib.Data.Int.Order.Basic | ||
import Mathlib.Order.UpperLower.Basic | ||
|
||
/-! | ||
# Images of intervals under `Nat.cast : ℕ → ℤ` | ||
In this file we prove that the image of each `Set.Ixx` interval under `Nat.cast : ℕ → ℤ` | ||
is the corresponding interval in `ℤ`. | ||
-/ | ||
|
||
open Set | ||
|
||
namespace Nat | ||
|
||
@[simp] | ||
theorem range_cast_int : range ((↑) : ℕ → ℤ) = Ici 0 := | ||
Subset.antisymm (range_subset_iff.2 Int.ofNat_nonneg) CanLift.prf | ||
|
||
theorem image_cast_int_Icc (a b : ℕ) : (↑) '' Icc a b = Icc (a : ℤ) b := | ||
(castOrderEmbedding (α := ℤ)).image_Icc (by simp [ordConnected_Ici]) a b | ||
|
||
theorem image_cast_int_Ico (a b : ℕ) : (↑) '' Ico a b = Ico (a : ℤ) b := | ||
(castOrderEmbedding (α := ℤ)).image_Ico (by simp [ordConnected_Ici]) a b | ||
|
||
theorem image_cast_int_Ioc (a b : ℕ) : (↑) '' Ioc a b = Ioc (a : ℤ) b := | ||
(castOrderEmbedding (α := ℤ)).image_Ioc (by simp [ordConnected_Ici]) a b | ||
|
||
theorem image_cast_int_Ioo (a b : ℕ) : (↑) '' Ioo a b = Ioo (a : ℤ) b := | ||
(castOrderEmbedding (α := ℤ)).image_Ioo (by simp [ordConnected_Ici]) a b | ||
|
||
theorem image_cast_int_Iic (a : ℕ) : (↑) '' Iic a = Icc (0 : ℤ) a := by | ||
rw [← Icc_bot, image_cast_int_Icc]; rfl | ||
|
||
theorem image_cast_int_Iio (a : ℕ) : (↑) '' Iio a = Ico (0 : ℤ) a := by | ||
rw [← Ico_bot, image_cast_int_Ico]; rfl | ||
|
||
theorem image_cast_int_Ici (a : ℕ) : (↑) '' Ici a = Ici (a : ℤ) := | ||
(castOrderEmbedding (α := ℤ)).image_Ici (by simp [isUpperSet_Ici]) a | ||
|
||
theorem image_cast_int_Ioi (a : ℕ) : (↑) '' Ioi a = Ioi (a : ℤ) := | ||
(castOrderEmbedding (α := ℤ)).image_Ioi (by simp [isUpperSet_Ici]) a | ||
|
||
end Nat |
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