[Merged by Bors] - chore: remove no-longer-needed Nat.digits workarounds#10429
Closed
[Merged by Bors] - chore: remove no-longer-needed Nat.digits workarounds#10429
Conversation
dwrensha
commented
Feb 11, 2024
| -- manually rewrite with `Nat.digits_of_two_le_of_pos` first. | ||
| rw [Nat.digits_of_two_le_of_pos (by norm_num) (by norm_num)] | ||
| norm_num <;> decide) | ||
| (by norm_num <;> decide) |
Member
Author
There was a problem hiding this comment.
on master:
[Elab.command] [3.090407s] theorem right_direction
after this change:
[Elab.command] [2.878866s] theorem right_direction
dwrensha
commented
Feb 11, 2024
| theorem left_direction (n : ℕ) (spn : SolutionPredicate n) : ProblemPredicate n := by | ||
| -- Porting note: This is very slow | ||
| rcases spn with (rfl | rfl) <;> refine' ⟨_, by decide, _⟩ <;> rfl | ||
| rcases spn with (rfl | rfl) <;> refine' ⟨_, by decide, _⟩ <;> norm_num <;> rfl |
Member
Author
There was a problem hiding this comment.
on master:
[Elab.command] [13.806512s] theorem left_direction
after this change:
[Elab.command] [0.087602s] theorem left_direction
dwrensha
commented
Feb 11, 2024
| rw [Nat.digits_of_two_le_of_pos two_le_ten (by norm_num)] | ||
| rw [Nat.digits_of_two_le_of_pos two_le_ten (by norm_num)] | ||
| norm_num | ||
| norm_num [ProblemPredicate] |
Member
Author
There was a problem hiding this comment.
on master:
[Elab.command] [0.058644s] theorem satisfied_by_153846
after this change:
[Elab.command] [0.059744s] theorem satisfied_by_153846
(within measurement noise of each other)
This was referenced Feb 11, 2024
mathlib-bors bot
pushed a commit
that referenced
this pull request
Feb 13, 2024
`norm_num` now successfully reduces `Nat.digits` calls that have concrete arguments, so we can clean up some old workarounds.
This all works because Lean 4.6.0 introduced "simprocs", including the default-enabled `reduceLE`, `reduceMod`, `reduceDiv`, etc. which `norm_num` can invoke to discharge the side-goals required by applications of `digits_of_two_le_of_pos`.
Another crucial aspect is that `{ decide := false }` is the default for `simp` (and `norm_num`) after #8366. Otherwise,
the `Acc`-based recursion in `digitsAux` would bog down kernel reduction.
Contributor
|
This PR was included in a batch that was canceled, it will be automatically retried |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Feb 13, 2024
`norm_num` now successfully reduces `Nat.digits` calls that have concrete arguments, so we can clean up some old workarounds.
This all works because Lean 4.6.0 introduced "simprocs", including the default-enabled `reduceLE`, `reduceMod`, `reduceDiv`, etc. which `norm_num` can invoke to discharge the side-goals required by applications of `digits_of_two_le_of_pos`.
Another crucial aspect is that `{ decide := false }` is the default for `simp` (and `norm_num`) after #8366. Otherwise,
the `Acc`-based recursion in `digitsAux` would bog down kernel reduction.
Contributor
|
Build failed (retrying...): |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Feb 13, 2024
`norm_num` now successfully reduces `Nat.digits` calls that have concrete arguments, so we can clean up some old workarounds.
This all works because Lean 4.6.0 introduced "simprocs", including the default-enabled `reduceLE`, `reduceMod`, `reduceDiv`, etc. which `norm_num` can invoke to discharge the side-goals required by applications of `digits_of_two_le_of_pos`.
Another crucial aspect is that `{ decide := false }` is the default for `simp` (and `norm_num`) after #8366. Otherwise,
the `Acc`-based recursion in `digitsAux` would bog down kernel reduction.
Contributor
|
Build failed (retrying...): |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Feb 13, 2024
`norm_num` now successfully reduces `Nat.digits` calls that have concrete arguments, so we can clean up some old workarounds.
This all works because Lean 4.6.0 introduced "simprocs", including the default-enabled `reduceLE`, `reduceMod`, `reduceDiv`, etc. which `norm_num` can invoke to discharge the side-goals required by applications of `digits_of_two_le_of_pos`.
Another crucial aspect is that `{ decide := false }` is the default for `simp` (and `norm_num`) after #8366. Otherwise,
the `Acc`-based recursion in `digitsAux` would bog down kernel reduction.
Contributor
|
Pull request successfully merged into master. Build succeeded: |
riccardobrasca
pushed a commit
that referenced
this pull request
Feb 18, 2024
`norm_num` now successfully reduces `Nat.digits` calls that have concrete arguments, so we can clean up some old workarounds.
This all works because Lean 4.6.0 introduced "simprocs", including the default-enabled `reduceLE`, `reduceMod`, `reduceDiv`, etc. which `norm_num` can invoke to discharge the side-goals required by applications of `digits_of_two_le_of_pos`.
Another crucial aspect is that `{ decide := false }` is the default for `simp` (and `norm_num`) after #8366. Otherwise,
the `Acc`-based recursion in `digitsAux` would bog down kernel reduction.
dagurtomas
pushed a commit
that referenced
this pull request
Mar 22, 2024
`norm_num` now successfully reduces `Nat.digits` calls that have concrete arguments, so we can clean up some old workarounds.
This all works because Lean 4.6.0 introduced "simprocs", including the default-enabled `reduceLE`, `reduceMod`, `reduceDiv`, etc. which `norm_num` can invoke to discharge the side-goals required by applications of `digits_of_two_le_of_pos`.
Another crucial aspect is that `{ decide := false }` is the default for `simp` (and `norm_num`) after #8366. Otherwise,
the `Acc`-based recursion in `digitsAux` would bog down kernel reduction.
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.
norm_numnow successfully reducesNat.digitscalls that have concrete arguments, so we can clean up some old workarounds.This all works because Lean 4.6.0 introduced "simprocs", including the default-enabled
reduceLE,reduceMod,reduceDiv, etc. whichnorm_numcan invoke to discharge the side-goals required by applications ofdigits_of_two_le_of_pos.Another crucial aspect is that
{ decide := false }is the default forsimp(andnorm_num) after #8366. Otherwise,the
Acc-based recursion indigitsAuxwould bog down kernel reduction.