Documentation

Projects.DigitalRoot.Basic

@[simp]
theorem DigitalRoot.digSum_digRoot {b n : ℕ} :
b.digSum (digRoot b n) = digRoot b n
@[simp]
theorem DigitalRoot.digRoot_digSum {b n : ℕ} :
digRoot b (b.digSum n) = digRoot b n
theorem DigitalRoot.digRootAlt₁'_base_le_one {b n g : ℕ} (h₁ : b ≤ 1) (h₂ : g ≠ 0) :
theorem DigitalRoot.digRoot_of_lt_base {b n : ℕ} (h : n < b) :
digRoot b n = n
@[simp]
theorem DigitalRoot.digRoot_zero {b : ℕ} :
digRoot b 0 = 0
theorem DigitalRoot.digRoot_of_base_le_one {b n : ℕ} (hb : b ≤ 1) :
digRoot b n = 0
@[simp]
@[simp]
theorem DigitalRoot.digRoot_lt_base_of {b n : ℕ} (hb : b ≠ 0) :
digRoot b n < b
@[simp]
@[simp]
@[simp]
theorem DigitalRoot.digRoot_base {b : ℕ} [hb : b.Base] :
digRoot b b = 1
theorem DigitalRoot.digRoot_eq_digSum_of {b : ℕ} [hb : b.Base] {n : ℕ} (h : n + 1 < b * 2) :
digRoot b n = b.digSum n
@[simp]
theorem DigitalRoot.digRoot_base_sub_one {b : ℕ} :
digRoot b (b - 1) = b - 1
@[simp]
theorem DigitalRoot.digRoot_base_two {n : ℕ} :
digRoot 2 n = if n = 0 then 0 else 1
@[simp]
theorem DigitalRoot.digRoot_one {b : ℕ} [hb : b.Base] :
digRoot b 1 = 1
@[simp]
theorem DigitalRoot.digRoot_mul_base {b n : ℕ} :
digRoot b (n * b) = digRoot b n
@[simp]
theorem DigitalRoot.digRoot_base_mul {b n : ℕ} :
digRoot b (b * n) = digRoot b n
@[simp]
theorem DigitalRoot.digRoot_mul_base_pow {b n k : ℕ} :
digRoot b (n * b ^ k) = digRoot b n
@[simp]
theorem DigitalRoot.digRoot_base_pow_mul {b n k : ℕ} :
digRoot b (b ^ k * n) = digRoot b n
@[simp]
theorem DigitalRoot.digRoot_mod_base_pred {b : ℕ} [hb : b.Base] {n : ℕ} :
digRoot b n % (b - 1) = n % (b - 1)
@[simp]
theorem DigitalRoot.digRoot_eq_zero_iff {b n : ℕ} :
digRoot b n = 0 ↔ b ≤ 1 ∨ n = 0
@[simp]
theorem DigitalRoot.digRoot_base_succ_le {b n : ℕ} :
digRoot (b + 1) n ≤ b
@[simp]
theorem DigitalRoot.digRoot_add_base {b n : ℕ} :
digRoot b (n + b) = digRoot b (n + 1)
theorem DigitalRoot.digRoot_add_base_pred {b n : ℕ} (hn : n ≠ 0) :
digRoot b (n + (b - 1)) = digRoot b n
theorem DigitalRoot.digRoot_add {b : ℕ} [hb : b.Base] {n m : ℕ} :
digRoot b (n + m) = digRoot b (digRoot b n + digRoot b m)
theorem DigitalRoot.digRoot_add' {b : ℕ} [hb : b.Base] {n m : ℕ} :
digRoot b (n + m) = b.digSum (digRoot b n + digRoot b m)
@[simp]
theorem DigitalRoot.digRoot_mul_base_add {b : ℕ} [hb : b.Base] {n k : ℕ} :
digRoot b (n * b + k) = digRoot b (n + k)
@[simp]
theorem DigitalRoot.digRoot_base_pred_add {b n : ℕ} (h : n ≠ 0) :
digRoot b (b - 1 + n) = digRoot b n
@[simp]
theorem DigitalRoot.digRoot_digRoot_add_left {b : ℕ} [hb : b.Base] {n m : ℕ} :
digRoot b (n + digRoot b m) = digRoot b (n + m)
@[simp]
theorem DigitalRoot.digRoot_digRoot_add_right {b : ℕ} [hb : b.Base] {n m : ℕ} :
digRoot b (digRoot b n + m) = digRoot b (n + m)
@[simp]
theorem DigitalRoot.digRoot_eq_self_iff {b : ℕ} [hb : b.Base] {n : ℕ} :
digRoot b n = n ↔ n < b
@[simp]