Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonas Kastberg
iris
Commits
1b4ded4d
Commit
1b4ded4d
authored
Jan 25, 2017
by
Robbert Krebbers
Browse files
Prove fixpointK stuff without unfolding the definition of fixpoint.
Also, give names to hypotheses that we refer to.
parent
49fa33d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/algebra/ofe.v
View file @
1b4ded4d
...
...
@@ -267,34 +267,35 @@ Definition fixpointK `{Cofe A, Inhabited A} k (f : A → A)
Section
fixpointK
.
Local
Set
Default
Proof
Using
"Type*"
.
Context
`
{
Cofe
A
,
Inhabited
A
}
(
f
:
A
→
A
)
k
`
{!
Contractive
(
Nat
.
iter
k
f
)}.
Context
`
{
Cofe
A
,
Inhabited
A
}
(
f
:
A
→
A
)
(
k
:
nat
).
Context
`
{
f_contractive
:
!
Contractive
(
Nat
.
iter
k
f
)}.
(* TODO: Can we get rid of this assumption, derive it from contractivity? *)
Context
`
{!
∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}.
Context
`
{
f_ne
:
!
∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}.
Let
f_proper
:
Proper
((
≡
)
==>
(
≡
))
f
:
=
ne_proper
f
.
Existing
Instance
f_proper
.
Lemma
fixpointK_unfold
:
fixpointK
k
f
≡
f
(
fixpointK
k
f
).
Proof
.
apply
equiv_dist
=>
n
.
rewrite
/
fixpointK
fixpoint_eq
/
fixpoint_def
(
conv_compl
n
(
fixpoint_chain
_
))
//.
induction
n
as
[|
n
IH
]
;
simpl
.
-
rewrite
-
Nat_iter_S
Nat_iter_S_r
.
eapply
contractive_0
;
first
done
.
-
rewrite
-[
f
_
]
Nat_iter_S
Nat_iter_S_r
.
eapply
contractive_S
;
first
done
.
eauto
.
symmetry
.
rewrite
/
fixpointK
.
apply
fixpoint_unique
.
by
rewrite
-
Nat_iter_S_r
Nat_iter_S
-
fixpoint_unfold
.
Qed
.
Lemma
fixpointK_unique
(
x
:
A
)
:
x
≡
f
x
→
x
≡
fixpointK
k
f
.
Proof
.
intros
Hf
.
apply
fixpoint_unique
,
equiv_dist
=>
n
.
(* Forward reasoning is so annoying... *)
assert
(
x
≡
{
n
}
≡
f
x
)
by
by
apply
equiv_dist
.
clear
Contractive0
.
induction
k
;
first
done
.
by
rewrite
{
1
}
Hf
{
1
}
IHn0
.
intros
Hf
.
apply
fixpoint_unique
.
clear
f_contractive
.
induction
k
as
[|
k'
IH
]=>
//=.
by
rewrite
-
IH
.
Qed
.
Section
fixpointK_ne
.
Context
(
g
:
A
→
A
)
`
{!
Contractive
(
Nat
.
iter
k
g
),
!
∀
n
,
Proper
(
dist
n
==>
dist
n
)
g
}.
Context
(
g
:
A
→
A
)
`
{
g_contractive
:
!
Contractive
(
Nat
.
iter
k
g
)}.
Context
{
g_ne
:
∀
n
,
Proper
(
dist
n
==>
dist
n
)
g
}.
Lemma
fixpointK_ne
n
:
(
∀
z
,
f
z
≡
{
n
}
≡
g
z
)
→
fixpointK
k
f
≡
{
n
}
≡
fixpointK
k
g
.
Proof
.
rewrite
/
fixpointK
=>
Hne
/=.
apply
fixpoint_ne
=>?
/=.
clear
Contractive0
Contractive1
.
induction
k
;
first
by
auto
.
simpl
.
rewrite
IHn0
.
apply
Hne
.
rewrite
/
fixpointK
=>
Hfg
/=.
apply
fixpoint_ne
=>
z
.
clear
f_contractive
g_contractive
.
induction
k
as
[|
k'
IH
]=>
//=.
by
rewrite
IH
Hfg
.
Qed
.
Lemma
fixpointK_proper
:
(
∀
z
,
f
z
≡
g
z
)
→
fixpointK
k
f
≡
fixpointK
k
g
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment