Skip to content

Commit

Permalink
feat: size lemma for Array.set! (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgdorais authored Sep 9, 2024
1 parent e0017bd commit 1a28ab0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Batteries/Data/Array/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ theorem size_shrink (a : Array α) (n) : (a.shrink n).size = min a.size n := by
simp [shrink, size_shrink_loop]
omega

/-! ### set -/

theorem size_set! (a : Array α) (i v) : (a.set! i v).size = a.size := by
rw [set!_is_setD, size_setD]

/-! ### map -/

theorem mapM_empty [Monad m] (f : α → m β) : mapM f #[] = pure #[] := by
Expand Down

0 comments on commit 1a28ab0

Please sign in to comment.