Skip to content
Snippets Groups Projects

gmultiset lemmas

Merged Dan Frumin requested to merge dfrumin/coq-stdpp:gmultiset_lemmas into master

Merge request reports

Approval is optional

Merged by Robbert KrebbersRobbert Krebbers 6 years ago (Apr 19, 2019 3:49pm UTC)

Merge details

  • Changes merged into master with a8e9b673 (commits were squashed).
  • Deleted the source branch.

Pipeline #16151 passed

Pipeline passed for a8e9b673 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Thanks for the MR. Looks good apart from the nits.

  • Dan Frumin added 1 commit

    added 1 commit

    • a41a00fd - [gmultiset.v] Make use of `foldr_permutation_proper`.

    Compare with previous version

  • Dan Frumin added 1 commit

    added 1 commit

    • 90c03053 - Move out a `Proper ((≡ₚ) ==> R)` instace for `foldr`.

    Compare with previous version

  • Dan Frumin resolved all discussions

    resolved all discussions

  • Dan Frumin added 1 commit

    added 1 commit

    • 87c732fc - Simplify the proof of `gmultiset_set_fold_disj_union`.

    Compare with previous version

  • Robbert Krebbers resolved all discussions

    resolved all discussions

  • I think we should back port these lemmas to finite sets too.

    Not sure if that's a job for this MR or not?

  • Dan Frumin added 1 commit

    added 1 commit

    • 765e544c - Add `elements_disj_union` and `set_fold` lemmas.

    Compare with previous version

  • Author Contributor

    i've added the corresponding lemmas for finite sets. I don't really know where to put the elements_disj_union lemma. I proved it using set_ind induction. But for set_ind you need lemmas about the size function, and for those you need some elements lemmas.

  • 200 200 Proof. apply set_ind. by intros ?? ->%leibniz_equiv_iff. Qed.
    201 201
    202 202 (** * The [set_fold] operation *)
    203 Lemma elements_disj_union (X Y : C) :
    204 X ## Y elements (X Y) elements X ++ elements Y.
    205 Proof.
    206 generalize dependent X.
  • i've added the corresponding lemmas for finite sets.

    Thank you very much!

    I don't really know where to put the elements_disj_union lemma. I proved it using set_ind induction. But for set_ind you need lemmas about the size function, and for those you need some elements lemmas

    I see, that's annoying. Not sure there is a proper solution for that. I guess what you've done makes sense.

  • Here's a shorter proof that does not use set_ind:

    Lemma elements_disj_union (X Y : C) :
      X ## Y  elements (X  Y)  elements X ++ elements Y.
    Proof.
      intros HXY. apply NoDup_Permutation.
      - apply NoDup_elements.
      - apply NoDup_app. set_solver by eauto using NoDup_elements.
      - set_solver.
    Qed.
  • Dan Frumin added 1 commit

    added 1 commit

    • 3521f39b - Add `elements_disj_union` and `set_fold` lemmas.

    Compare with previous version

  • LGTM! Will merge.

    Thank you very much for incorporating my suggestions.

  • mentioned in commit a8e9b673

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading