Skip to content

Commit

Permalink
chore: missing List.set_replicate_self (#5460)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em authored Sep 25, 2024
1 parent a4fb740 commit c7819bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Init/Data/List/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c7819bd

Please sign in to comment.