chore: fix statement of List/Array/Vector.all_filter (#7766)

This commit is contained in:
Kim Morrison 2025-04-01 14:29:53 +11:00 committed by GitHub
parent 7fefa8660e
commit cdedcf6b48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -3893,7 +3893,7 @@ theorem all_map {xs : Array α} {p : β → Bool} : (xs.map f).all p = xs.all (p
/-- Variant of `all_filter` with a side condition for the `stop` argument. -/
@[simp] theorem all_filter' {xs : Array α} {p q : α → Bool} (w : stop = (xs.filter p).size) :
(xs.filter p).all q 0 stop = xs.all fun a => p a → q a := by
(xs.filter p).all q 0 stop = xs.all fun a => !(p a) || q a := by
subst w
rcases xs with ⟨xs⟩
rw [List.filter_toArray]
@ -3904,7 +3904,7 @@ theorem any_filter {xs : Array α} {p q : α → Bool} :
simp
theorem all_filter {xs : Array α} {p q : α → Bool} :
(xs.filter p).all q 0 = xs.all fun a => p a → q a := by
(xs.filter p).all q 0 = xs.all fun a => !(p a) || q a := by
simp
/-- Variant of `any_filterMap` with a side condition for the `stop` argument. -/

View file

@ -3359,7 +3359,7 @@ theorem all_eq_not_any_not {l : List α} {p : α → Bool} : l.all p = !l.any (!
split <;> simp_all
@[simp] theorem all_filter {l : List α} {p q : α → Bool} :
(filter p l).all q = l.all fun a => p a → q a := by
(filter p l).all q = l.all fun a => !(p a) || q a := by
induction l with
| nil => rfl
| cons h t ih =>

View file

@ -2783,7 +2783,7 @@ theorem any_eq_not_all_not {xs : Vector α n} {p : α → Bool} : xs.any p = !xs
simp
@[simp] theorem all_filter {xs : Vector α n} {p q : α → Bool} :
(xs.filter p).all q = xs.all fun a => p a → q a := by
(xs.filter p).all q = xs.all fun a => !(p a) || q a := by
rcases xs with ⟨xs, rfl⟩
simp