[Merged by Bors] - feat: order lemmas for NNRat#13547
[Merged by Bors] - feat: order lemmas for NNRat#13547eric-wieser wants to merge 7 commits intomasterfrom
Conversation
| @[simp] | ||
| theorem preimage_cast_Icc (a b : ℚ≥0) : (↑) ⁻¹' Icc (a : K) b = Icc a b := | ||
| castOrderEmbedding.preimage_Icc .. | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_Ico (a b : ℚ≥0) : (↑) ⁻¹' Ico (a : K) b = Ico a b := | ||
| castOrderEmbedding.preimage_Ico .. | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_Ioc (a b : ℚ≥0) : (↑) ⁻¹' Ioc (a : K) b = Ioc a b := | ||
| castOrderEmbedding.preimage_Ioc a b | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_Ioo (a b : ℚ≥0) : (↑) ⁻¹' Ioo (a : K) b = Ioo a b := | ||
| castOrderEmbedding.preimage_Ioo a b | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_Ici (a : ℚ≥0) : (↑) ⁻¹' Ici (a : K) = Ici a := | ||
| castOrderEmbedding.preimage_Ici a | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_Iic (a : ℚ≥0) : (↑) ⁻¹' Iic (a : K) = Iic a := | ||
| castOrderEmbedding.preimage_Iic a | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_Ioi (a : ℚ≥0) : (↑) ⁻¹' Ioi (a : K) = Ioi a := | ||
| castOrderEmbedding.preimage_Ioi a | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_Iio (a : ℚ≥0) : (↑) ⁻¹' Iio (a : K) = Iio a := | ||
| castOrderEmbedding.preimage_Iio a | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_uIcc (a b : ℚ≥0) : (↑) ⁻¹' uIcc (a : K) b = uIcc a b := | ||
| (castOrderEmbedding (K := K)).preimage_uIcc a b | ||
|
|
||
| @[simp] | ||
| theorem preimage_cast_uIoc (a b : ℚ≥0) : (↑) ⁻¹' uIoc (a : K) b = uIoc a b := | ||
| (castOrderEmbedding (K := K)).preimage_uIoc a b |
There was a problem hiding this comment.
Can we have the corresponding image lemmas for NNRat -> Rat?
There was a problem hiding this comment.
I'd claim "out of scope" here too; this PR just duplicates the existing Rat API, rather than adding new API.
Mathlib/Data/Rat/Cast/Order.lean
Outdated
| @[simp] | ||
| theorem cast_lt_zero {n : ℚ≥0} : (n : K) < 0 ↔ n < 0 := by | ||
| norm_cast |
There was a problem hiding this comment.
I'd argue that unless the linter complains, it's not!
There was a problem hiding this comment.
No but like there's no point blindly copying lemmas from one type to the other if they don't make sense for the new type. Both sides of your iff are always false, so you might as well replace it by Not LHS
There was a problem hiding this comment.
Ah, I guess the linter doesn't tell me when the RHS is further simplified.
There was a problem hiding this comment.
I've added your suggest but kept my original (without simp), because without this lemma norm_cast leaves some casts around.
| norm_cast | ||
|
|
||
| @[simp, norm_cast] | ||
| theorem cast_min {a b : ℚ≥0} : (↑(min a b) : K) = min (a : K) (b : K) := |
There was a problem hiding this comment.
| theorem cast_min {a b : ℚ≥0} : (↑(min a b) : K) = min (a : K) (b : K) := | |
| theorem cast_min (a b : ℚ≥0) : (↑(min a b) : K) = min (a : K) (b : K) := |
and below
There was a problem hiding this comment.
This is consistent with the Rat versions of the lemmas; I'd prefer to declare this out of scope too.
There was a problem hiding this comment.
I have opened #13644 to make your changes inconsistent with the Rat versions of the lemmas
There was a problem hiding this comment.
I'd appreciate it if you could push the corresponding changes to this PR once that lands; but it can wait till after your final exam!
There was a problem hiding this comment.
(or preferably, delegate this one first so that I can move on to the floorsemiring instance)
There was a problem hiding this comment.
Sure, I guess that's fixable later
maintainer merge
PR summaryImport changesDependency changes
|
|
bors r+ |
This copies the API for order lemmas on `Rat`
|
Pull request successfully merged into master. Build succeeded: |
This copies the API for order lemmas on `Rat`
This copies the API for order lemmas on
Rat