batteries icon indicating copy to clipboard operation
batteries copied to clipboard

feat: `List.forall_get_iff_forall_mem `

Open Qiu233 opened this issue 1 year ago • 3 comments

theorem forall_mem_iff_forall_index [DecidableEq α] {p : α → Prop} {l : List α} :
  (∀ x ∈ l, p x) ↔ (∀ i : Fin (l.length), p (l.get i))

is trivial but sometimes useful.

Qiu233 avatar Mar 04 '24 15:03 Qiu233

awaiting-review

Qiu233 avatar Mar 04 '24 15:03 Qiu233

I usually obtain the headline theorem using simp [List.mem_iff_get]. The other stuff is more API surface that should probably be considered in its own PR.

digama0 avatar Mar 04 '24 18:03 digama0

I usually obtain the headline theorem using simp [List.mem_iff_get]. The other stuff is more API surface that should probably be considered in its own PR.

Sorry I didn't find this theorem. Now other stuff has been removed.

Qiu233 avatar Mar 04 '24 23:03 Qiu233