Skip to content

Commit 7a60b31

Browse files
committed
feat: add getD_comp_some lemma for Option type (#31828)
Adds a simp lemma that allows this expression to be simplified, even if it isn't applied to an argument. Identified in google-deepmind/formal-conjectures#1120
1 parent 6bbd26f commit 7a60b31

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Mathlib/Data/Option/Basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,9 @@ lemma elim'_update {α : Type*} {β : Type*} [DecidableEq α]
233233
| _, _, some _, h => (h _ rfl).elim
234234
| _, _, none, _ => rfl) _ _ _
235235

236+
@[simp]
237+
lemma getD_comp_some (d : α) : (fun x ↦ x.getD d) ∘ some = id := by
238+
ext
239+
simp only [Function.comp_apply, getD_some, id_eq]
240+
236241
end Option

0 commit comments

Comments
 (0)