chore: missing Option lemma (#9028)

This commit is contained in:
Kim Morrison 2025-06-27 17:28:59 +10:00 committed by GitHub
parent 0aca10b228
commit 8d40cf5157
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -645,6 +645,10 @@ theorem get_none_eq_iff_true {h} : (none : Option α).get h = a ↔ True := by
simp only [guard]
split <;> simp
@[grind =] theorem getD_guard : (guard p a).getD b = if p a then a else b := by
simp only [guard]
split <;> simp
@[grind]
theorem guard_def (p : α → Bool) :
Option.guard p = fun x => if p x then some x else none := rfl