chars int64 40 24k | content_type stringclasses 9
values | id stringlengths 13 64 | source stringclasses 5
values | subset stringclasses 31
values | text stringlengths 40 24k |
|---|---|---|---|---|---|
246 | leanexplore_declaration | leanexplore:387117 | leanexplore_sqlite | leanexplore_declarations | theorem base_zero_strictMono (hm : StrictMono f) :
StrictMono (f · - f 0) := by
intro m n h_m_n; simp
have := hm h_m_n
have : f 0 ≤ f m := by simp [StrictMono.le_iff_le hm]
have : f 0 ≤ f n := by simp [StrictMono.le_iff_le hm]
omega |
975 | leanexplore_declaration | leanexplore:387118 | leanexplore_sqlite | leanexplore_declarations | /-- For a strictly monotonic function `f : ℕ → ℕ`,
`segment' f` and `segment f` are actually equal. -/
theorem segment'_eq_segment (hm : StrictMono f) :
segment' f = segment f := by
classical
ext k; unfold segment'
rcases (show k < f 0 ∨ k ≥ f 0 by omega) with h_k | h_k
· grind
unfold segment; congr 1
s... |
261 | leanexplore_declaration | leanexplore:387119 | leanexplore_sqlite | leanexplore_declarations | /-- For a strictly monotonic function `f : ℕ → ℕ`, `segment f k = 0` for all `k ≤ f 0`. -/
theorem segment_zero' (hm : StrictMono f) {k : ℕ} (h : k ≤ f 0) :
segment f k = 0 := by
rw [← segment'_eq_segment hm, segment', (show k - f 0 = 0 by omega)]
grind |
341 | leanexplore_declaration | leanexplore:387120 | leanexplore_sqlite | leanexplore_declarations | /-- For a strictly monotonic function `f : ℕ → ℕ`, `k < f (segment f k + 1)` for all `k ≥ f 0`. -/
theorem segment_upper_bound' (hm : StrictMono f) {k : ℕ} (h : f 0 ≤ k) :
k < f (segment f k + 1) := by
rw [← segment'_eq_segment hm, segment']
have := segment_upper_bound (base_zero_strictMono hm) (base_zero_shift... |
333 | leanexplore_declaration | leanexplore:387121 | leanexplore_sqlite | leanexplore_declarations | /-- For a strictly monotonic function `f : ℕ → ℕ`, `f (segment f k) ≤ k` for all `k ≥ f 0`. -/
theorem segment_lower_bound' (hm : StrictMono f) {k : ℕ} (h : f 0 ≤ k) :
f (segment f k) ≤ k := by
rw [← segment'_eq_segment hm, segment']
have := segment_lower_bound (base_zero_strictMono hm) (base_zero_shift f) (k -... |
179 | leanexplore_declaration | leanexplore:387122 | leanexplore_sqlite | leanexplore_declarations | /-- An `ωSequence α` is an infinite sequence of elements of `α`. -/
structure ωSequence (α : Type u) where
/-- The function that defines this infinite sequence. -/
get : ℕ → α |
126 | leanexplore_declaration | leanexplore:387123 | leanexplore_sqlite | leanexplore_declarations | instance : FunLike (ωSequence α) ℕ α where
coe := ωSequence.get
coe_injective' := by grind [ωSequence, Function.Injective] |
57 | leanexplore_declaration | leanexplore:387124 | leanexplore_sqlite | leanexplore_declarations | instance : Coe (ℕ → α) (ωSequence α) where
coe f := ⟨f⟩ |
106 | leanexplore_declaration | leanexplore:387125 | leanexplore_sqlite | leanexplore_declarations | /-- Head of an ω-sequence: `ωSequence.head s = ωSequence s 0`. -/
abbrev head (s : ωSequence α) : α := s 0 |
123 | leanexplore_declaration | leanexplore:387126 | leanexplore_sqlite | leanexplore_declarations | /-- Tail of an ω-sequence: `ωSequence.tail (h :: t) = t`. -/
def tail (s : ωSequence α) : ωSequence α := fun i => s (i + 1) |
119 | leanexplore_declaration | leanexplore:387127 | leanexplore_sqlite | leanexplore_declarations | /-- Drop first `n` elements of an ω-sequence. -/
def drop (n : ℕ) (s : ωSequence α) : ωSequence α := fun i => s (i + n) |
180 | leanexplore_declaration | leanexplore:387128 | leanexplore_sqlite | leanexplore_declarations | /-- `take n s` returns a list of the `n` first elements of ω-sequence `s` -/
def take : ℕ → ωSequence α → List α
| 0, _ => []
| n + 1, s => List.cons (head s) (take n (tail s)) |
161 | leanexplore_declaration | leanexplore:387129 | leanexplore_sqlite | leanexplore_declarations | /-- Get the list containing the elements of `xs` from position `m` to `n - 1`. -/
def extract (xs : ωSequence α) (m n : ℕ) : List α :=
take (n - m) (xs.drop m) |
120 | leanexplore_declaration | leanexplore:387130 | leanexplore_sqlite | leanexplore_declarations | /-- Prepend an element to an ω-sequence. -/
def cons (a : α) (s : ωSequence α) : ωSequence α
| 0 => a
| n + 1 => s n |
386 | leanexplore_declaration | leanexplore:387131 | leanexplore_sqlite | leanexplore_declarations | @[inherit_doc] scoped infixr:67 " ::ω " => cons
/-- Append an ω-sequence to a list. -/
def appendωSequence : List α → ωSequence α → ωSequence α
| [], s => s
| List.cons a l, s => a ::ω appendωSequence l s
@[inherit_doc] infixl:65 " ++ω " => appendωSequence
/-- The constant ω-sequence: `ωSequence n (ωSequence.con... |
160 | leanexplore_declaration | leanexplore:387132 | leanexplore_sqlite | leanexplore_declarations | /-- Append an ω-sequence to a list. -/
def appendωSequence : List α → ωSequence α → ωSequence α
| [], s => s
| List.cons a l, s => a ::ω appendωSequence l s |
175 | leanexplore_declaration | leanexplore:387133 | leanexplore_sqlite | leanexplore_declarations | @[inherit_doc] infixl:65 " ++ω " => appendωSequence
/-- The constant ω-sequence: `ωSequence n (ωSequence.const a) = a`. -/
def const (a : α) : ωSequence α := fun (_ : ℕ) => a |
122 | leanexplore_declaration | leanexplore:387134 | leanexplore_sqlite | leanexplore_declarations | /-- The constant ω-sequence: `ωSequence n (ωSequence.const a) = a`. -/
def const (a : α) : ωSequence α := fun (_ : ℕ) => a |
137 | leanexplore_declaration | leanexplore:387135 | leanexplore_sqlite | leanexplore_declarations | /-- Apply a function `f` to all elements of an ω-sequence `s`. -/
def map (f : α → β) (s : ωSequence α) : ωSequence β := fun n => f (s n) |
231 | leanexplore_declaration | leanexplore:387136 | leanexplore_sqlite | leanexplore_declarations | /-- Zip two ω-sequences using a binary operation:
`ωSequence n (ωSequence.zip f s₁ s₂) = f (ωSequence s₁) (ωSequence s₂)`. -/
def zip (f : α → β → δ) (s₁ : ωSequence α) (s₂ : ωSequence β) : ωSequence δ :=
fun n => f (s₁ n) (s₂ n) |
113 | leanexplore_declaration | leanexplore:387137 | leanexplore_sqlite | leanexplore_declarations | /-- Iterates of a function as an ω-sequence. -/
def iterate (f : α → α) (a : α) : ωSequence α := fun n => f^[n] a |
218 | leanexplore_declaration | leanexplore:387138 | leanexplore_sqlite | leanexplore_declarations | /-- Given an ω-sequence `ls` of lists, `ls.cumLen k` is the cumulative sum
of `(ls k).length` for `k = 0, ..., k - 1`. -/
def cumLen (ls : ωSequence (List α)) : ℕ → ℕ
| 0 => 0
| k + 1 => ls.cumLen k + (ls k).length |
100 | leanexplore_declaration | leanexplore:387139 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem cumLen_zero {ls : ωSequence (List α)} :
ls.cumLen 0 = 0 :=
rfl |
134 | leanexplore_declaration | leanexplore:387140 | leanexplore_sqlite | leanexplore_declarations | @[scoped grind =]
theorem cumLen_succ (ls : ωSequence (List α)) (k : ℕ) :
ls.cumLen (k + 1) = ls.cumLen k + (ls k).length :=
rfl |
154 | leanexplore_declaration | leanexplore:387141 | leanexplore_sqlite | leanexplore_declarations | theorem cumLen_one_add_drop (ls : ωSequence (List α)) (k : ℕ) :
ls.cumLen (1 + k) = (ls 0).length + (ls.drop 1).cumLen k := by
induction k <;> grind |
234 | leanexplore_declaration | leanexplore:387142 | leanexplore_sqlite | leanexplore_declarations | /-- If all lists in `ls` are nonempty, then `ls.cumLen` is strictly monotonic. -/
theorem cumLen_strictMono {ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0) :
StrictMono ls.cumLen := by
grind [strictMono_nat_of_lt_succ] |
356 | leanexplore_declaration | leanexplore:387143 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem cumLen_segment_zero {ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0)
(n : ℕ) (h_n : n < (ls 0).length) : segment ls.cumLen n = 0 := by
have h0 : ls.cumLen 0 ≤ n := by simp [cumLen_zero]
have h1 : n < ls.cumLen 1 := by simpa [cumLen_succ, cumLen_zero]
exact segment_rang... |
1,612 | leanexplore_declaration | leanexplore:387144 | leanexplore_sqlite | leanexplore_declarations | theorem cumLen_segment_one_add {ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0)
(n : ℕ) (h_n : (ls 0).length ≤ n) :
segment ls.cumLen n = 1 + segment (ls.drop 1).cumLen (n - (ls 0).length) := by
classical
have h0 : (ls.drop 1).cumLen 0 = 0 := by simp [cumLen_zero]
rw [add_comm, segment_plus_one h... |
388 | leanexplore_declaration | leanexplore:387145 | leanexplore_sqlite | leanexplore_declarations | /-- Given an ω-sequence `ls` of lists, `ls.flatten` is the infinite sequence
formed by the concatenation of all of them. For the definition to make proper
sense, we will consistently assume that all lists in `ls` are nonempty. -/
noncomputable def flatten [Inhabited α] (ls : ωSequence (List α)) : ωSequence α :=
fun ... |
162 | leanexplore_declaration | leanexplore:387146 | leanexplore_sqlite | leanexplore_declarations | theorem flatten_def [Inhabited α] (ls : ωSequence (List α)) (n : ℕ) :
flatten ls n = (ls (segment ls.cumLen n))[n - ls.cumLen (segment ls.cumLen n)]! :=
rfl |
572 | leanexplore_declaration | leanexplore:387147 | leanexplore_sqlite | leanexplore_declarations | /-- `ls.flatten` equals the concatenation of `ls.head` and `ls.tail.flatten`. -/
@[simp, scoped grind =]
theorem cons_flatten [Inhabited α] {ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0) :
ls.head ++ω ls.tail.flatten = ls.flatten := by
ext n; rw [flatten_def, head, tail_eq_drop]
rcases (show n < (ls ... |
358 | leanexplore_declaration | leanexplore:387148 | leanexplore_sqlite | leanexplore_declarations | /-- `ls.flatten` equals the concatenation of `(ls.take n).flatten` and `(ls.drop n).flatten`. -/
@[simp, scoped grind =]
theorem append_flatten [Inhabited α] {ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0)
(n : ℕ) : (ls.take n).flatten ++ω (ls.drop n).flatten = ls.flatten := by
induction n generalizing ... |
251 | leanexplore_declaration | leanexplore:387149 | leanexplore_sqlite | leanexplore_declarations | /-- The length of `(ls.take n).flatten` is `ls.cumLen n`. -/
@[simp, nolint simpNF, scoped grind =]
theorem length_flatten_take {ls : ωSequence (List α)} (n : ℕ) :
(ls.take n).flatten.length = ls.cumLen n := by
induction n <;> grind [take_succ'] |
517 | leanexplore_declaration | leanexplore:387150 | leanexplore_sqlite | leanexplore_declarations | /-- `In fact, (ls.take n).flatten` is `ls.flatten.take (ls.cumLen n)`
and (ls.drop n).flatten` is `ls.flatten.drop (ls.cumLen n)`. -/
theorem flatten_take_drop [Inhabited α]
{ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0) (n : ℕ) :
(ls.take n).flatten = ls.flatten.take (ls.cumLen n) ∧
(ls.drop n).... |
196 | leanexplore_declaration | leanexplore:387151 | leanexplore_sqlite | leanexplore_declarations | theorem flatten_take [Inhabited α]
{ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0) (n : ℕ) :
(ls.take n).flatten = ls.flatten.take (ls.cumLen n) :=
(flatten_take_drop h_ls n).1 |
196 | leanexplore_declaration | leanexplore:387152 | leanexplore_sqlite | leanexplore_declarations | theorem flatten_drop [Inhabited α]
{ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0) (n : ℕ) :
(ls.drop n).flatten = ls.flatten.drop (ls.cumLen n) :=
(flatten_take_drop h_ls n).2 |
471 | leanexplore_declaration | leanexplore:387153 | leanexplore_sqlite | leanexplore_declarations | /-- `ls n` is the segement from position `ls.cumLen n` to position `ls.cumLen (n + 1) - 1`
of ls.flatten` -/
@[simp, scoped grind =]
theorem extract_flatten [Inhabited α] {ls : ωSequence (List α)} (h_ls : ∀ k, (ls k).length > 0)
(n : ℕ) : ls.flatten.extract (ls.cumLen n) (ls.cumLen (n + 1)) = ls n := by
have h_ls... |
355 | leanexplore_declaration | leanexplore:387154 | leanexplore_sqlite | leanexplore_declarations | /-- Given an ω-sequence `s` and a function `f : ℕ → ℕ`, `s.toSegs f` is the ω-sequence
whose `n`-th element is the list `s.extract (f n) (f (n + 1))`. In all its uses, the
function `f` will always be assumed to be strictly monotonic with `f 0 = 0`. -/
def toSegs (s : ωSequence α) (f : ℕ → ℕ) : ωSequence (List α) :=
... |
114 | leanexplore_declaration | leanexplore:387155 | leanexplore_sqlite | leanexplore_declarations | theorem toSegs_def (s : ωSequence α) (f : ℕ → ℕ) (n : ℕ) :
s.toSegs f n = s.extract (f n) (f (n + 1)) :=
rfl |
281 | leanexplore_declaration | leanexplore:387156 | leanexplore_sqlite | leanexplore_declarations | /-- `(s.toSegs f).cumLen` is `f` itself. -/
@[simp]
theorem segment_toSegs_cumLen {f : ℕ → ℕ}
(hm : StrictMono f) (h0 : f 0 = 0) (s : ωSequence α) :
(s.toSegs f).cumLen = f := by
ext n
have (n' : ℕ) := hm (show n' < n' + 1 by omega)
induction n <;> grind [toSegs_def] |
366 | leanexplore_declaration | leanexplore:387157 | leanexplore_sqlite | leanexplore_declarations | /-- `(s.toSegs f).flatten` is `s` itself. -/
@[simp, scoped grind =]
theorem strictMono_flatten [Inhabited α] {f : ℕ → ℕ}
(hm : StrictMono f) (h0 : f 0 = 0) (s : ωSequence α) :
(s.toSegs f).flatten = s := by
ext k; rw [flatten_def, segment_toSegs_cumLen hm h0, toSegs_def]
have := segment_lower_bound hm h0 k... |
148 | leanexplore_declaration | leanexplore:387158 | leanexplore_sqlite | leanexplore_declarations | /-- The set of elements that appear infinitely often in an ω-sequence. -/
def infOcc (xs : ωSequence α) : Set α :=
{ x | ∃ᶠ k in atTop, xs k = x } |
454 | leanexplore_declaration | leanexplore:387159 | leanexplore_sqlite | leanexplore_declarations | /-- An alternative characterization of "infinitely often". -/
theorem frequently_iff_strictMono {p : ℕ → Prop} :
(∃ᶠ n in atTop, p n) ↔ ∃ f : ℕ → ℕ, StrictMono f ∧ ∀ m, p (f m) := by
constructor
· intro h
exact extraction_of_frequently_atTop h
· rintro ⟨f, h_mono, h_p⟩
rw [Nat.frequently_atTop_iff_inf... |
861 | leanexplore_declaration | leanexplore:387160 | leanexplore_sqlite | leanexplore_declarations | /-- In a finite type, the elements of a set occurs infinitely often iff
some element in the set occurs infinitely often. -/
theorem frequently_in_finite_type [Finite α] {s : Set α} {xs : ωSequence α} :
(∃ᶠ k in atTop, xs k ∈ s) ↔ ∃ x ∈ s, ∃ᶠ k in atTop, xs k = x := by
constructor
· intro h_inf
rw [Nat.frequ... |
728 | leanexplore_declaration | leanexplore:387161 | leanexplore_sqlite | leanexplore_declarations | /-- If `p` is true infinitely often, then `p` is true in infinitely many segments
of any strictly monotonic function `f`. -/
theorem frequently_in_strictMono {p : ℕ → Prop} {f : ℕ → ℕ}
(hm : StrictMono f) (hf : ∃ᶠ k in atTop, p k) :
∃ᶠ n in atTop, ∃ k, k < f (n + 1) - f n ∧ p (f n + k) := by
apply frequently_... |
264 | leanexplore_declaration | leanexplore:387162 | leanexplore_sqlite | leanexplore_declarations | /-- Every infinite subset of ℕ is the range of a strictly monotonic function from ℕ to ℕ. -/
theorem strictMono_of_infinite {ns : Set ℕ} (h : ns.Infinite) :
∃ φ : ℕ → ℕ, StrictMono φ ∧ range φ = ns :=
⟨nth (· ∈ ns), nth_strictMono h, range_nth_of_infinite h⟩ |
79 | leanexplore_declaration | leanexplore:387163 | leanexplore_sqlite | leanexplore_declarations | instance [Inhabited α] : Inhabited (ωSequence α) :=
⟨ωSequence.const default⟩ |
141 | leanexplore_declaration | leanexplore:387164 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
protected theorem eta (s : ωSequence α) : head s ::ω tail s = s := by
apply DFunLike.ext
intro i; cases i <;> rfl |
91 | leanexplore_declaration | leanexplore:387165 | leanexplore_sqlite | leanexplore_declarations | /-- Alias for `ωSequence.eta` to match `List` API. -/
alias cons_head_tail := ωSequence.eta |
119 | leanexplore_declaration | leanexplore:387166 | leanexplore_sqlite | leanexplore_declarations | @[ext, grind ext]
protected theorem ext {s₁ s₂ : ωSequence α} : (∀ n, s₁ n = s₂ n) → s₁ = s₂ := by
apply DFunLike.ext |
98 | leanexplore_declaration | leanexplore:387167 | leanexplore_sqlite | leanexplore_declarations | @[ext, grind ext]
protected theorem ext {s₁ s₂ : ωSequence α} : (∀ n, s₁ n = s₂ n) → s₁ = s₂ := by |
93 | leanexplore_declaration | leanexplore:387168 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_fun (f : ℕ → α) (n : ℕ) : ωSequence.mk f n = f n :=
rfl |
98 | leanexplore_declaration | leanexplore:387169 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_zero_cons (a : α) (s : ωSequence α) : (a ::ω s) 0 = a :=
rfl |
97 | leanexplore_declaration | leanexplore:387170 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem head_cons (a : α) (s : ωSequence α) : head (a ::ω s) = a :=
rfl |
97 | leanexplore_declaration | leanexplore:387171 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem tail_cons (a : α) (s : ωSequence α) : tail (a ::ω s) = s :=
rfl |
127 | leanexplore_declaration | leanexplore:387172 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_drop (n m : ℕ) (s : ωSequence α) : (drop m s) n = s (m + n) := by
rw [Nat.add_comm]
rfl |
67 | leanexplore_declaration | leanexplore:387173 | leanexplore_sqlite | leanexplore_declarations | theorem tail_eq_drop (s : ωSequence α) : tail s = drop 1 s :=
rfl |
140 | leanexplore_declaration | leanexplore:387174 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem drop_drop (n m : ℕ) (s : ωSequence α) : drop n (drop m s) = drop (m + n) s := by
ext; simp [Nat.add_assoc] |
96 | leanexplore_declaration | leanexplore:387175 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_tail {n : ℕ} {s : ωSequence α} : s.tail n = s (n + 1) := rfl |
155 | leanexplore_declaration | leanexplore:387176 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem tail_drop' {i : ℕ} {s : ωSequence α} : tail (drop i s) = s.drop (i + 1) := by
ext; simp [Nat.add_comm, Nat.add_left_comm] |
110 | leanexplore_declaration | leanexplore:387177 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem drop_tail' {i : ℕ} {s : ωSequence α} : drop i (tail s) = s.drop (i + 1) := rfl |
90 | leanexplore_declaration | leanexplore:387178 | leanexplore_sqlite | leanexplore_declarations | theorem tail_drop (n : ℕ) (s : ωSequence α) : tail (drop n s) = drop n (tail s) := by simp |
77 | leanexplore_declaration | leanexplore:387179 | leanexplore_sqlite | leanexplore_declarations | theorem get_succ (n : ℕ) (s : ωSequence α) : s (succ n) = (tail s) n :=
rfl |
113 | leanexplore_declaration | leanexplore:387180 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_succ_cons (n : ℕ) (s : ωSequence α) (x : α) : (x ::ω s) n.succ = s n :=
rfl |
123 | leanexplore_declaration | leanexplore:387181 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
lemma get_cons_append_zero {a : α} {x : List α} {s : ωSequence α} :
(a :: x ++ω s) 0 = a := rfl |
102 | leanexplore_declaration | leanexplore:387182 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
lemma append_eq_cons {a : α} {as : ωSequence α} : [a] ++ω as = a ::ω as := rfl |
81 | leanexplore_declaration | leanexplore:387183 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =] theorem drop_zero {s : ωSequence α} : s.drop 0 = s := rfl |
88 | leanexplore_declaration | leanexplore:387184 | leanexplore_sqlite | leanexplore_declarations | theorem drop_succ (n : ℕ) (s : ωSequence α) : drop (succ n) s = drop n (tail s) :=
rfl |
78 | leanexplore_declaration | leanexplore:387185 | leanexplore_sqlite | leanexplore_declarations | theorem head_drop (a : ωSequence α) (n : ℕ) : (a.drop n).head = a n := by simp |
230 | leanexplore_declaration | leanexplore:387186 | leanexplore_sqlite | leanexplore_declarations | theorem cons_injective2 : Function.Injective2 (cons : α → ωSequence α → ωSequence α) :=
fun x y s t h =>
⟨by rw [← get_zero_cons x s, h, get_zero_cons],
ωSequence.ext fun n => by rw [← get_succ_cons n s x, h, get_succ_cons]⟩ |
112 | leanexplore_declaration | leanexplore:387187 | leanexplore_sqlite | leanexplore_declarations | theorem cons_injective_left (s : ωSequence α) : Function.Injective fun x => cons x s :=
cons_injective2.left _ |
112 | leanexplore_declaration | leanexplore:387189 | leanexplore_sqlite | leanexplore_declarations | theorem drop_map (n : ℕ) (s : ωSequence α) : drop n (map f s) = map f (drop n s) :=
ωSequence.ext fun _ => rfl |
98 | leanexplore_declaration | leanexplore:387190 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_map (n : ℕ) (s : ωSequence α) : (map f s) n = f (s n) :=
rfl |
75 | leanexplore_declaration | leanexplore:387191 | leanexplore_sqlite | leanexplore_declarations | theorem tail_map (s : ωSequence α) : tail (map f s) = map f (tail s) := rfl |
97 | leanexplore_declaration | leanexplore:387192 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem head_map (s : ωSequence α) : head (map f s) = f (head s) :=
rfl |
133 | leanexplore_declaration | leanexplore:387193 | leanexplore_sqlite | leanexplore_declarations | theorem map_eq (s : ωSequence α) : map f s = f (head s) ::ω map f (tail s) := by
rw [← ωSequence.eta (map f s), tail_map, head_map] |
138 | leanexplore_declaration | leanexplore:387194 | leanexplore_sqlite | leanexplore_declarations | theorem map_cons (a : α) (s : ωSequence α) : map f (a ::ω s) = f a ::ω map f s := by
rw [← ωSequence.eta (map f (a ::ω s)), map_eq]; rfl |
80 | leanexplore_declaration | leanexplore:387195 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem map_id (s : ωSequence α) : map id s = s :=
rfl |
124 | leanexplore_declaration | leanexplore:387196 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem map_map (g : β → δ) (f : α → β) (s : ωSequence α) : map g (map f s) = map (g ∘ f) s :=
rfl |
101 | leanexplore_declaration | leanexplore:387197 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem map_tail (s : ωSequence α) : map f (tail s) = tail (map f s) :=
rfl |
153 | leanexplore_declaration | leanexplore:387198 | leanexplore_sqlite | leanexplore_declarations | theorem drop_zip (n : ℕ) (s₁ : ωSequence α) (s₂ : ωSequence β) :
drop n (zip f s₁ s₂) = zip f (drop n s₁) (drop n s₂) :=
ωSequence.ext fun _ => rfl |
134 | leanexplore_declaration | leanexplore:387199 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_zip (n : ℕ) (s₁ : ωSequence α) (s₂ : ωSequence β) :
(zip f s₁ s₂) n = f (s₁ n) (s₂ n) :=
rfl |
112 | leanexplore_declaration | leanexplore:387200 | leanexplore_sqlite | leanexplore_declarations | theorem head_zip (s₁ : ωSequence α) (s₂ : ωSequence β) :
head (zip f s₁ s₂) = f (head s₁) (head s₂) :=
rfl |
116 | leanexplore_declaration | leanexplore:387201 | leanexplore_sqlite | leanexplore_declarations | theorem tail_zip (s₁ : ωSequence α) (s₂ : ωSequence β) :
tail (zip f s₁ s₂) = zip f (tail s₁) (tail s₂) :=
rfl |
172 | leanexplore_declaration | leanexplore:387202 | leanexplore_sqlite | leanexplore_declarations | theorem zip_eq (s₁ : ωSequence α) (s₂ : ωSequence β) :
zip f s₁ s₂ = f (head s₁) (head s₂) ::ω zip f (tail s₁) (tail s₂) := by
rw [← ωSequence.eta (zip f s₁ s₂)]; rfl |
105 | leanexplore_declaration | leanexplore:387203 | leanexplore_sqlite | leanexplore_declarations | theorem const_eq (a : α) : const a = a ::ω const a := by
apply ωSequence.ext; intro n
cases n <;> rfl |
156 | leanexplore_declaration | leanexplore:387204 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem tail_const (a : α) : tail (const a) = const a :=
suffices tail (a ::ω const a) = const a by rwa [← const_eq] at this
rfl |
102 | leanexplore_declaration | leanexplore:387205 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem map_const (f : α → β) (a : α) : map f (const a) = const (f a) :=
rfl |
84 | leanexplore_declaration | leanexplore:387206 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_const (n : ℕ) (a : α) : (const a) n = a :=
rfl |
119 | leanexplore_declaration | leanexplore:387207 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem drop_const (n : ℕ) (a : α) : drop n (const a) = const a :=
ωSequence.ext fun _ => rfl |
98 | leanexplore_declaration | leanexplore:387208 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem head_iterate (f : α → α) (a : α) : head (iterate f a) = a :=
rfl |
86 | leanexplore_declaration | leanexplore:387209 | leanexplore_sqlite | leanexplore_declarations | theorem get_iterate (f : α → α) (a : α) (n : ℕ) :
iterate f a n = f^[n] a :=
rfl |
186 | leanexplore_declaration | leanexplore:387210 | leanexplore_sqlite | leanexplore_declarations | theorem get_succ_iterate' (n : ℕ) (f : α → α) (a : α) :
iterate f a (succ n) = f (iterate f a n) := by
rw [get_iterate, succ_eq_add_one, add_comm, Function.iterate_add_apply]
rfl |
144 | leanexplore_declaration | leanexplore:387212 | leanexplore_sqlite | leanexplore_declarations | theorem iterate_eq (f : α → α) (a : α) : iterate f a = a ::ω iterate f (f a) := by
rw [← ωSequence.eta (iterate f a)]
rw [tail_iterate]; rfl |
99 | leanexplore_declaration | leanexplore:387213 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem get_zero_iterate (f : α → α) (a : α) : (iterate f a) 0 = a :=
rfl |
151 | leanexplore_declaration | leanexplore:387214 | leanexplore_sqlite | leanexplore_declarations | theorem get_succ_iterate (n : ℕ) (f : α → α) (a : α) :
iterate f a (succ n) = iterate f (f a) n := by
rw [get_succ n (iterate f a), tail_iterate] |
109 | leanexplore_declaration | leanexplore:387215 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem iterate_id (a : α) : iterate id a = const a := by
ext n; simp [get_iterate] |
146 | leanexplore_declaration | leanexplore:387216 | leanexplore_sqlite | leanexplore_declarations | theorem map_iterate (f : α → α) (a : α) : iterate f (f a) = map f (iterate f a) := by
ext n; rw [get_map, ← get_succ_iterate, get_succ_iterate'] |
106 | leanexplore_declaration | leanexplore:387217 | leanexplore_sqlite | leanexplore_declarations | @[simp, scoped grind =]
theorem nil_append_ωSequence (s : ωSequence α) : appendωSequence [] s = s :=
rfl |
138 | leanexplore_declaration | leanexplore:387218 | leanexplore_sqlite | leanexplore_declarations | theorem cons_append_ωSequence (a : α) (l : List α) (s : ωSequence α) :
appendωSequence (a :: l) s = a ::ω appendωSequence l s :=
rfl |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.