-
Notifications
You must be signed in to change notification settings - Fork 297
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/equiv/encodable): ulower
lowers countable types to Type 0
#2574
Conversation
I plan to use this type to refactor the many-one degrees so that there is only one |
ulower
lowers countable types to Type 0
|
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.
LGTM
bors r+
…0` (#2574) Given a type `α : Type u`, we can lift it into a higher universe using `ulift α : Type (max u v)`. This PR introduces an analogous construction going in the other direction. Given an encodable (= countable) type `α : Type u`, we can lower it to the very bottom using `ulower α : Type 0`. The equivalence is primitive recursive if the type is primcodable. The definition of the equivalence was already present as `encodable.equiv_range_encode`. However it is very inconvenient to use since it requires decidability instances (`encodable.decidable_range_encode`) that are not enabled by default because they would introduce overlapping instances that are not definitionally equal.
Pull request successfully merged into master. Build succeeded: |
ulower
lowers countable types to Type 0
ulower
lowers countable types to Type 0
…0` (leanprover-community#2574) Given a type `α : Type u`, we can lift it into a higher universe using `ulift α : Type (max u v)`. This PR introduces an analogous construction going in the other direction. Given an encodable (= countable) type `α : Type u`, we can lower it to the very bottom using `ulower α : Type 0`. The equivalence is primitive recursive if the type is primcodable. The definition of the equivalence was already present as `encodable.equiv_range_encode`. However it is very inconvenient to use since it requires decidability instances (`encodable.decidable_range_encode`) that are not enabled by default because they would introduce overlapping instances that are not definitionally equal.
…0` (leanprover-community#2574) Given a type `α : Type u`, we can lift it into a higher universe using `ulift α : Type (max u v)`. This PR introduces an analogous construction going in the other direction. Given an encodable (= countable) type `α : Type u`, we can lower it to the very bottom using `ulower α : Type 0`. The equivalence is primitive recursive if the type is primcodable. The definition of the equivalence was already present as `encodable.equiv_range_encode`. However it is very inconvenient to use since it requires decidability instances (`encodable.decidable_range_encode`) that are not enabled by default because they would introduce overlapping instances that are not definitionally equal.
…eter (#2630) The file `reduce.lean` defines many-one degrees for computable reductions. At the moment every primcodable type `α` has a separate type of degrees `many_one_degree α`. This is completely antithetical to the notion of degrees, which are introduced to classify problems up to many-one equivalence. This PR defines a single `many_one_degree` type that lives in `Type 0`. We use the `ulower` infrastructure from #2574 which shows that every type is computably equivalent to a subset of natural numbers. The function `many_one_degree.of` which assigns to every set of a primcodable type a degree is still universe polymorphic. In particular, we show that `of p = of q ↔ many_one_equiv p q`, etc. in maximal generality, where `p` and `q` are subsets of different types in different universes. See previous discussion at #1203.
…eter (#2630) The file `reduce.lean` defines many-one degrees for computable reductions. At the moment every primcodable type `α` has a separate type of degrees `many_one_degree α`. This is completely antithetical to the notion of degrees, which are introduced to classify problems up to many-one equivalence. This PR defines a single `many_one_degree` type that lives in `Type 0`. We use the `ulower` infrastructure from #2574 which shows that every type is computably equivalent to a subset of natural numbers. The function `many_one_degree.of` which assigns to every set of a primcodable type a degree is still universe polymorphic. In particular, we show that `of p = of q ↔ many_one_equiv p q`, etc. in maximal generality, where `p` and `q` are subsets of different types in different universes. See previous discussion at #1203.
…0` (leanprover-community#2574) Given a type `α : Type u`, we can lift it into a higher universe using `ulift α : Type (max u v)`. This PR introduces an analogous construction going in the other direction. Given an encodable (= countable) type `α : Type u`, we can lower it to the very bottom using `ulower α : Type 0`. The equivalence is primitive recursive if the type is primcodable. The definition of the equivalence was already present as `encodable.equiv_range_encode`. However it is very inconvenient to use since it requires decidability instances (`encodable.decidable_range_encode`) that are not enabled by default because they would introduce overlapping instances that are not definitionally equal.
Given a type
α : Type u
, we can lift it into a higher universe usingulift α : Type (max u v)
. This PR introduces an analogous construction going in the other direction. Given an encodable (= countable) typeα : Type u
, we can lower it to the very bottom usingulower α : Type 0
. The equivalence is primitive recursive if the type is primcodable.The definition of the equivalence was already present as
encodable.equiv_range_encode
. However it is very inconvenient to use since it requires decidability instances (encodable.decidable_range_encode
) that are not enabled by default because they would introduce overlapping instances that are not definitionally equal.