Skip to content

feat: unify equational theorems between wf and structural recursion - #5055

Merged
nomeata merged 2 commits into
masterfrom
joachim/split-structural-eqns-deeper
Aug 19, 2024
Merged

nomeata merged 2 commits into
masterfrom
joachim/split-structural-eqns-deeper

Conversation

@nomeata

@nomeata nomeata commented Aug 15, 2024

Copy link
Copy Markdown
Collaborator

by removing the tryRefl variation between the two.

Part of #3983

@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 Aug 15, 2024
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Aug 15, 2024
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Aug 15, 2024
@github-actions
github-actions Bot temporarily deployed to lean-lang.org/lean4/doc August 15, 2024 14:19 Inactive
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Aug 15, 2024
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Aug 15, 2024
@ghost

ghost commented Aug 15, 2024 •

Copy link
Copy Markdown

Mathlib CI status (docs):

@ghost ghost added the builds-mathlib CI has verified that Mathlib builds against this PR label Aug 15, 2024
@nomeata
nomeata marked this pull request as ready for review August 15, 2024 16:02
@nomeata

nomeata commented Aug 15, 2024

Copy link
Copy Markdown
Collaborator Author

This was easier than expected.

@nomeata nomeata added the will-merge-soon …unless someone speaks up label Aug 15, 2024
@nomeata
nomeata added this pull request to the merge queue Aug 19, 2024
Merged via the queue into master with commit b4db495 Aug 19, 2024
nomeata added a commit that referenced this pull request Aug 22, 2024
This is part of #3983.

After #4154 introduced equational lemmas for non-recursive functions and #5055
unififed the lemmas for structural and wf recursive funcitons, this now
disables the special handling of recursive functions in
`findMatchToSplit?`, so that the equational lemmas should be the same no
matter how the function was defined.

The new option `eqns.deepRecursiveSplit` can be disabled to get the old
behavior.

This can break existing code, as there now can be extra equational
lemmas:

* Explicit uses of `f.eq_2` might have to be adjusted if the numbering
  changed.

* Uses of `rw [f]` or `simp [f]` may no longer apply if they previously
  matched (and introduced a `match` statement), when the equational
  lemmas got more fine-grained.

  In this case either case analysis on the parameters before rewriting
  helps, or setting the option `opt.deepRecursiveSplit false` while
  defining the function
github-merge-queue Bot pushed a commit that referenced this pull request Aug 25, 2024
#5129)

This is part of #3983.

After #4154 introduced equational lemmas for non-recursive functions and
#5055
unififed the lemmas for structural and wf recursive funcitons, this now
disables the special handling of recursive functions in
`findMatchToSplit?`, so that the equational lemmas should be the same no
matter how the function was defined.

The new option `eqns.deepRecursiveSplit` can be disabled to get the old
behavior.

### Breaking change

This can break existing code, as there now can be extra equational
lemmas:

* Explicit uses of `f.eq_2` might have to be adjusted if the numbering
  changed.

* Uses of `rw [f]` or `simp [f]` may no longer apply if they previously
  matched (and introduced a `match` statement), when the equational
  lemmas got more fine-grained.

  In this case either case analysis on the parameters before rewriting
  helps, or setting the option `opt.deepRecursiveSplit false` while
  defining the function
tobiasgrosser pushed a commit to opencompl/lean4 that referenced this pull request Aug 26, 2024
leanprover#5129)

This is part of leanprover#3983.

After leanprover#4154 introduced equational lemmas for non-recursive functions and
leanprover#5055
unififed the lemmas for structural and wf recursive funcitons, this now
disables the special handling of recursive functions in
`findMatchToSplit?`, so that the equational lemmas should be the same no
matter how the function was defined.

The new option `eqns.deepRecursiveSplit` can be disabled to get the old
behavior.

### Breaking change

This can break existing code, as there now can be extra equational
lemmas:

* Explicit uses of `f.eq_2` might have to be adjusted if the numbering
  changed.

* Uses of `rw [f]` or `simp [f]` may no longer apply if they previously
  matched (and introduced a `match` statement), when the equational
  lemmas got more fine-grained.

  In this case either case analysis on the parameters before rewriting
  helps, or setting the option `opt.deepRecursiveSplit false` while
  defining the function

This branch was previously deployed

1 inactive deployment
lean-lang.org/lean4/doc — 4d810041 Deployed Aug 15, 2024 by github-actions[bot]
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 will-merge-soon …unless someone speaks up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant