statement stringlengths 5 595 | proof stringlengths 0 691 | type stringclasses 2
values | symbolic_name stringlengths 1 27 | library stringclasses 1
value | filename stringclasses 30
values | imports listlengths 0 2 | deps listlengths 0 8 | docstring stringclasses 32
values | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
basic : type | :=
sig
def foo::x : nat
def bar : nat → nat
end | def | basic | test | test/record.cooltt | [
"prelude"
] | [
"bar"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
basic::inhabit : basic | := struct [foo::x := 1, bar := x => suc x] | def | basic::inhabit | test | test/record.cooltt | [
"prelude"
] | [
"bar",
"basic"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
basic/ext
(b0 : basic) (b1 : basic)
(p : path nat {b0 . foo::x} {b1 . foo::x})
(q : path {nat → nat} {b0.bar} {b1.bar}) : path basic b0 b1 | :=
i =>
struct
def foo::x := p i
def bar := q i
end | def | basic/ext | test | test/record.cooltt | [
"prelude"
] | [
"bar",
"basic",
"path"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
depend : type | :=
sig
def tp : type
def fun : tp → tp
end | def | depend | test | test/record.cooltt | [
"prelude"
] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
depend/ext
(d0 : depend)
(d1 : depend)
(p : path type {d0.tp} {d1.tp})
(q : path-p {i => p i → p i} {d0.fun} {d1.fun}) : path depend d0 d1 | :=
i => struct [tp := p i, fun := q i] | def | depend/ext | test | test/record.cooltt | [
"prelude"
] | [
"depend",
"path",
"path-p"
] | Make sure dependent paths work | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 |
sig/inhabit :
sig
def tp : type
def fun : tp → tp → type
def comp : (X : tp) (Y : tp) (Z : tp) (f : fun Y Z) → (g : fun X Y) → fun X Z
end | :=
struct [tp := nat, fun := x y => nat, comp := x y z f g => 1] | def | sig/inhabit | test | test/record.cooltt | [
"prelude"
] | [] | Can we inhabit first class sigs? | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 |
sig/conv : path type depend {sig [tp : type, fun : tp → tp]} | :=
i => depend | def | sig/conv | test | test/record.cooltt | [
"prelude"
] | [
"depend",
"path"
] | Can we convert between equal representations of sig types? | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 |
sig/ext
(b0 : sig [foo : nat])
(b1 : sig [foo : nat])
(p : path nat {b0.foo} {b1.foo})
: path {sig [foo : nat]} b0 b1 | :=
i => struct [foo := p i] | def | sig/ext | test | test/record.cooltt | [
"prelude"
] | [
"foo",
"path"
] | Test that forming paths in first-class sigs works | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 |
empty : type | := sig [] | def | empty | test | test/record.cooltt | [
"prelude"
] | [] | Test that empty sigs/structs work | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 |
empty/inhabit : empty | := struct [] | def | empty/inhabit | test | test/record.cooltt | [
"prelude"
] | [
"empty"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
testing : {
(Z A : type) (B : A → type) (p : Z → (x : A) × B x) →
(z : Z) → {sub A ⊤ {fst {p z}}} × {sub {B {fst {p z}}} ⊤ {snd {p z}}}
} | := {
_ _ _ p => p
} | def | testing | test | test/selfification.cooltt | [] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
functor : type | :=
sig
def F : type → type
def map : (A B : type) → {A → B} → F A → F B
end | def | functor | test | test/typeclass.cooltt | [
"prelude"
] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
applicative : type | :=
sig
include functor
def pure : (A : type) → A → F A
def ap : (A B : type) → F {A → B} → F A → F B
end | def | applicative | test | test/typeclass.cooltt | [
"prelude"
] | [
"functor"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
monad : type | :=
sig
include applicative
def bind : (A B : type) → F A → {A → F B} → F B
end | def | monad | test | test/typeclass.cooltt | [
"prelude"
] | [
"applicative"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
maybe (A : type) : type | :=
(R : type) → {A → R} → R → R | def | maybe | test | test/typeclass.cooltt | [
"prelude"
] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
some (A : type) (x : A) : maybe A | :=
unfold maybe in
R some none => some x | def | some | test | test/typeclass.cooltt | [
"prelude"
] | [
"maybe",
"none"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
none (A : type) : maybe A | :=
unfold maybe in
R some none => none | def | none | test | test/typeclass.cooltt | [
"prelude"
] | [
"maybe",
"some"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
functor/maybe : functor # [F := maybe] | :=
struct
def map := A B f opt => unfold maybe in R some none => opt R {x => some {f x}} none
end | def | functor/maybe | test | test/typeclass.cooltt | [
"prelude"
] | [
"functor",
"maybe",
"none",
"some"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
applicative/maybe : applicative # [F := maybe] | :=
struct
include functor/maybe
def pure := some
def ap := A B mf mx =>
unfold maybe in
mf {maybe B} {f => mx {maybe B} {x => some B {f x}} {none B}} {none B}
end | def | applicative/maybe | test | test/typeclass.cooltt | [
"prelude"
] | [
"applicative",
"functor/maybe",
"maybe",
"none",
"some"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
monad/maybe : monad # [F := maybe] | :=
struct
include applicative/maybe
def bind := A B mx f =>
unfold maybe in
mx {maybe B} f {none B}
end | def | monad/maybe | test | test/typeclass.cooltt | [
"prelude"
] | [
"applicative/maybe",
"maybe",
"monad",
"none"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
monad-prod (M : monad) (A B : type) (ma : M.F A) (mb : M.F B) : M.F {A * B} | :=
open M renaming [bind -> bnd ; pure -> ret] in
bnd A {A * B} ma {x =>
bnd B {A * B} mb {y =>
ret {A * B} [x,y] }} | def | monad-prod | test | test/typeclass.cooltt | [
"prelude"
] | [
"monad"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
cool (A : type) (a : A) : sub A ⊤ {coe {_ => A} 0 1 a} | :=
coe {i => v-test i A} 0 1 a | def | cool | test | test/v.cooltt | [] | [
"v-test"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
cool2 (A : type) (a : A) (i : 𝕀) : A | :=
coe {i => v-test i A} i 0 [a, a] | def | cool2 | test | test/v.cooltt | [] | [
"v-test"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
cool3 (A : type) (a : A) (i : 𝕀) : sub A ⊤ a | :=
let vin : v-test i A := [a, a] in
vproj vin | def | cool3 | test | test/v.cooltt | [] | [
"v-test"
] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
m1::a2 : nat | := 10 | def | m1::a2 | test | test/view.cooltt | [] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
m1::a3 : nat | := 20 | def | m1::a3 | test | test/view.cooltt | [] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
m2::a3 : nat | := 30 | def | m2::a3 | test | test/view.cooltt | [] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 | |
m2::a4 : nat | := 40 | def | m2::a4 | test | test/view.cooltt | [] | [] | https://github.com/RedPRL/cooltt | b39bf29900451cb43ae6fbd9af5aa33d59e18935 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.