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
Open sidebar
Sophie Quinton
rt-proofs
Commits
5d02df7f
Commit
5d02df7f
authored
Aug 22, 2016
by
Felipe Cerqueira
Browse files
Add lemmas about iter_fixpoint
parent
d3d75a3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
2 deletions
+44
-2
util/fixedpoint.v
util/fixedpoint.v
+44
-2
No files found.
util/fixedpoint.v
View file @
5d02df7f
...
...
@@ -72,6 +72,19 @@ Section FixedPoint.
End
FixedPoint
.
(* In this section, we define some properties of relations
that are important for fixed-point iterations. *)
Section
Relations
.
Context
{
T
:
Type
}.
Variable
R
:
rel
T
.
Variable
f
:
T
->
T
.
Definition
monotone
(
R
:
rel
T
)
:
=
forall
x
y
,
R
x
y
->
R
(
f
x
)
(
f
y
).
End
Relations
.
(* In this section we define a fixed-point iteration function
that stops as soon as it finds the solution. If no solution
is found, the function returns None. *)
...
...
@@ -88,7 +101,7 @@ Section Iteration.
else
iter_fixpoint
step
x'
else
None
.
Section
Lemmas
.
Section
Basic
Lemmas
.
(* We prove that iter_fixpoint either returns either None
or Some y, where y is a fixed point. *)
...
...
@@ -111,6 +124,35 @@ Section Iteration.
}
Qed
.
End
Lemmas
.
End
BasicLemmas
.
Section
RelationLemmas
.
Variable
R
:
rel
T
.
Hypothesis
H_reflexive
:
reflexive
R
.
Hypothesis
H_transitive
:
transitive
R
.
Hypothesis
H_monotone
:
monotone
f
R
.
Lemma
iter_fixpoint_ge_min
:
forall
max_steps
x0
x
,
iter_fixpoint
max_steps
x0
=
Some
x
->
R
x0
(
f
x0
)
->
R
x0
x
.
Proof
.
induction
max_steps
.
{
intros
x0
x
SOME
MIN
;
first
by
done
.
}
{
intros
x0
x
SOME
MIN
;
simpl
in
SOME
.
destruct
(
x0
==
f
x0
)
eqn
:
EQ1
;
first
by
inversion
SOME
;
apply
H_reflexive
.
apply
IHmax_steps
in
SOME
;
first
by
apply
H_transitive
with
(
y
:
=
f
x0
).
by
apply
H_monotone
.
}
Qed
.
End
RelationLemmas
.
End
Iteration
.
\ 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