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
Simcha van Collem
Iris
Commits
09d97eae
Commit
09d97eae
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Generalize iso_cofe infrastructure to deal with types in lambdarust.
parent
857f9909
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/algebra/ofe.v
+21
-17
21 additions, 17 deletions
theories/algebra/ofe.v
theories/algebra/vector.v
+2
-4
2 additions, 4 deletions
theories/algebra/vector.v
with
23 additions
and
21 deletions
theories/algebra/ofe.v
+
21
−
17
View file @
09d97eae
...
@@ -1095,22 +1095,22 @@ Proof.
...
@@ -1095,22 +1095,22 @@ Proof.
-
intros
n
y1
y2
.
rewrite
!
g_dist
.
apply
dist_S
.
-
intros
n
y1
y2
.
rewrite
!
g_dist
.
apply
dist_S
.
Qed
.
Qed
.
Program
Defini
tion
iso_cofe_subtype
{
A
B
:
ofeT
}
`{
Cofe
A
}
Sec
tion
iso_cofe_subtype
.
(
P
:
A
→
Prop
)
`{
!
LimitPreserving
P
}
Context
{
A
B
:
ofeT
}
`{
Cofe
A
}
(
P
:
A
→
Prop
)
(
f
:
∀
x
,
P
x
→
B
)
(
g
:
B
→
A
)
.
(
f
:
∀
x
,
P
x
→
B
)
(
g
:
B
→
A
)
Context
(
Pg
:
∀
y
,
P
(
g
y
))
.
(
Pg
:
∀
y
,
P
(
g
y
))
Context
(
g_dist
:
∀
n
y1
y
2
,
y1
≡
{
n
}
≡
y2
↔
g
y1
≡
{
n
}
≡
g
y2
)
.
(
g_dist
:
∀
n
y1
y2
,
y1
≡
{
n
}
≡
y2
↔
g
y1
≡
{
n
}
≡
g
y2
)
Let
Hgne
:
NonExpansive
g
.
(
gf
:
∀
x
Hx
,
g
(
f
x
Hx
)
≡
x
)
:
Cofe
B
:=
Proof
.
intros
n
y1
y2
.
apply
g_dist
.
Qed
.
let
_
:
NonExpansive
g
:=
_
in
Existing
Instance
Hgne
.
{|
compl
c
:=
f
(
compl
(
chain_map
g
c
))
_
|}
.
Context
(
gf
:
∀
x
Hx
,
g
(
f
x
Hx
)
≡
x
)
.
Next
Obligation
.
intros
A
B
?
P
_
f
g
_
g_dist
_
n
y1
y2
.
apply
g_dist
.
Qed
.
Context
(
Hlimit
:
∀
c
:
chain
B
,
P
(
compl
(
chain_map
g
c
)))
.
Next
Obligation
.
Program
Definition
iso_cofe_subtype
:
Cofe
B
:=
intros
A
B
?
P
?
f
g
?
g_dist
gf
?
c
.
apply
limit_preserving
=>
n
.
apply
Pg
.
{|
compl
c
:=
f
(
compl
(
chain_map
g
c
))
_
|}
.
Qed
.
Next
Obligation
.
apply
Hlimit
.
Qed
.
Next
Obligation
.
Next
Obligation
.
intros
A
B
?
P
?
f
g
?
g_dist
gf
?
n
c
;
si
mpl
.
intros
n
c
;
simpl
.
apply
g_dist
.
by
rewrite
gf
conv_co
mpl
.
apply
g_dist
.
by
rewrite
gf
conv_compl
.
Qed
.
Qed
.
End
iso_cofe_subtype
.
Definition
iso_cofe
{
A
B
:
ofeT
}
`{
Cofe
A
}
(
f
:
A
→
B
)
(
g
:
B
→
A
)
Definition
iso_cofe
{
A
B
:
ofeT
}
`{
Cofe
A
}
(
f
:
A
→
B
)
(
g
:
B
→
A
)
(
g_dist
:
∀
n
y1
y2
,
y1
≡
{
n
}
≡
y2
↔
g
y1
≡
{
n
}
≡
g
y2
)
(
g_dist
:
∀
n
y1
y2
,
y1
≡
{
n
}
≡
y2
↔
g
y1
≡
{
n
}
≡
g
y2
)
...
@@ -1141,7 +1141,11 @@ Section sigma.
...
@@ -1141,7 +1141,11 @@ Section sigma.
Canonical
Structure
sigC
:
ofeT
:=
OfeT
(
sig
P
)
sig_ofe_mixin
.
Canonical
Structure
sigC
:
ofeT
:=
OfeT
(
sig
P
)
sig_ofe_mixin
.
Global
Instance
sig_cofe
`{
Cofe
A
,
!
LimitPreserving
P
}
:
Cofe
sigC
.
Global
Instance
sig_cofe
`{
Cofe
A
,
!
LimitPreserving
P
}
:
Cofe
sigC
.
Proof
.
by
apply
(
iso_cofe_subtype
P
(
exist
P
)
proj1_sig
proj2_sig
)
.
Qed
.
Proof
.
apply
:
(
iso_cofe_subtype
P
(
exist
P
)
proj1_sig
)
.
-
done
.
-
intros
c
.
apply
limit_preserving
=>
n
.
apply
proj2_sig
.
Qed
.
Global
Instance
sig_timeless
(
x
:
sig
P
)
:
Timeless
(
`
x
)
→
Timeless
x
.
Global
Instance
sig_timeless
(
x
:
sig
P
)
:
Timeless
(
`
x
)
→
Timeless
x
.
Proof
.
intros
?
y
.
rewrite
sig_dist_alt
sig_equiv_alt
.
apply
(
timeless
_)
.
Qed
.
Proof
.
intros
?
y
.
rewrite
sig_dist_alt
sig_equiv_alt
.
apply
(
timeless
_)
.
Qed
.
...
...
This diff is collapsed.
Click to expand it.
theories/algebra/vector.v
+
2
−
4
View file @
09d97eae
...
@@ -15,12 +15,10 @@ Section ofe.
...
@@ -15,12 +15,10 @@ Section ofe.
Global
Instance
list_cofe
`{
Cofe
A
}
m
:
Cofe
(
vecC
m
)
.
Global
Instance
list_cofe
`{
Cofe
A
}
m
:
Cofe
(
vecC
m
)
.
Proof
.
Proof
.
assert
(
LimitPreserving
(
λ
l
,
length
l
=
m
))
.
apply
:
(
iso_cofe_subtype
(
λ
l
:
list
A
,
length
l
=
m
)
{
apply
limit_preserving_timeless
=>
l
k
->
//.
}
apply
(
iso_cofe_subtype
(
λ
l
:
list
A
,
length
l
=
m
)
(
λ
l
,
eq_rect
_
(
vec
A
)
(
list_to_vec
l
)
m
)
vec_to_list
)=>
//.
(
λ
l
,
eq_rect
_
(
vec
A
)
(
list_to_vec
l
)
m
)
vec_to_list
)=>
//.
-
intros
v
.
by
rewrite
vec_to_list_length
.
-
intros
v
[]
.
by
rewrite
/=
vec_to_list_of_list
.
-
intros
v
[]
.
by
rewrite
/=
vec_to_list_of_list
.
-
intros
c
.
by
rewrite
(
conv_compl
0
(
chain_map
_
c
))
/=
vec_to_list_length
.
Qed
.
Qed
.
Global
Instance
vnil_timeless
:
Timeless
(
@
vnil
A
)
.
Global
Instance
vnil_timeless
:
Timeless
(
@
vnil
A
)
.
...
...
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