Skip to content
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

refactor: FunInd overhaul #4789

Merged
merged 20 commits into from
Jul 21, 2024
Merged

refactor: FunInd overhaul #4789

merged 20 commits into from
Jul 21, 2024

Conversation

nomeata
Copy link
Collaborator

@nomeata nomeata commented Jul 19, 2024

This refactoring PR changes the structure of the FunInd module, with the main purpose to make it easier to support mutual structural recursion.

In particular the recursive calls are now longer recognized by their terms (simple for well-founded recursion, .app oldIH [arg, proof], but tedious for structural recursion and even more so for mutual structural recursion), but the type after replacing oldIH with newIH, where the type will be simply and plainly mkAppN motive args).

We also no longer try to guess whether we deal with well-founded or structural recursion but instead rely on the EqnInfo environment extensions. The previous code tried to handle both variants, but they differ too much, so having separate top-level functions is easier.

This also fuses the foldCalls and collectIHs traversals and introduces a suitable monad for collecting the inductive hypotheses.

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc July 19, 2024 13:34 Inactive
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jul 19, 2024
@leodemoura leodemoura force-pushed the master branch 2 times, most recently from 32d60c5 to 696f70b Compare July 20, 2024 02:58
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc July 21, 2024 12:49 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jul 21, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jul 21, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Jul 21, 2024

Mathlib CI status (docs):

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jul 21, 2024
@nomeata nomeata marked this pull request as ready for review July 21, 2024 14:35
@nomeata nomeata requested a review from leodemoura as a code owner July 21, 2024 14:35
@nomeata nomeata enabled auto-merge July 21, 2024 14:36
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc July 21, 2024 14:41 Inactive
@nomeata nomeata added this pull request to the merge queue Jul 21, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jul 21, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jul 21, 2024
Merged via the queue into master with commit 22ae04f Jul 21, 2024
14 checks passed
@nomeata nomeata deleted the joachim/funind-refactor branch July 21, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants