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
R
rt-proofs
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sophie Quinton
rt-proofs
Commits
d73b801d
Commit
d73b801d
authored
Jan 10, 2017
by
Felipe Cerqueira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement simple version of k-min
parent
e0e0bc7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
util/minmax.v
util/minmax.v
+31
-1
No files found.
util/minmax.v
View file @
d73b801d
...
...
@@ -570,4 +570,34 @@ Section ExtraLemmas.
}
Qed
.
End
ExtraLemmas
.
\ No newline at end of file
End
ExtraLemmas
.
Section
Kmin
.
Context
{
T1
T2
:
eqType
}.
Variable
rel
:
T2
->
T2
->
bool
.
Variable
F
:
T1
->
T2
.
Fixpoint
seq_argmin_k
(
l
:
seq
T1
)
(
k
:
nat
)
:
=
if
k
is
S
k'
then
if
(
seq_argmin
rel
F
l
)
is
Some
min_x
then
let
l_without_min
:
=
rem
min_x
l
in
min_x
::
seq_argmin_k
l_without_min
k'
else
[
::
]
else
[
::
].
Lemma
seq_argmin_k_exists
:
forall
k
l
x
,
k
>
0
->
x
\
in
l
->
seq_argmin_k
l
k
!=
[
::
].
Proof
.
induction
k
;
first
by
done
.
move
=>
l
x
_
IN
/=.
destruct
(
seq_argmin
rel
F
l
)
as
[|]
eqn
:
MIN
;
first
by
done
.
suff
NOTNONE
:
seq_argmin
rel
F
l
!=
None
by
rewrite
MIN
in
NOTNONE
.
by
apply
seq_argmin_exists
with
(
x0
:
=
x
).
Qed
.
End
Kmin
.
\ No newline at end of file
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