-
Notifications
You must be signed in to change notification settings - Fork 259
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
[Merged by Bors] - chore: remove no-longer-needed Nat.digits workarounds #10429
Conversation
-- 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on master:
[Elab.command] [3.090407s] theorem right_direction
after this change:
[Elab.command] [2.878866s] theorem right_direction
exact searchUpTo_end this | ||
#align imo1960_q1.right_direction Imo1960Q1.right_direction | ||
|
||
/- | ||
Now we just need to prove the equivalence, for the precise problem statement. | ||
-/ | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on master:
[Elab.command] [13.806512s] theorem left_direction
after this change:
[Elab.command] [0.087602s] theorem left_direction
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
bors merge
`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 PR was included in a batch that was canceled, it will be automatically retried |
`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.
Build failed (retrying...): |
`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.
Build failed (retrying...): |
`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.
Pull request successfully merged into master. Build succeeded: |
`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.
`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.
norm_num
now successfully reducesNat.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. whichnorm_num
can 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 indigitsAux
would bog down kernel reduction.