Documentation

Projects.Util.Sequence

structure Periodic {α : Type u_1} (a : ℕ → α) :
Instances For
    structure EventuallyPeriodic {α : Type u_1} (a : ℕ → α) :
    Instances For
      structure SeqPrefix {α : Type u_1} (xs : List α) (a : ℕ → α) :
      Instances For
        structure SeqInfix {α : Type u_1} (xs : List α) (a : ℕ → α) :
        Instances For
          structure PowFree {α : Type u_1} (k : ℕ) (a : ℕ → α) :
          Instances For
            structure SquareFree {α : Type u_1} (a : ℕ → α) extends PowFree 2 a :
            Instances For
              structure CubeFree {α : Type u_1} (a : ℕ → α) extends PowFree 3 a :
              Instances For
                def SeqFunCnd {α : Type u_1} {β : Type u_2} (p : (ℕ → α) → Prop) (f : List α → List β) (g : (ℕ → α) → ℕ → β) :
                Equations
                Instances For
                  noncomputable def seqFun {α : Type u_1} {β : Type u_2} [hb : Nonempty β] (p : (ℕ → α) → Prop) (f : List α → List β) :
                  (ℕ → α) → ℕ → β
                  Equations
                  Instances For
                    def SeqFunIdxCnd {α : Type u_1} {β : Type u_2} (p : (ℕ → α) → Prop) (f : List α → List β) (g : (ℕ → α) → ℕ → ℕ) :
                    Equations
                    Instances For
                      noncomputable def seqFunIdx {α : Type u_1} {β : Type u_2} (p : (ℕ → α) → Prop) (f : List α → List β) :
                      (ℕ → α) → ℕ → ℕ
                      Equations
                      Instances For
                        theorem seq_forall_lt_succ_iff_lt {a : ℕ → ℕ} :
                        (∀ (i : ℕ), a i < a (i + 1)) ↔ ∀ (i j : ℕ), a i < a j ↔ i < j
                        theorem Periodic.iff {α : Type u_1} {a : ℕ → α} :
                        Periodic a ↔ ∃ (p : ℕ), p ≠ 0 ∧ ∀ (k : ℕ), a (k + p) = a k
                        theorem EventuallyPeriodic.iff {α : Type u_1} {a : ℕ → α} :
                        EventuallyPeriodic a ↔ ∃ (p : ℕ), p ≠ 0 ∧ ∃ (c : ℕ), ∀ (n : ℕ), c ≤ n → a (n + p) = a n
                        theorem EventuallyPeriodic.iff' {α : Type u_1} {a : ℕ → α} :
                        EventuallyPeriodic a ↔ eventually fun (n : ℕ) => Periodic fun (x : ℕ) => a (x + n)
                        theorem SeqPrefix.iff {α : Type u_1} {a : ℕ → α} {xs : List α} :
                        SeqPrefix xs a ↔ mkList xs.length a = xs
                        theorem SeqInfix.iff {α : Type u_1} {a : ℕ → α} {xs : List α} :
                        SeqInfix xs a ↔ ∃ (n : ℕ), xs <:+: mkList n a
                        theorem PowFree.iff {α : Type u_1} {a : ℕ → α} {n : ℕ} :
                        PowFree n a ↔ ∀ (xs : List α), xs ≠ [] → ¬SeqInfix (List.replicate n xs).flatten a
                        theorem SquareFree.iff {α : Type u_1} {a : ℕ → α} :
                        SquareFree a ↔ ∀ (xs : List α), xs ≠ [] → ¬SeqInfix (xs ++ xs) a
                        theorem CubeFree.iff {α : Type u_1} {a : ℕ → α} :
                        CubeFree a ↔ ∀ (xs : List α), xs ≠ [] → ¬SeqInfix (xs ++ xs ++ xs) a
                        theorem PowFree.not_eventuallyPeriodic {α : Type u_1} {a : ℕ → α} {n : ℕ} (h : PowFree n a) :
                        theorem Periodic.eventuallyPeriodic {α : Type u_1} {a : ℕ → α} (h : Periodic a) :
                        theorem eq_of_seqFunCnd_and_seqFunCnd {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {g₁ g₂ : (ℕ → α) → ℕ → β} {a : ℕ → α} (h : p a) (h₁ : SeqFunCnd p f g₁) (h₂ : SeqFunCnd p f g₂) :
                        g₁ a = g₂ a
                        theorem seqFun_eq_of {α : Type u_1} {β : Type u_2} [hb : Nonempty β] {p : (ℕ → α) → Prop} {f : List α → List β} {g : (ℕ → α) → ℕ → β} {a : ℕ → α} (h₁ : SeqFunCnd p f g) (h₂ : p a) :
                        seqFun p f a = g a
                        @[simp]
                        theorem seqFun_id {α : Type u_1} [ha : Nonempty α] {p : (ℕ → α) → Prop} {a : ℕ → α} (h : p a) :
                        seqFun p id a = a
                        theorem exi_seqFunCnd_iff {α : Type u_1} {β : Type u_2} [hb : Nonempty β] {p : (ℕ → α) → Prop} {f : List α → List β} :
                        (∃ (g : (ℕ → α) → ℕ → β), SeqFunCnd p f g) ↔ SeqFunCnd p f (seqFun p f)
                        theorem exi_seqFunCnd_of {α : Type u_1} {β : Type u_2} [hb : Nonempty β] {p : (ℕ → α) → Prop} {f : List α → List β} (h : ∀ (a : ℕ → α), p a → ∀ (i : ℕ), ∃ (N : ℕ) (x : β), ∀ (n : ℕ), N ≤ n → (f (mkList n a))[i]? = some x) :
                        ∃ (g : (ℕ → α) → ℕ → β), SeqFunCnd p f g
                        @[simp]
                        theorem seqPrefix_nil {α : Type u_1} {a : ℕ → α} :
                        @[simp]
                        theorem seqInfix_nil {α : Type u_1} {a : ℕ → α} :
                        theorem seqInfix_of_infix {α : Type u_1} {a : ℕ → α} {xs ys : List α} (h₁ : SeqInfix xs a) (h₂ : ys <:+: xs) :
                        theorem seqInfix_take {α : Type u_1} {a : ℕ → α} {xs : List α} {n : ℕ} (h : SeqInfix xs a) :
                        theorem seqInfix_drop {α : Type u_1} {a : ℕ → α} {xs : List α} {n : ℕ} (h : SeqInfix xs a) :
                        theorem SeqPrefix.seqInfix {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqPrefix xs a) :
                        @[simp]
                        theorem seqPrefix_mkList {α : Type u_1} {a : ℕ → α} {n : ℕ} :
                        @[simp]
                        theorem seqInfix_mkList {α : Type u_1} {a : ℕ → α} {n : ℕ} :
                        theorem exi_seqFunIdxCnd_of {α : Type u_1} {β : Type u_2} [hb : Nonempty β] {p : (ℕ → α) → Prop} {f : List α → List β} (h : ∃ (g : (ℕ → α) → ℕ → ℕ), ∀ (a : ℕ → α), p a → ∀ (i n : ℕ), g a i ≤ n → (f (mkList n a))[i]? = some (seqFun p f a i)) :
                        ∃ (g : (ℕ → α) → ℕ → ℕ), SeqFunIdxCnd p f g
                        theorem nonempty_of_seqFunCnd {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {g : (ℕ → α) → ℕ → β} :
                        SeqFunCnd p f g → ∀ (a : ℕ → α), Nonempty β
                        theorem seqFunIdx_spec' {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {g : (ℕ → α) → ℕ → β} (h : SeqFunCnd p f g) :
                        theorem lt_length_apply_mkList_of_seqFunCnd {α : Type u_1} {β : Type u_2} {a : ℕ → α} {p : (ℕ → α) → Prop} {f : List α → List β} {g : (ℕ → α) → ℕ → β} {i : ℕ} (h : SeqFunCnd p f g) (ha : p a) :
                        i < (f (mkList (seqFunIdx p f a i) a)).length
                        theorem seqFunIdx_spec {α : Type u_1} {β : Type u_2} {a : ℕ → α} {p : (ℕ → α) → Prop} {f : List α → List β} {g : (ℕ → α) → ℕ → β} (h : SeqFunCnd p f g) (ha : p a) (i : ℕ) :
                        g a i = (f (mkList (seqFunIdx p f a i) a))[i]
                        theorem SeqInfix.exi_prefix {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqInfix xs a) :
                        ∃ (ys : List α), SeqPrefix (ys ++ xs) a
                        theorem SeqPrefix.infix {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqPrefix xs a) :
                        theorem seqPrefix_of_mkList_eq {α : Type u_1} {a : ℕ → α} {xs : List α} {n : ℕ} (h : mkList n a = xs) :
                        theorem seqPrefix_of_eq_mkList {α : Type u_1} {a : ℕ → α} {xs : List α} {n : ℕ} (h : xs = mkList n a) :
                        theorem seqInfix_of_mkList_eq {α : Type u_1} {a : ℕ → α} {xs : List α} {n : ℕ} (h : mkList n a = xs) :
                        theorem SeqInfix.infix {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqInfix xs a) (ys : List α) (h₁ : ys <:+: xs) :
                        theorem SeqInfix.append_left {α : Type u_1} {a : ℕ → α} {xs ys : List α} (h : SeqInfix (xs ++ ys) a) :
                        theorem SeqInfix.append_right {α : Type u_1} {a : ℕ → α} {xs ys : List α} (h : SeqInfix (xs ++ ys) a) :
                        theorem SeqPrefix.prefix {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqPrefix xs a) (ys : List α) (h₁ : ys <+: xs) :
                        theorem SeqPrefix.take {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqPrefix xs a) (n : ℕ) :
                        theorem SeqInfix.take {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqInfix xs a) (n : ℕ) :
                        theorem SeqPrefix.init {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqPrefix xs a) :
                        theorem SeqInfix.init {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqInfix xs a) :
                        theorem SeqInfix.drop {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqInfix xs a) (n : ℕ) :
                        theorem SeqInfix.tail {α : Type u_1} {a : ℕ → α} {xs : List α} (h : SeqInfix xs a) :
                        @[simp]
                        theorem seqFunCnd_fun_nil_iff {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : (ℕ → α) → ℕ → β} :
                        SeqFunCnd p (fun (x : List α) => []) f ↔ ∀ (a : ℕ → α), ¬p a
                        theorem seqFunCnd_iff' {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {g : (ℕ → α) → ℕ → β} :
                        SeqFunCnd p f g ↔ ∀ (a : ℕ → α) (i : ℕ), ∃ (N : ℕ), p a → ∀ (n : ℕ), N ≤ n → (f (mkList n a))[i]? = some (g a i)
                        theorem seqFunIdx_lt_succ {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {a : ℕ → α} {i : ℕ} (h : SeqFunIdxCnd p f (seqFunIdx p f)) (ha : p a) :
                        seqFunIdx p f a i < seqFunIdx p f a (i + 1)
                        theorem le_seqFunIdx {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {a : ℕ → α} {i : ℕ} (h : SeqFunIdxCnd p f (seqFunIdx p f)) (ha : p a) :
                        i ≤ seqFunIdx p f a i
                        theorem seqFunIdx_le_of_le {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {a : ℕ → α} {i j : ℕ} (h : SeqFunIdxCnd p f (seqFunIdx p f)) (ha : p a) (h₁ : i ≤ j) :
                        seqFunIdx p f a i ≤ seqFunIdx p f a j
                        theorem seqFunIdx_lt_of_lt {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {a : ℕ → α} {i j : ℕ} (h : SeqFunIdxCnd p f (seqFunIdx p f)) (ha : p a) (h₁ : i < j) :
                        seqFunIdx p f a i < seqFunIdx p f a j
                        theorem seqFunIdx_eq_iff {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {a : ℕ → α} {i j : ℕ} (h : SeqFunIdxCnd p f (seqFunIdx p f)) (ha : p a) :
                        seqFunIdx p f a i = seqFunIdx p f a j ↔ i = j
                        theorem seqFunIdx_le_iff {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {a : ℕ → α} {i j : ℕ} (h : SeqFunIdxCnd p f (seqFunIdx p f)) (ha : p a) :
                        seqFunIdx p f a i ≤ seqFunIdx p f a j ↔ i ≤ j
                        theorem seqFunIdx_lt_iff {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {a : ℕ → α} {i j : ℕ} (h : SeqFunIdxCnd p f (seqFunIdx p f)) (ha : p a) :
                        seqFunIdx p f a i < seqFunIdx p f a j ↔ i < j
                        theorem seqFunCnd_seqFun_of {α : Type u_1} {β : Type u_2} [hb : Nonempty β] {p : (ℕ → α) → Prop} {f : List α → List β} (h : ∀ (a : ℕ → α), p a → ∀ (i : ℕ), ∃ (N : ℕ) (x : β), ∀ (n : ℕ), N ≤ n → (f (mkList n a))[i]? = some x) :
                        SeqFunCnd p f (seqFun p f)
                        theorem seqFunCnd_seqFun_of' {α : Type u_1} {β : Type u_2} [hb : Nonempty β] {p : (ℕ → α) → Prop} {f : List α → List β} (h : ∀ (a : ℕ → α), p a → ∀ (i : ℕ), ∃ (N : ℕ), ∀ (n : ℕ), N ≤ n → ∃ (x : i < (f (mkList N a)).length) (x_1 : i < (f (mkList n a)).length), (f (mkList n a))[i] = (f (mkList N a))[i]) :
                        SeqFunCnd p f (seqFun p f)
                        theorem seqFun_eq_getElem {α : Type u_1} {β : Type u_2} {p : (ℕ → α) → Prop} {f : List α → List β} {g : (ℕ → α) → ℕ → β} {a : ℕ → α} {n : ℕ} (h₁ : SeqFunCnd p f g) (h₂ : p a) :
                        g a n = (f (mkList (seqFunIdx p f a n) a))[n]
                        theorem seq_ext_mkList {α : Type u_1} {a b : ℕ → α} :
                        a = b ↔ ∀ (n : ℕ), mkList n a = mkList n b
                        theorem seq_eq_iff_step {α : Type u_1} {a b : ℕ → α} :
                        a = b ↔ a 0 = b 0 ∧ (fun (x : ℕ) => a (x + 1)) = fun (x : ℕ) => b (x + 1)
                        @[simp]
                        theorem seqPrefix_singleton_iff {α : Type u_1} {a : ℕ → α} {x : α} :
                        SeqPrefix [x] a ↔ a 0 = x
                        @[simp]
                        theorem seqInfix_singleton_iff {α : Type u_1} {a : ℕ → α} {x : α} :
                        SeqInfix [x] a ↔ ∃ (n : ℕ), a n = x
                        theorem eventually_not_periodic_iff_not_eventually_periodic {α : Type u_1} {a : ℕ → α} :
                        (eventually fun (n : ℕ) => ¬Periodic fun (x : ℕ) => a (x + n)) ↔ ¬eventually fun (n : ℕ) => Periodic fun (x : ℕ) => a (x + n)
                        theorem eventually_not_periodic_iff_not_eventuallyPeriodic {α : Type u_1} {a : ℕ → α} :
                        (eventually fun (n : ℕ) => ¬Periodic fun (x : ℕ) => a (x + n)) ↔ ¬EventuallyPeriodic a
                        theorem SeqInfix.iff_exi_drop' {α : Type u_1} {a : ℕ → α} {xs : List α} :
                        SeqInfix xs a ↔ ∃ (n : ℕ), SeqPrefix xs fun (x : ℕ) => a (n + x)
                        theorem SeqInfix.iff_exi_drop {α : Type u_1} {a : ℕ → α} {xs : List α} :
                        SeqInfix xs a ↔ ∃ (n : ℕ), (mkList xs.length fun (x : ℕ) => a (n + x)) = xs
                        theorem seq_ext_le {α : Type u_1} {a b : ℕ → α} :
                        a = b ↔ ∀ (n : ℕ), (∀ k < n, a k = b k) → a n = b n