chore: missing List.set_replicate_self (#5460)

This commit is contained in:
Kim Morrison 2024-09-25 11:15:24 +10:00 committed by GitHub
parent a4fb740d2f
commit c7819bd6eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2392,6 +2392,12 @@ theorem map_eq_replicate_iff {l : List α} {f : α → β} {b : β} :
theorem map_const' (l : List α) (b : β) : map (fun _ => b) l = replicate l.length b :=
map_const l b
@[simp] theorem set_replicate_self : (replicate n a).set i a = replicate n a := by
apply ext_getElem
· simp
· intro i h₁ h₂
simp [getElem_set]
@[simp] theorem append_replicate_replicate : replicate n a ++ replicate m a = replicate (n + m) a := by
rw [eq_replicate_iff]
constructor