New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - feat(data/real/cardinality): cardinalities of intervals of reals #3252
Conversation
Use the existing result `not_countable_real` to deduce corresponding results for all eight kinds of intervals of reals. It's convenient for this result to add a new lemma to `data.set.intervals.image_preimage' about the image of an interval under `inv`. Just as there are only a few results there about images of intervals under multiplication rather than a full set, so I just added the result I needed rather than all the possible variants. (I think there are something like 36 reasonable variants of that lemma that could be stated, for (image or preimage - the same thing in this case, but still separate statements) x (interval in positive or negative reals) x (end closer to 0 is 0 (open), nonzero (open) or nonzero (closed)) x (other end is open, closed or infinite).)
It would be nice to have |
|
The |
Can't you use Cantor–Bernstein? You need to build an injection from |
There are plenty of possible ways of proving it, including building up some arbitrary injection piecewise using |
The API for cardinalities is also pretty good. There is (in the |
Thanks for the hints. I've converted the changes to prove cardinalities rather than "not countable", with the same proof structure. ( |
LGTM |
/-- The cardinality of the interval (a, ∞). -/ | ||
lemma mk_real_Ioi (a : ℝ) : mk (Ioi a) = 2 ^ omega.{0} := | ||
begin | ||
refine le_antisymm (mk_real ▸ mk_set_le _) _, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a tip, I don't care if you change it in this PR:
I personally tend to always avoid ▸
; it's a weaker version of rw
, and in some cases more brittle (although that is also me as a Lean 2 user talking; since the behavior of ▸
was a lot more unpredictable in Lean 2, and proofs could easily break with sequences of these substitutions).
In this case I think you can do:
refine le_antisymm _ _, { rw mk_real, exact mk_set_le _ }
I don't mind if you don't change it in this PR: I don't think it's an actual style guide, and all use cases are single line proof terms in this PR.
bors d+ feel free to merge this after the name changes. Thanks for changing this to actual cardinal computations! |
✌️ jsm28 can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
Use the existing result `mk_real` to deduce corresponding results for all eight kinds of intervals of reals. It's convenient for this result to add a new lemma to `data.set.intervals.image_preimage` about the image of an interval under `inv`. Just as there are only a few results there about images of intervals under multiplication rather than a full set, so I just added the result I needed rather than all the possible variants. (I think there are something like 36 reasonable variants of that lemma that could be stated, for (image or preimage - the same thing in this case, but still separate statements) x (interval in positive or negative reals) x (end closer to 0 is 0 (open), nonzero (open) or nonzero (closed)) x (other end is open, closed or infinite).)
Pull request successfully merged into master. Build succeeded: |
…nprover-community#3252) Use the existing result `mk_real` to deduce corresponding results for all eight kinds of intervals of reals. It's convenient for this result to add a new lemma to `data.set.intervals.image_preimage` about the image of an interval under `inv`. Just as there are only a few results there about images of intervals under multiplication rather than a full set, so I just added the result I needed rather than all the possible variants. (I think there are something like 36 reasonable variants of that lemma that could be stated, for (image or preimage - the same thing in this case, but still separate statements) x (interval in positive or negative reals) x (end closer to 0 is 0 (open), nonzero (open) or nonzero (closed)) x (other end is open, closed or infinite).)
Use the existing result
mk_real
to deduce corresponding results forall eight kinds of intervals of reals.
It's convenient for this result to add a new lemma to
data.set.intervals.image_preimage
about the image of an intervalunder
inv
. Just as there are only a few results there about imagesof intervals under multiplication rather than a full set, so I just
added the result I needed rather than all the possible variants. (I
think there are something like 36 reasonable variants of that lemma
that could be stated, for (image or preimage - the same thing in this
case, but still separate statements) x (interval in positive or
negative reals) x (end closer to 0 is 0 (open), nonzero (open) or
nonzero (closed)) x (other end is open, closed or infinite).)