Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
William Mansky
Iris
Commits
f9bc9466
Commit
f9bc9466
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
generalize fixpoint from f^2 contractive to f^k contractive
parent
f351a117
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/algebra/ofe.v
+23
-21
23 additions, 21 deletions
theories/algebra/ofe.v
with
23 additions
and
21 deletions
theories/algebra/ofe.v
+
23
−
21
View file @
f9bc9466
...
@@ -261,44 +261,46 @@ Section fixpoint.
...
@@ -261,44 +261,46 @@ Section fixpoint.
Qed
.
Qed
.
End
fixpoint
.
End
fixpoint
.
(** Fixpoint of f when f^2 is contractive. **)
(** Fixpoint of f when f^k is contractive. **)
(* TODO: Generalize 2 to m. *)
Definition
fixpointK
`{
Cofe
A
,
Inhabited
A
}
k
(
f
:
A
→
A
)
Definition
fixpoint2
`{
Cofe
A
,
Inhabited
A
}
(
f
:
A
→
A
)
`{
!
Contractive
(
Nat
.
iter
k
f
)}
:=
fixpoint
(
Nat
.
iter
k
f
)
.
`{
!
Contractive
(
Nat
.
iter
2
f
)}
:=
fixpoint
(
Nat
.
iter
2
f
)
.
Section
fixpoint
2
.
Section
fixpoint
K
.
Local
Set
Default
Proof
Using
"Type*"
.
Local
Set
Default
Proof
Using
"Type*"
.
Context
`{
Cofe
A
,
Inhabited
A
}
(
f
:
A
→
A
)
`{
!
Contractive
(
Nat
.
iter
2
f
)}
.
Context
`{
Cofe
A
,
Inhabited
A
}
(
f
:
A
→
A
)
k
`{
!
Contractive
(
Nat
.
iter
k
f
)}
.
(* TODO: Can we get rid of this assumption, derive it from contractivity? *)
(* TODO: Can we get rid of this assumption, derive it from contractivity? *)
Context
`{
!∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}
.
Context
`{
!∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}
.
Lemma
fixpoint
2
_unfold
:
fixpoint
2
f
≡
f
(
fixpoint
2
f
)
.
Lemma
fixpoint
K
_unfold
:
fixpoint
K
k
f
≡
f
(
fixpoint
K
k
f
)
.
Proof
.
Proof
.
apply
equiv_dist
=>
n
.
apply
equiv_dist
=>
n
.
rewrite
/
fixpoint
2
fixpoint_eq
/
fixpoint_def
(
conv_compl
n
(
fixpoint_chain
_))
//.
rewrite
/
fixpoint
K
fixpoint_eq
/
fixpoint_def
(
conv_compl
n
(
fixpoint_chain
_))
//.
induction
n
as
[|
n
IH
];
simpl
.
induction
n
as
[|
n
IH
];
simpl
.
-
eapply
contractive_0
with
(
f0
:=
Nat
.
iter
2
f
)
.
done
.
-
rewrite
-
Nat_iter_S
Nat_iter_S_r
.
eapply
contractive_0
;
first
done
.
-
eapply
contractive_S
with
(
f0
:=
Nat
.
iter
2
f
)
;
first
done
.
eauto
.
-
rewrite
-
[
f
_]
Nat_iter_S
Nat_iter_S_r
.
eapply
contractive_S
;
first
done
.
eauto
.
Qed
.
Qed
.
Lemma
fixpoint
2
_unique
(
x
:
A
)
:
x
≡
f
x
→
x
≡
fixpoint
2
f
.
Lemma
fixpoint
K
_unique
(
x
:
A
)
:
x
≡
f
x
→
x
≡
fixpoint
K
k
f
.
Proof
.
Proof
.
intros
Hf
.
apply
fixpoint_unique
,
equiv_dist
=>
n
.
eapply
equiv_dist
in
Hf
.
intros
Hf
.
apply
fixpoint_unique
,
equiv_dist
=>
n
.
rewrite
2
!
{
1
}
Hf
.
done
.
(* 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
.
Qed
.
Qed
.
Section
fixpoint
2
_ne
.
Section
fixpoint
K
_ne
.
Context
(
g
:
A
→
A
)
`{
!
Contractive
(
Nat
.
iter
2
g
),
!∀
n
,
Proper
(
dist
n
==>
dist
n
)
g
}
.
Context
(
g
:
A
→
A
)
`{
!
Contractive
(
Nat
.
iter
k
g
),
!∀
n
,
Proper
(
dist
n
==>
dist
n
)
g
}
.
Lemma
fixpoint
2
_ne
n
:
(
∀
z
,
f
z
≡
{
n
}
≡
g
z
)
→
fixpoint
2
f
≡
{
n
}
≡
fixpoint
2
g
.
Lemma
fixpoint
K
_ne
n
:
(
∀
z
,
f
z
≡
{
n
}
≡
g
z
)
→
fixpoint
K
k
f
≡
{
n
}
≡
fixpoint
K
k
g
.
Proof
.
Proof
.
rewrite
/
fixpoint2
=>
Hne
/=.
apply
fixpoint_ne
=>?
/=.
rewrite
!
Hne
.
done
.
rewrite
/
fixpointK
=>
Hne
/=.
apply
fixpoint_ne
=>?
/=.
clear
Contractive0
Contractive1
.
induction
k
;
first
by
auto
.
simpl
.
rewrite
IHn0
.
apply
Hne
.
Qed
.
Qed
.
Lemma
fixpoint
2
_proper
:
(
∀
z
,
f
z
≡
g
z
)
→
fixpoint
2
f
≡
fixpoint
2
g
.
Lemma
fixpoint
K
_proper
:
(
∀
z
,
f
z
≡
g
z
)
→
fixpoint
K
k
f
≡
fixpoint
K
k
g
.
Proof
.
setoid_rewrite
equiv_dist
;
naive_solver
eauto
using
fixpoint
2
_ne
.
Qed
.
Proof
.
setoid_rewrite
equiv_dist
;
naive_solver
eauto
using
fixpoint
K
_ne
.
Qed
.
End
fixpoint
2
_ne
.
End
fixpoint
K
_ne
.
End
fixpoint
2
.
End
fixpoint
K
.
(** Mutual fixpoints *)
(** Mutual fixpoints *)
Section
fixpointAB
.
Section
fixpointAB
.
...
...
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