Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data/nat/digits): add norm_digits tactic (#4452)
This adds a basic tactic for normalizing expressions of the form `nat.digits a b = l`. As requested on Zulip: https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/simplifying.20nat.2Edigits/near/212152395 Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com> Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
- Loading branch information
1 parent
b1ca33e
commit 952a407
Showing
2 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import data.nat.digits | ||
|
||
example : nat.digits 0 0 = [] := by norm_digits | ||
example : nat.digits 1 0 = [] := by norm_digits | ||
example : nat.digits 2 0 = [] := by norm_digits | ||
example : nat.digits 10 0 = [] := by norm_digits | ||
example : nat.digits 0 1 = [1] := by norm_digits | ||
example : nat.digits 0 1000 = [1000] := by norm_digits | ||
example : nat.digits 1 10 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] := by norm_digits | ||
example : nat.digits 2 65536 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] := by norm_digits | ||
example : nat.digits 3 30000000 = [0, 1, 0, 1, 2, 0, 1, 1, 0, 0, 1, 1, 2, 0, 0, 2] := by norm_digits | ||
example : nat.digits 10 1234567 = [7, 6, 5, 4, 3, 2, 1] := by norm_digits |