Documentation

Projects.Kolakoski.Changes

theorem Kolakoski.Diverse.runs_eq_iff_changesNum {α : Type u_1} {a : ℕ → α} [ha : Diverse a] {n i : ℕ} :
runs a n = i ↔ (i = 0 ∨ a (i - 1) ≠ a i) ∧ (mkList i a).changesNum = n
@[simp]
theorem Kolakoski.Diverse.runs_le_self_iff {α : Type u_1} {a : ℕ → α} [ha : Diverse a] {n : ℕ} :
runs a n ≤ n ↔ runs a n = n
theorem Kolakoski.Diverse.runs_spec_changesNum {α : Type u_1} {a : ℕ → α} [ha : Diverse a] (n : ℕ) :
(n = 0 ∨ a (runs a n - 1) ≠ a (runs a n)) ∧ (mkList (runs a n) a).changesNum = n
theorem Kolakoski.getElem_f₁_append_eq_getElem_f₁_of {xs ys : List ℕ} {i : ℕ} {h₁ : i < (f₁ (xs ++ ys)).length} {h₂ : i < (f₁ xs).length} (h : 0 ∉ xs) :
(f₁ (xs ++ ys))[i] = (f₁ xs)[i]
theorem Kolakoski.getElem_f₁_eq_getElem_f₁_of_prefix {xs ys : List ℕ} {i : ℕ} {hh₁ : i < (f₁ xs).length} {hh₂ : i < (f₁ ys).length} (h₁ : ys <+: xs) (h₂ : 0 ∉ ys) :
(f₁ xs)[i] = (f₁ ys)[i]
theorem Kolakoski.getElem_iter_f₁_eq_getElem_iter_f₁_of_le {n i : ℕ} {hh : i < (f₁^[n] [1, 2]).length} (m : ℕ) (h : n ≤ m) :
(f₁^[n] [1, 2])[i] = (f₁^[m] [1, 2])[i]
theorem Kolakoski.Cnd.runs_succ_eq_add {a : ℕ → ℕ} [h : Cnd a] (i : ℕ) :
runs a (i + 1) = runs a i + a i
theorem Kolakoski.Cnd.runs_eq_sum {a : ℕ → ℕ} [h : Cnd a] (i : ℕ) :
runs a i = (mkList i a).sum
theorem Kolakoski.Cnd.apply_eq_sub {a : ℕ → ℕ} [h : Cnd a] (i : ℕ) :
a i = runs a (i + 1) - runs a i
theorem Kolakoski.Cnd.eq_iff_apply_zero {a b : ℕ → ℕ} [h₁ : Cnd a] [h₂ : Cnd b] :
a = b ↔ a 0 = b 0
theorem Kolakoski.Cnd.seq_eq_or_eq {a b c : ℕ → ℕ} [ha : Cnd a] [hb : Cnd b] [hc : Cnd c] :
a = b ∨ a = c ∨ b = c