Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Botsch Nielsen
stdpp
Commits
453f5e30
Commit
453f5e30
authored
6 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Add distributive laws for multisets.
parent
47d57144
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/gmultiset.v
+33
-0
33 additions, 0 deletions
theories/gmultiset.v
with
33 additions
and
0 deletions
theories/gmultiset.v
+
33
−
0
View file @
453f5e30
...
...
@@ -169,6 +169,21 @@ Proof.
intros
X
.
apply
gmultiset_eq
;
intros
x
.
rewrite
!
multiplicity_intersection
;
lia
.
Qed
.
Lemma
gmultiset_union_intersection_l
X
Y
Z
:
X
∪
(
Y
∩
Z
)
=
(
X
∪
Y
)
∩
(
X
∪
Z
)
.
Proof
.
apply
gmultiset_eq
;
intros
y
.
rewrite
multiplicity_union
,
!
multiplicity_intersection
,
!
multiplicity_union
.
lia
.
Qed
.
Lemma
gmultiset_union_intersection_r
X
Y
Z
:
(
X
∩
Y
)
∪
Z
=
(
X
∪
Z
)
∩
(
Y
∪
Z
)
.
Proof
.
by
rewrite
<-!
(
comm_L
_
Z
),
gmultiset_union_intersection_l
.
Qed
.
Lemma
gmultiset_intersection_union_l
X
Y
Z
:
X
∩
(
Y
∪
Z
)
=
(
X
∩
Y
)
∪
(
X
∩
Z
)
.
Proof
.
apply
gmultiset_eq
;
intros
y
.
rewrite
multiplicity_union
,
!
multiplicity_intersection
,
!
multiplicity_union
.
lia
.
Qed
.
Lemma
gmultiset_intersection_union_r
X
Y
Z
:
(
X
∪
Y
)
∩
Z
=
(
X
∩
Z
)
∪
(
Y
∩
Z
)
.
Proof
.
by
rewrite
<-!
(
comm_L
_
Z
),
gmultiset_intersection_union_l
.
Qed
.
(** For disjoint union (aka sum) *)
Global
Instance
gmultiset_disj_union_comm
:
Comm
(
=@
{
gmultiset
A
})
(
⊎
)
.
Proof
.
...
...
@@ -194,6 +209,24 @@ Qed.
Global
Instance
gmultiset_disj_union_inj_2
X
:
Inj
(
=
)
(
=
)
(
⊎
X
)
.
Proof
.
intros
Y1
Y2
.
rewrite
<-!
(
comm_L
_
X
)
.
apply
(
inj
_)
.
Qed
.
Lemma
gmultiset_disj_union_intersection_l
X
Y
Z
:
X
⊎
(
Y
∩
Z
)
=
(
X
⊎
Y
)
∩
(
X
⊎
Z
)
.
Proof
.
apply
gmultiset_eq
;
intros
y
.
rewrite
multiplicity_disj_union
,
!
multiplicity_intersection
,
!
multiplicity_disj_union
.
lia
.
Qed
.
Lemma
gmultiset_disj_union_intersection_r
X
Y
Z
:
(
X
∩
Y
)
⊎
Z
=
(
X
⊎
Z
)
∩
(
Y
⊎
Z
)
.
Proof
.
by
rewrite
<-!
(
comm_L
_
Z
),
gmultiset_disj_union_intersection_l
.
Qed
.
Lemma
gmultiset_disj_union_union_l
X
Y
Z
:
X
⊎
(
Y
∪
Z
)
=
(
X
⊎
Y
)
∪
(
X
⊎
Z
)
.
Proof
.
apply
gmultiset_eq
;
intros
y
.
rewrite
multiplicity_disj_union
,
!
multiplicity_union
,
!
multiplicity_disj_union
.
lia
.
Qed
.
Lemma
gmultiset_disj_union_union_r
X
Y
Z
:
(
X
∪
Y
)
⊎
Z
=
(
X
⊎
Z
)
∪
(
Y
⊎
Z
)
.
Proof
.
by
rewrite
<-!
(
comm_L
_
Z
),
gmultiset_disj_union_union_l
.
Qed
.
(** Misc *)
Lemma
gmultiset_non_empty_singleton
x
:
{[
x
]}
≠@
{
gmultiset
A
}
∅.
Proof
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment