Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stdpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Spies
stdpp
Commits
b37d0fec
Commit
b37d0fec
authored
Aug 08, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some general stuff about fin.
parent
10a74299
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
theories/vector.v
theories/vector.v
+28
-2
No files found.
theories/vector.v
View file @
b37d0fec
...
...
@@ -69,12 +69,13 @@ Ltac inv_fin i :=
revert
dependent
i
;
match
goal
with
|-
∀
i
,
@
?P
i
=>
apply
(
fin_S_inv
P
)
end
end
.
Instance
:
Inj
(=)
(=)
(@
FS
n
).
Instance
FS_inj
:
Inj
(=)
(=)
(@
FS
n
).
Proof
.
intros
n
i
j
.
apply
Fin
.
FS_inj
.
Qed
.
Instance
:
Inj
(=)
(=)
(@
fin_to_nat
n
).
Instance
fin_to_nat_inj
:
Inj
(=)
(=)
(@
fin_to_nat
n
).
Proof
.
intros
n
i
.
induction
i
;
intros
j
;
inv_fin
j
;
intros
;
f_equal
/=
;
auto
with
lia
.
Qed
.
Lemma
fin_to_nat_lt
{
n
}
(
i
:
fin
n
)
:
fin_to_nat
i
<
n
.
Proof
.
induction
i
;
simpl
;
lia
.
Qed
.
Lemma
fin_to_of_nat
n
m
(
H
:
n
<
m
)
:
fin_to_nat
(
Fin
.
of_nat_lt
H
)
=
n
.
...
...
@@ -82,6 +83,31 @@ Proof.
revert
m
H
.
induction
n
;
intros
[|?]
;
simpl
;
auto
;
intros
;
exfalso
;
lia
.
Qed
.
Fixpoint
fin_plus_inv
{
n1
n2
}
:
∀
(
P
:
fin
(
n1
+
n2
)
→
Type
)
(
H1
:
∀
i1
:
fin
n1
,
P
(
Fin
.
L
n2
i1
))
(
H2
:
∀
i2
,
P
(
Fin
.
R
n1
i2
))
(
i
:
fin
(
n1
+
n2
)),
P
i
:
=
match
n1
with
|
0
=>
λ
P
H1
H2
i
,
H2
i
|
S
n
=>
λ
P
H1
H2
,
fin_S_inv
P
(
H1
0
%
fin
)
(
fin_plus_inv
_
(
λ
i
,
H1
(
FS
i
))
H2
)
end
.
Lemma
fin_plus_inv_L
{
n1
n2
}
(
P
:
fin
(
n1
+
n2
)
→
Type
)
(
H1
:
∀
i1
:
fin
n1
,
P
(
Fin
.
L
_
i1
))
(
H2
:
∀
i2
,
P
(
Fin
.
R
_
i2
))
(
i
:
fin
n1
)
:
fin_plus_inv
P
H1
H2
(
Fin
.
L
n2
i
)
=
H1
i
.
Proof
.
revert
P
H1
H2
i
.
induction
n1
as
[|
n1
IH
]
;
intros
P
H1
H2
i
;
inv_fin
i
;
simpl
;
auto
.
intros
i
.
apply
(
IH
(
λ
i
,
P
(
FS
i
))).
Qed
.
Lemma
fin_plus_inv_R
{
n1
n2
}
(
P
:
fin
(
n1
+
n2
)
→
Type
)
(
H1
:
∀
i1
:
fin
n1
,
P
(
Fin
.
L
_
i1
))
(
H2
:
∀
i2
,
P
(
Fin
.
R
_
i2
))
(
i
:
fin
n2
)
:
fin_plus_inv
P
H1
H2
(
Fin
.
R
n1
i
)
=
H2
i
.
Proof
.
revert
P
H1
H2
i
;
induction
n1
as
[|
n1
IH
]
;
intros
P
H1
H2
i
;
simpl
;
auto
.
apply
(
IH
(
λ
i
,
P
(
FS
i
))).
Qed
.
(** * Vectors *)
(** The type [vec n] represents lists of consisting of exactly [n] elements.
Whereas the standard library declares exactly the same notations for vectors as
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment