Skip to content

Commit

Permalink
feat: Array lemma for empty map added (#877)
Browse files Browse the repository at this point in the history
Co-authored-by: François G. Dorais <fgdorais@gmail.com>
  • Loading branch information
Shreyas4991 and fgdorais committed Jul 19, 2024
1 parent f27beb1 commit ac82ca1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Batteries/Data/Array/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,10 @@ theorem size_shrink_loop (a : Array α) (n) : (shrink.loop n a).size = a.size -
theorem size_shrink (a : Array α) (n) : (a.shrink n).size = min a.size n := by
simp [shrink, size_shrink_loop]
omega

/-! ### map -/

theorem mapM_empty [Monad m] (f : α → m β) : mapM f #[] = pure #[] := by
rw [mapM, mapM.map]; rfl

@[simp] theorem map_empty (f : α → β) : map f #[] = #[] := mapM_empty ..

0 comments on commit ac82ca1

Please sign in to comment.