Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROSA - Formally Proven Schedulability Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
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
RT-PROOFS
PROSA - Formally Proven Schedulability Analysis
Commits
a4d57101
Commit
a4d57101
authored
5 years ago
by
Sergey Bozhko
Browse files
Options
Downloads
Patches
Plain Diff
Add lemmas about ex_minn
parent
80bd79d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!43
Port non-seq aRTA
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
util/search_arg.v
+36
-2
36 additions, 2 deletions
util/search_arg.v
with
36 additions
and
2 deletions
util/search_arg.v
+
36
−
2
View file @
a4d57101
...
...
@@ -15,8 +15,9 @@ From rt.util Require Import tactics.
*)
Section
ArgSearch
.
(* Given a function [f] that maps the naturals to elements of type [T]... *)
Context
{
T
:
Type
}
.
Context
{
T
:
Type
}
.
Variable
f
:
nat
->
T
.
(* ... a predicate [P] on [T] ... *)
...
...
@@ -28,7 +29,7 @@ Section ArgSearch.
(* ... we define the procedure [search_arg] to iterate a given search space
[a, b), while checking each element whether [f] satisfies [P] at that
point and returning the extremum as defined by [R]. *)
Fixpoint
search_arg
(
a
b
:
nat
):
option
nat
:=
Fixpoint
search_arg
(
a
b
:
nat
)
:
option
nat
:=
if
a
<
b
then
match
b
with
|
0
=>
None
...
...
@@ -202,3 +203,36 @@ Section ArgSearch.
Qed
.
End
ArgSearch
.
Section
ExMinn
.
(* We show that the fact that the minimal satisfying argument [ex_minn ex] of
a predicate [pred] satisfies another predicate [P] implies the existence
of a minimal element that satisfies both [pred] and [P]. *)
Lemma
prop_on_ex_minn
:
forall
(
P
:
nat
->
Prop
)
(
pred
:
nat
->
bool
)
(
ex
:
exists
n
,
pred
n
),
P
(
ex_minn
ex
)
->
exists
n
,
P
n
/\
pred
n
/\
(
forall
n'
,
pred
n'
->
n
<=
n'
)
.
Proof
.
intros
.
exists
(
ex_minn
ex
);
repeat
split
;
auto
.
all
:
have
MIN
:=
ex_minnP
ex
;
move
:
MIN
=>
[
n
Pn
MIN
];
auto
.
Qed
.
(* As a corollary, we show that if there is a constant [c] such
that [P c], then the minimal satisfying argument [ex_minn ex]
of a predicate [P] is less than or equal to [c]. *)
Corollary
ex_minn_le_ex
:
forall
(
P
:
nat
->
bool
)
(
exP
:
exists
n
,
P
n
)
(
c
:
nat
),
P
c
->
ex_minn
exP
<=
c
.
Proof
.
intros
?
?
?
EX
.
rewrite
leqNgt
;
apply
/
negP
;
intros
GT
.
pattern
(
ex_minn
(
P
:=
P
)
exP
)
in
GT
;
apply
prop_on_ex_minn
in
GT
;
move
:
GT
=>
[
n
[
LT
[
Pn
MIN
]]]
.
specialize
(
MIN
c
EX
)
.
by
move
:
MIN
;
rewrite
leqNgt
;
move
=>
/
negP
MIN
;
apply
:
MIN
.
Qed
.
End
ExMinn
.
\ No newline at end of file
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