Zulip Chat Archive
Stream: new members
Topic: rat.denumerable
Matt Diamond (Sep 26 2022 at 16:02):
Just curious: is there a reason why rat.denumerable is proved via an equivalence to a subtype instead of just doing of_encodable_of_infinite ℚ directly?
Matt Diamond (Sep 26 2022 at 16:05):
As far as I can tell, the only thing the subtype provides is an easy proof of encodability, but we already have encodable ℚ so it seems unnecessary.
Kyle Miller (Sep 26 2022 at 16:19):
Here's where it was introduced: https://github.com/leanprover-community/mathlib/commit/3ad35223f321e644ef3e16ae9ec5b9383b2baabe
The encodable instance uses very nearly the same subtype, but with a sigma type factored out.
Maybe you want to investigate a creating a denumerable ℚ instance that uses the encodable instance more directly?
Matt Diamond (Sep 26 2022 at 16:20):
I'm just wondering why we don't simply write instance : denumerable ℚ := of_encodable_of_infinite ℚ
Matt Diamond (Sep 26 2022 at 16:21):
are you saying that we want the denumerability encoding to be a bit different than the usual encoding?
Kyle Miller (Sep 26 2022 at 16:23):
No, I'm not meaning to imply anything, other than suggesting you could try simplifying that instance and see whether it breaks anything.
Kyle Miller (Sep 26 2022 at 16:24):
The git commit link also suggests that @Chris Hughes might have an answer.
Chris Hughes (Sep 26 2022 at 16:36):
Matt Diamond said:
I'm just wondering why we don't simply write
instance : denumerable ℚ := of_encodable_of_infinite ℚ
I think it's because there was no encodable instance for ℚ. I had to prove encodable ℚ inside the proof of denumerable ℚ.
Chris Hughes (Sep 26 2022 at 16:38):
Not sure but there might even be two different encodable instances for ℚ at the moment if there's a denumerable to encodable instance.
Matt Diamond (Sep 26 2022 at 16:42):
it looks like the encodable instance for Q was added back in October 2017
Kyle Miller (Sep 26 2022 at 16:42):
It looks like there was an encodable instance at least four years ago, and the denumerable instance was 2-3 years ago
Matt Diamond (Sep 26 2022 at 16:43):
perhaps it was just overlooked
Chris Hughes (Sep 26 2022 at 16:44):
I think I probably overlooked it.
Matt Diamond (Sep 26 2022 at 16:46):
all good
Last updated: May 02 2025 at 03:31 UTC