Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Viguier
coq-verif-tweetnacl
Commits
a548d904
Commit
a548d904
authored
Jun 29, 2017
by
Benoit Viguier
Browse files
More silly lemmas
parent
a9bd2e81
Changes
3
Hide whitespace changes
Inline
Side-by-side
Libs/Lists_extended.v
View file @
a548d904
...
...
@@ -9,6 +9,23 @@ Lemma nth_drop : forall A (n:nat) (l:list A) (d: A), n < length l -> drop n l =
Proof
.
induction
n
;
destr_boum
l
.
Qed
.
Arguments
nth_drop
[
A
]
_
_
_
_.
Lemma
take_drop_length
:
forall
A
(
n
:
nat
)
(
l
l
'
:
list
A
),
length
l
=
length
l
'
->
length
(
take
n
l
++
drop
n
l
'
)
=
length
l
.
Proof
.
intros
A
n
l
l
'
Hll
'
.
assert
(
H
:
n
<
length
l
\
/
length
l
<=
n
)
by
omega
.
destruct
H
;
rewrite
app_length
;
rewrite
drop_length
;
rewrite
<-
Hll
'
;
[
rewrite
take_length_le
|
rewrite
take_length_ge
]
;
omega
.
Qed
.
Arguments
take_drop_length
[
A
]
_
_
_.
Lemma
nth_take
:
forall
A
(
n
:
nat
)
(
l
l
'
:
list
A
)
d
,
n
<=
length
l
->
nth
n
((
take
n
l
)
++
l
'
)
d
=
nth
0
l
'
d
.
Proof
.
induction
n
;
destr_boum
l
.
Qed
.
Arguments
nth_take
[
A
]
_
_
_
_
_.
Lemma
nth_drop_2
:
forall
A
(
n
:
nat
)
(
l
:
list
A
)
(
d
:
A
),
n
<=
length
l
->
nth
n
l
d
=
nth
0
(
drop
n
l
)
d
.
Proof
.
induction
n
;
destr_boum
l
.
Qed
.
Arguments
nth_drop
[
A
]
_
_
_.
(
*
Lemma
app_nill_r
:
forall
(
A
:
Type
)
(
l
:
list
A
),
l
++
nil
=
l
.
Proof
.
boum
.
Qed
.
...
...
Makefile
View file @
a548d904
...
...
@@ -84,7 +84,7 @@ FILES = \
$
(
LISTSOP_FILES:%
=
ListsOp/%
)
\
$
(
OP_FILES:%
=
Op/%
)
\
$
(
CAR_FILES:%
=
Car/%
)
\
$
(
SEL_FILES:%
=
Car
/%
)
\
$
(
SEL_FILES:%
=
Sel
/%
)
\
ifneq
($(filter-out archclean clean cleanall printenv,$(MAKECMDGOALS)),)
-include
$(addsuffix .d,$(FILES))
...
...
Sel/Sel25519.v
View file @
a548d904
...
...
@@ -11,14 +11,18 @@ Definition list_cswap (b:Z) (p q : list Z) : list Z :=
Lemma
list_cswap_nth_true
:
forall
i
d
p
q
,
nth
i
(
list_cswap
1
p
q
)
d
=
nth
i
q
d
.
Proof
.
intros
.
go
.
Qed
.
Proof
.
go
.
Qed
.
Lemma
list_cswap_nth_false
:
forall
i
d
p
q
,
nth
i
(
list_cswap
0
p
q
)
d
=
nth
i
p
d
.
Proof
.
intros
.
go
.
Qed
.
Proof
.
go
.
Qed
.
Lemma
list_cswap_length_eq
:
forall
b
p
q
,
length
p
=
length
q
->
length
p
=
length
(
list_cswap
b
p
q
).
Proof
.
intros
;
unfold
list_cswap
;
destruct
(
Z
.
eqb
b
0
);
go
.
Qed
.
Lemma
list_cswap_Zlength_eq
:
forall
b
p
q
,
Zlength
p
=
Zlength
q
->
Zlength
p
=
Zlength
(
list_cswap
b
p
q
).
Proof
.
intros
;
unfold
list_cswap
;
destruct
(
Z
.
eqb
b
0
);
go
.
Qed
.
Close
Scope
Z
.
\ No newline at end of file
Write
Preview
Supports
Markdown
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