Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
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
Model registry
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
Iris
stdpp
Commits
a0d4deb1
Commit
a0d4deb1
authored
3 years ago
by
Gregory Malecha
Browse files
Options
Downloads
Patches
Plain Diff
Code formatting.
parent
6f1c3b37
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!368
Define [tele_arg] as a fixpoint
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/telescopes.v
+7
-3
7 additions, 3 deletions
tests/telescopes.v
theories/telescopes.v
+9
-14
9 additions, 14 deletions
theories/telescopes.v
with
16 additions
and
17 deletions
tests/telescopes.v
+
7
−
3
View file @
a0d4deb1
...
@@ -42,8 +42,12 @@ Notation "'[TEST' x .. z , P ']'" :=
...
@@ -42,8 +42,12 @@ Notation "'[TEST' x .. z , P ']'" :=
(
x
binder
,
z
binder
)
.
(
x
binder
,
z
binder
)
.
Check
[
TEST
(
x
y
:
nat
),
x
=
y
]
.
Check
[
TEST
(
x
y
:
nat
),
x
=
y
]
.
(* [tele_arg t] should live at the same universe
(*
*
[tele_arg t] should live at the same universe
as the types inside of [t] because [tele_arg t]
as the types inside of [t] because [tele_arg t]
is essentially just a (dependent) product.
is essentially just a (dependent) product.
*)
*)
Definition
no_bump
@
{
u
}
(
t
:
tele
@
{
u
})
:
Type
@
{
u
}
:=
tele_arg
@
{
u
}
t
.
Definition
no_bump
@
{
u
}
(
t
:
tele
@
{
u
})
:
Type
@
{
u
}
:=
tele_arg
@
{
u
}
t
.
Lemma
texist_exist_universes
(
X
:
Type
)
(
P
:
TeleS
(
fun
_
:
X
=>
TeleO
)
->
Prop
)
:
texist
P
<->
ex
P
.
Proof
.
by
rewrite
texist_exist
.
Qed
.
This diff is collapsed.
Click to expand it.
theories/telescopes.v
+
9
−
14
View file @
a0d4deb1
...
@@ -38,28 +38,27 @@ Global Arguments tele_fold {_ _ !_} _ _ _ /.
...
@@ -38,28 +38,27 @@ Global Arguments tele_fold {_ _ !_} _ _ _ /.
(** A duplication of the type [sigT] to avoid any connection to other universes
(** A duplication of the type [sigT] to avoid any connection to other universes
*)
*)
Record
tele_arg_cons
(
X
:
Type
)
(
f
:
X
->
Type
)
:
Type
:=
TeleArgCons
Record
tele_arg_cons
{
X
:
Type
}
(
f
:
X
→
Type
)
:
Type
:=
TeleArgCons
{
tele_arg_head
:
X
;
{
tele_arg_head
:
X
;
tele_arg_tail
:
f
tele_arg_head
}
.
tele_arg_tail
:
f
tele_arg_head
}
.
Global
Arguments
tele_arg_cons
[_]
_
.
Global
Arguments
TeleArgCons
{_
_}
_
_
.
Global
Arguments
TeleArgCons
[
X
]
_
.
(** A sigma-like type for an "element" of a telescope, i.e. the data it
(** A sigma-like type for an "element" of a telescope, i.e. the data it
takes to get a [T] from a [TT -t> T]. *)
takes to get a [T] from a [TT -t> T]. *)
Fixpoint
tele_arg
@
{
u
}
(
t
:
tele
@
{
u
})
:
Type
@
{
u
}
:=
Fixpoint
tele_arg
@
{
u
}
(
t
:
tele
@
{
u
})
:
Type
@
{
u
}
:=
match
t
with
match
t
with
|
TeleO
=>
unit
|
TeleO
=>
unit
|
TeleS
f
=>
tele_arg_cons
(
fun
x
=>
tele_arg
(
f
x
))
|
TeleS
f
=>
tele_arg_cons
(
λ
x
,
tele_arg
(
f
x
))
end
.
end
.
Global
Arguments
tele_arg
_
:
simpl
never
.
Global
Arguments
tele_arg
_
:
simpl
never
.
Notation
TargO
:=
tt
(
only
parsing
)
.
Notation
TargO
:=
tt
(
only
parsing
)
.
Notation
TargS
a
b
:=
(
@
TeleArgCons
_
(
fun
x
=>
tele_arg
_)
a
b
)
(
only
parsing
)
.
Notation
TargS
a
b
:=
(
@
TeleArgCons
_
(
λ
x
,
tele_arg
_)
a
b
)
(
only
parsing
)
.
Coercion
tele_arg
:
tele
>->
Sortclass
.
Coercion
tele_arg
:
tele
>->
Sortclass
.
Fixpoint
tele_app
{
TT
:
tele
}
{
U
}
:
(
TT
-
t
>
U
)
->
TT
→
U
:=
Fixpoint
tele_app
{
TT
:
tele
}
{
U
}
:
(
TT
-
t
>
U
)
->
TT
→
U
:=
match
TT
as
TT
return
(
TT
-
t
>
U
)
->
TT
→
U
with
match
TT
as
TT
return
(
TT
-
t
>
U
)
->
TT
→
U
with
|
TeleO
=>
λ
F
_,
F
|
TeleO
=>
λ
F
_,
F
|
@
TeleS
X
b
=>
λ
(
F
:
TeleS
b
-
t
>
U
)
'
(
TeleArgCons
_
x
b
),
(* b x -t> U *)
|
TeleS
r
=>
λ
(
F
:
TeleS
r
-
t
>
U
)
'
(
TeleArgCons
x
b
),
tele_app
(
F
x
)
b
tele_app
(
F
x
)
b
end
.
end
.
(* The bidirectionality hint [&] simplifies defining tele_app-based notation
(* The bidirectionality hint [&] simplifies defining tele_app-based notation
...
@@ -69,15 +68,11 @@ Global Arguments tele_app {!_ _} & _ !_ /.
...
@@ -69,15 +68,11 @@ Global Arguments tele_app {!_ _} & _ !_ /.
(* This is a local coercion because otherwise, the "λ.." notation stops working. *)
(* This is a local coercion because otherwise, the "λ.." notation stops working. *)
Local
Coercion
tele_app
:
tele_fun
>->
Funclass
.
Local
Coercion
tele_app
:
tele_fun
>->
Funclass
.
(** Inversion lemma for [tele_arg]
(** Inversion lemma for [tele_arg] *)
Note the explicit universe annotation prevents this from being minimized
Lemma
tele_arg_inv
{
TT
:
tele
}
(
a
:
tele_arg
TT
)
:
to [Set]. The + is needed to satisfy a bug in Coq, the resulting definition
match
TT
as
TT
return
tele_arg
TT
→
Prop
with
only requires a single universe.
*)
Lemma
tele_arg_inv
@
{
u
+
}
{
TT
:
tele
@
{
u
}}
(
a
:
tele_arg
@
{
u
}
TT
)
:
match
TT
as
TT
return
tele_arg
@
{
u
}
TT
→
Prop
with
|
TeleO
=>
λ
a
,
a
=
TargO
|
TeleO
=>
λ
a
,
a
=
TargO
|
@
TeleS
t
f
=>
λ
a
,
∃
x
a'
,
a
=
TargS
x
a'
|
TeleS
f
=>
λ
a
,
∃
x
a'
,
a
=
TargS
x
a'
end
a
.
end
a
.
Proof
.
destruct
TT
;
destruct
a
;
eauto
.
Qed
.
Proof
.
destruct
TT
;
destruct
a
;
eauto
.
Qed
.
Lemma
tele_arg_O_inv
(
a
:
TeleO
)
:
a
=
()
.
Lemma
tele_arg_O_inv
(
a
:
TeleO
)
:
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