Add `filter_reverse`, `head_filter_Some`, `last_filter_Some` lemmas
Added the lemma:
Lemma last_filter_postfix P `{!∀ x : A, Decision (P x)} l x
last (filter P l) = Some x →
∃ l1 l2, l = l1 ++ [x] ++ l2 ∧ Forall (λ z, ¬ (P z)) l2.
(and its counterpart for head
)
The lemmas seem useful and general enough to fit in stdpp.
The last
lemma derives the property Forall (λ z, ¬ (P z)) l2
of the postfix of a split l1 ++ [x] ++ l2
for a list l
whenever last (filter P l) = Some x
.
Edited by Robbert Krebbers
Merge request reports
Activity
- Resolved by Jonas Kastberg
- Resolved by Jonas Kastberg
- Resolved by Jonas Kastberg
- Resolved by Jonas Kastberg
Thanks for the MR. Could you split it up into two parts:
- One for the general lemmas about
last
(which I think are good, modulo comments). - One for the interaction of
filter
andlast
(we might need some additional debating there as you already guessed ).
Edited by Robbert Krebbers- One for the general lemmas about
added 1 commit
- f491810c - Some improvements for proposed lemmas and added [last_app]
mentioned in merge request !355 (merged)
added 9 commits
-
f8144839...f23a05c3 - 6 commits from branch
iris:master
- da8c8ad2 - Added some useful lemmas for the [last] function
- 1f8670d7 - Added [last_filter_postfix] lemma
- e964b0a5 - Fixed duplicate lemma from merge
Toggle commit list-
f8144839...f23a05c3 - 6 commits from branch
- Resolved by Jonas Kastberg
- Resolved by Jonas Kastberg
added 1 commit
- c5900b79 - Added [head_filter_prefix] lemma, and dependencies
- Resolved by Jonas Kastberg
added 1 commit
- fe795bf4 - Moved the [head_filter_prefix] and [last_filter_postfix] lemmas
Please register or sign in to reply