Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S stdpp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 81
    • Issues 81
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Iris
  • stdpp
  • Merge requests
  • !353

Add `filter_reverse`, `head_filter_Some`, `last_filter_Some` lemmas

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jonas Kastberg requested to merge jihgfee/stdpp:last_filter_postfix into master Jan 07, 2022
  • Overview 16
  • Commits 6
  • Pipelines 14
  • Changes 1

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 Jan 19, 2022 by Robbert Krebbers
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: last_filter_postfix