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
Package Registry
Model registry
Operate
Terraform modules
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
Thibaut Pérami
stdpp
Commits
2b0d874d
Commit
2b0d874d
authored
2 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Show that Pigeon hole principle on nat is a special case of the finite version.
parent
296f00b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/finite.v
+12
-0
12 additions, 0 deletions
theories/finite.v
with
12 additions
and
0 deletions
theories/finite.v
+
12
−
0
View file @
2b0d874d
...
...
@@ -427,3 +427,15 @@ Proof.
cut
(
Inj
eq
eq
f
);
[
intros
?
%
inj_card
;
lia
|]
.
intros
x1
x2
?
.
apply
dec_stable
.
naive_solver
.
Qed
.
Lemma
nat_pigeon_hole
(
f
:
nat
→
nat
)
(
n1
n2
:
nat
)
:
n2
<
n1
→
(
∀
i
,
i
<
n1
→
f
i
<
n2
)
→
∃
i1
i2
,
i1
<
i2
∧
f
i1
=
f
i2
.
Proof
.
intros
Hn
Hf
.
pose
(
f'
(
i
:
fin
n1
)
:=
nat_to_fin
(
Hf
_
(
fin_to_nat_lt
i
)))
.
destruct
(
finite_pigeon_hole
f'
)
as
(
i1
&
i2
&
Hi
&
Hf'
);
[
by
rewrite
!
fin_card
|]
.
apply
(
not_inj
(
f
:=
fin_to_nat
))
in
Hi
.
apply
(
f_equal
fin_to_nat
)
in
Hf'
.
unfold
f'
in
Hf'
.
rewrite
!
fin_to_nat_to_fin
in
Hf'
.
destruct
(
decide
(
i1
<
i2
));
[
exists
i1
,
i2
|
exists
i2
,
i1
];
lia
.
Qed
.
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