Mathlib v3 is deprecated. Go to Mathlib v4

Commit 2020-06-08 15:06 47f73356

View on Github →

feat(data/nat/digits): digits, and divisibility tests for Freek 85 (#2686) I couldn't quite believe how much low hanging fruit there is on Lean's attempt at Freek's list, and so took a moment to do surely the lowest of the low... This provides digits b n, which extracts the digits of a natural number n with respect to a base b, and of_digits b L, which reconstitutes a number from its digits, proves a few simple facts about these functions, and proves the usual divisibility by 3, 9, and 11 tests.

Estimated changes

added theorem coe_int_of_digits
added theorem coe_of_digits
added def digits
added theorem digits_add
added theorem digits_add_two_add_one
added def digits_aux
added def digits_aux_0
added def digits_aux_1
added theorem digits_aux_def
added theorem digits_aux_zero
added theorem digits_of_digits
added theorem digits_of_lt
added theorem digits_one_succ
added theorem digits_zero
added theorem digits_zero_of_eq_zero
added theorem dvd_iff_dvd_digits_sum
added theorem dvd_iff_dvd_of_digits
added theorem eleven_dvd_iff
added theorem modeq_digits_sum
added theorem modeq_nine_digits_sum
added theorem modeq_three_digits_sum
added theorem nine_dvd_iff
added def of_digits
added theorem of_digits_digits
added theorem of_digits_eq_foldr
added theorem of_digits_mod
added theorem of_digits_modeq'
added theorem of_digits_modeq
added theorem of_digits_neg_one
added theorem of_digits_one
added theorem of_digits_one_cons
added theorem of_digits_zmod
added theorem of_digits_zmodeq'
added theorem of_digits_zmodeq
added theorem three_dvd_iff