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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
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
Iris
stdpp
Commits
f59a2c06
Commit
f59a2c06
authored
4 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Plain Diff
Merge branch 'injective_finite' into 'master'
surjective_finite See merge request
!238
parents
b2c5f1fe
57c98ce1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!238
surjective_finite
Pipeline
#43850
passed
4 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/finite.v
+16
-5
16 additions, 5 deletions
theories/finite.v
with
16 additions
and
5 deletions
theories/finite.v
+
16
−
5
View file @
f59a2c06
...
@@ -220,15 +220,26 @@ Section enc_finite.
...
@@ -220,15 +220,26 @@ Section enc_finite.
Proof
.
unfold
card
.
simpl
.
by
rewrite
fmap_length
,
seq_length
.
Qed
.
Proof
.
unfold
card
.
simpl
.
by
rewrite
fmap_length
,
seq_length
.
Qed
.
End
enc_finite
.
End
enc_finite
.
Section
surjective_finite
.
Context
`{
Finite
A
,
EqDecision
B
}
(
f
:
A
→
B
)
.
Context
`{
!
Surj
(
=
)
f
}
.
Program
Instance
surjective_finite
:
Finite
B
:=
{|
enum
:=
remove_dups
(
f
<$>
enum
A
)
|}
.
Next
Obligation
.
apply
NoDup_remove_dups
.
Qed
.
Next
Obligation
.
intros
y
.
rewrite
elem_of_remove_dups
,
elem_of_list_fmap
.
destruct
(
surj
f
y
)
.
eauto
using
elem_of_enum
.
Qed
.
End
surjective_finite
.
Section
bijective_finite
.
Section
bijective_finite
.
Context
`{
Finite
A
,
EqDecision
B
}
(
f
:
A
→
B
)
(
g
:
B
→
A
)
.
Context
`{
Finite
A
,
EqDecision
B
}
(
f
:
A
→
B
)
(
g
:
B
→
A
)
.
Context
`{
!
Inj
(
=
)
(
=
)
f
,
!
Cancel
(
=
)
f
g
}
.
Context
`{
!
Inj
(
=
)
(
=
)
f
,
!
Cancel
(
=
)
f
g
}
.
Program
Instance
bijective_finite
:
Finite
B
:=
{|
enum
:=
f
<$>
enum
A
|}
.
Global
Instance
bijective_finite
:
Finite
B
:=
Next
Obligation
.
apply
(
NoDup_fmap_2
_),
NoDup_enum
.
Qed
.
let
_
:=
cancel_surj
(
f
:=
f
)
(
g
:=
g
)
in
Next
Obligation
.
surjective_finite
f
.
intros
y
.
rewrite
elem_of_list_fmap
.
eauto
using
elem_of_enum
.
Qed
.
End
bijective_finite
.
End
bijective_finite
.
Program
Instance
option_finite
`{
Finite
A
}
:
Finite
(
option
A
)
:=
Program
Instance
option_finite
`{
Finite
A
}
:
Finite
(
option
A
)
:=
...
...
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