feat: infer def/theorem DefKind for let rec#1866
Merged
leodemoura merged 1 commit intoleanprover:masterfrom Nov 29, 2022
Merged
feat: infer def/theorem DefKind for let rec#1866leodemoura merged 1 commit intoleanprover:masterfrom
let rec#1866leodemoura merged 1 commit intoleanprover:masterfrom
Conversation
79e1037 to
792ee11
Compare
bors bot
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 23, 2022
mathlib3 SHA: 39af7d3bf61a98e928812dbc3e16f4ea8b795ca3 Porting notes: 1. There was a mathport "failed to parenthesize" error, but it was easily worked around, see the first commit for details. 2. I had to use `aux` declarations when constructing things recursively inside the field of a structure. I asked about this on [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/recursive.20definitions.20in.20instance.20fields) and also [here](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/recursive.20definition.20in.20structure.20fields), but so far there doesn't seem to be a better way. In any case, it compiles so it should be fine. Otherwise, this port was very smooth. 3. Because of the `aux where` (which is really `let rec aux`) this caused the `defLemma` linter to fire, which is being handled in [lean4#1866](leanprover/lean4#1866), so for now we just add these declarations to `nolints.json`; see [Zulip](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/recursive.20definitions.20in.20instance.20fields) Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
leodemoura
reviewed
Nov 28, 2022
792ee11 to
c84ff71
Compare
mathlib-bors bot
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jul 10, 2024
leanprover/lean4#1866 is merged, so this can go. Co-authored-by: Moritz Firsching <firsching@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since
let rechas no place to put thedef/theoremannotation, we have to infer it. Currently uses oflet recinside instances or defs to construct proofs will cause thedefLemmamathlib linter to trigger (this occurs in practice in mathlib, because as it turns out we were actually doinglet recin lean 3 using the_matchhack).