-
Notifications
You must be signed in to change notification settings - Fork 449
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
feat: enable recursive structure
command
#5783
Conversation
Mathlib CI status (docs):
|
I want to try putting the breaks on this, at least as far as the kernel is concerned. The kernel notion of |
@digama0 This is not touching the kernel. This is just making it possible to use the Edit: This is certainly stress-testing mkProjections though. Something I'm considering is also having |
So maybe the title could be “feat: structure syntax in mutual datatype definitions” |
If this feature is added, I would hope it can be toggled. I sometimes use |
No objections.
By the way, the thing I'm most specifically worried about is the overloaded meaning of |
@digama0 Isn't the kernel only using Notice that I did not change |
2333b8d
to
6d18f31
Compare
a2297fa
to
c456c93
Compare
12baae1
to
11d198b
Compare
The kernel supports primitive projections for all inductive types with one construtor. The elaborator was assuming primitive projections only work for "structure-likes", non-recursive inductive types with no indices. Enables numeric projection notation for general one-constructor inductives. Extracted from leanprover#5783.
11d198b
to
2844bfb
Compare
The kernel supports primitive projections for all inductive types with one construtor. The elaborator was assuming primitive projections only work for "structure-likes", non-recursive inductive types with no indices. Enables numeric projection notation for general one-constructor inductives. Extracted from leanprover#5783.
The kernel supports primitive projections for all inductive types with one construtor. The elaborator was assuming primitive projections only work for "structure-likes", non-recursive inductive types with no indices. Enables numeric projection notation for general one-constructor inductives. Extracted from leanprover#5783.
…5822) The kernel supports primitive projections for all inductive types with one construtor. The elaborator was assuming primitive projections only work for "structure-likes", non-recursive inductive types with no indices. Enables numeric projection notation for general one-constructor inductives. Extracted from #5783.
2844bfb
to
7053189
Compare
structure
commandstructure
command
Thanks to leanprover/lean4#5783, we now have recursive structure commands, which trips the inference into constructing a recursive struct. Therefore, we disambiguate the fields in `Cli.Parsed.Flag` to explicitly refer to `Cli.Flag`. Discovered when bumping toolchain to nightly in leanprover/LNSym#244.
Thanks to leanprover/lean4#5783, we now have recursive structure commands, which trips the inference into constructing a recursive struct. Therefore, we disambiguate the fields in `Cli.Parsed.Flag` to explicitly refer to `Cli.Flag`. Discovered when bumping toolchain to nightly in leanprover/LNSym#244.
Now that the elaborator supports primitive projections for recursive inductive types (#5822), enable defining recursive inductive types with the
structure
command, which was set up in #5842.Example:
Note for kernel re-implementors: recursive structures are exercising the kernel feature where primitive projections are valid for one-constructor inductive types in general, so long as the structure isn't a
Prop
and doesn't have any non-Prop
fields, not just ones that are non-indexed and non-recursive.Closes #2512