Compare commits

...

2 Commits

Author SHA1 Message Date
Kim Morrison
da4639ea62 oops 2024-08-27 08:34:31 +10:00
Kim Morrison
a0d29df9f5 chore: better statement for List.find?_filterMap 2024-08-27 08:33:20 +10:00
2 changed files with 2 additions and 3 deletions

View File

@@ -547,7 +547,7 @@ theorem apply_cond (f : α → β) {b : Bool} {a a' : α} :
f (bif b then a else a') = bif b then f a else f a' := by
cases b <;> simp
/-# decidability -/
/-! # decidability -/
protected theorem decide_coe (b : Bool) [Decidable (b = true)] : decide (b = true) = b := decide_eq_true

View File

@@ -257,8 +257,7 @@ theorem mem_of_find?_eq_some : ∀ {l}, find? p l = some a → a ∈ l
simp
@[simp] theorem find?_filterMap (xs : List α) (f : α Option β) (p : β Bool) :
List.find? p (List.filterMap f xs) =
(xs.find? (fun a => match f a with | none => false | some b => p b)).bind f := by
(xs.filterMap f).find? p = (xs.find? (fun a => (f a).any p)).bind f := by
induction xs with
| nil => simp
| cons x xs ih =>