fact stringlengths 17 3.77k | statement stringlengths 2 515 | proof stringlengths 0 3.49k | type stringclasses 4
values | symbolic_name stringlengths 1 23 | library stringclasses 3
values | filename stringclasses 56
values | imports listlengths 0 0 | deps listlengths 0 7 | docstring stringclasses 0
values | line_start int64 1 323 | line_end int64 1 337 | has_proof bool 2
classes | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FunElimTest :
(->
(-> bool bool)
bool)
by {
lam f => use f [`tt]
}. | FunElimTest :
(->
(-> bool bool)
bool) | by {
lam f => use f [`tt]
}. | theorem | FunElimTest | example | example/README.prl | [] | [] | null | 48 | 54 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
S1ElimTest : (-> S1 S1) by {
lam s =>
case s of
base => `base
| loop x => `(loop x)
}. | S1ElimTest : (-> S1 S1) | by {
lam s =>
case s of
base => `base
| loop x => `(loop x)
}. | theorem | S1ElimTest | example | example/README.prl | [] | [] | null | 56 | 61 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Try(#t : tac) = {
#t || id
}. | Try(#t : tac) | = {
#t || id
}. | tactic | Try | example | example/README.prl | [] | [] | null | 63 | 65 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
TryStep = {
// We can call our Try tactical. But tactics are parsed with a different grammar than terms,
// so to avoid ambiguity, when we need to provide a tactic expression as an argument to
// an operator, we wrap it in (tactic ....).
(Try #tac{auto-step})
}. | TryStep | = {
// We can call our Try tactical. But tactics are parsed with a different grammar than terms,
// so to avoid ambiguity, when we need to provide a tactic expression as an argument to
// an operator, we wrap it in (tactic ....).
(Try #tac{auto-step})
}. | tactic | TryStep | example | example/README.prl | [] | [
"Try"
] | null | 69 | 74 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
BoolEta(#M) =
(if [a] bool #M tt ff)
. | BoolEta(#M) | =
(if [a] bool #M tt ff)
. | define | BoolEta | example | example/README.prl | [] | [] | null | 78 | 80 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
BoolEtaFunction :
(-> bool bool)
by {
lam b => if b then `tt else `ff
}. | BoolEtaFunction :
(-> bool bool) | by {
lam b => if b then `tt else `ff
}. | theorem | BoolEtaFunction | example | example/README.prl | [] | [] | null | 87 | 91 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathTest2 :
(path
[_] (-> bool bool)
(lam [b] b)
(lam [b] (BoolEta b)))
by {
// abstract a dimension
abs x =>
// now, we are constructing a line of functions; so we use a
// lambda.
lam b =>
// for our b:bool, we will construct a path between b and
// (BoolEta b).
claim p... | PathTest2 :
(path
[_] (-> bool bool)
(lam [b] b)
(lam [b] (BoolEta b))) | by {
// abstract a dimension
abs x =>
// now, we are constructing a line of functions; so we use a
// lambda.
lam b =>
// for our b:bool, we will construct a path between b and
// (BoolEta b).
claim p : (path [_] bool b (BoolEta b)) by {
if b then abs y => `tt else abs y => `ff... | theorem | PathTest2 | example | example/README.prl | [] | [
"BoolEta"
] | null | 104 | 126 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathTest3 :
(path
[_] (-> bool bool)
(lam [b] b)
(lam [b] (BoolEta b)))
by {
// I'm surprised that RedPRL can typecheck this properly! quite
// encouraging.
`(abs [x]
(lam [b]
(@ (if [b] (path [_] bool b (BoolEta b)) b (abs [_] tt) (abs [_] ff))
x)))
}. | PathTest3 :
(path
[_] (-> bool bool)
(lam [b] b)
(lam [b] (BoolEta b))) | by {
// I'm surprised that RedPRL can typecheck this properly! quite
// encouraging.
`(abs [x]
(lam [b]
(@ (if [b] (path [_] bool b (BoolEta b)) b (abs [_] tt) (abs [_] ff))
x)))
}. | theorem | PathTest3 | example | example/README.prl | [] | [
"BoolEta"
] | null | 136 | 148 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PairTest : (* [a : S1] (path [_] S1 a base)) by {
{`base, abs x => `(loop x)}
}. | PairTest : (* [a : S1] (path [_] S1 a base)) | by {
{`base, abs x => `(loop x)}
}. | theorem | PairTest | example | example/README.prl | [] | [] | null | 152 | 154 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Cmp(#f, #g) =
(lam [x] ($ #f ($ #g x)))
. | Cmp(#f, #g) | =
(lam [x] ($ #f ($ #g x)))
. | define | Cmp | example | example/README.prl | [] | [] | null | 157 | 159 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
MyLoop(#x:dim, #m) =
(tuple [proj1 #m] [proj2 (loop #x)])
. | MyLoop(#x:dim, #m) | =
(tuple [proj1 #m] [proj2 (loop #x)])
. | define | MyLoop | example | example/README.prl | [] | [] | null | 162 | 164 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Test =
(MyLoop (dim 0) (loop 1))
. | Test | =
(MyLoop (dim 0) (loop 1))
. | define | Test | example | example/README.prl | [] | [
"MyLoop"
] | null | 166 | 168 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
SNot : (-> bool bool) by {
lam b => if b then `ff else `tt
}. | SNot : (-> bool bool) | by {
lam b => if b then `ff else `tt
}. | theorem | SNot | example | example/README.prl | [] | [] | null | 172 | 174 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
StrictBoolTest : SNot = (Cmp SNot (Cmp SNot SNot)) in (-> bool bool) by {
auto
}. | StrictBoolTest : SNot = (Cmp SNot (Cmp SNot SNot)) in (-> bool bool) | by {
auto
}. | theorem | StrictBoolTest | example | example/README.prl | [] | [
"Cmp",
"SNot"
] | null | 176 | 178 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Not : (-> [_ : bool] bool) by {
lam x => if x then `ff else `tt
}. | Not : (-> [_ : bool] bool) | by {
lam x => if x then `ff else `tt
}. | theorem | Not | example | example/README.prl | [] | [] | null | 180 | 182 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunExt(#l:lvl) :
(->
[a b : (U #l)]
[f g : (-> a b)]
[p : (-> [y : a] (path [_] b ($ f y) ($ g y)))]
(path [_] (-> a b) f g))
by {
lam a b f g p =>
abs i => lam x => use p [use x, `i]
}. | FunExt(#l:lvl) :
(->
[a b : (U #l)]
[f g : (-> a b)]
[p : (-> [y : a] (path [_] b ($ f y) ($ g y)))]
(path [_] (-> a b) f g)) | by {
lam a b f g p =>
abs i => lam x => use p [use x, `i]
}. | theorem | FunExt | example | example/README.prl | [] | [] | null | 184 | 193 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunExtTac(#l : lvl) = {
query gl <- concl;
match gl {
[a b f g | #jdg{(path [_] (-> %a %b) %f %g) true} =>
use (FunExt #l) [`%a, `%b, `%f, `%g, id]
]
}
}. | FunExtTac(#l : lvl) | = {
query gl <- concl;
match gl {
[a b f g | #jdg{(path [_] (-> %a %b) %f %g) true} =>
use (FunExt #l) [`%a, `%b, `%f, `%g, id]
]
}
}. | tactic | FunExtTac | example | example/README.prl | [] | [
"FunExt"
] | null | 197 | 204 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
NotNotPath : (path [_] (-> bool bool) (Cmp Not Not) (lam [x] x)) by {
(FunExtTac #lvl{0});
lam x => if x then abs _ => `tt else abs _ => `ff
}. | NotNotPath : (path [_] (-> bool bool) (Cmp Not Not) (lam [x] x)) | by {
(FunExtTac #lvl{0});
lam x => if x then abs _ => `tt else abs _ => `ff
}. | theorem | NotNotPath | example | example/README.prl | [] | [
"Cmp",
"FunExtTac",
"Not"
] | null | 208 | 211 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Singleton : (* [x : bool] (path [_] bool x tt)) by {
{`tt, abs _ => `tt}
}. | Singleton : (* [x : bool] (path [_] bool x tt)) | by {
{`tt, abs _ => `tt}
}. | theorem | Singleton | example | example/README.prl | [] | [] | null | 217 | 219 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathElimTest : (-> (path [_] bool tt tt) bool) by {
lam x => use x [`(dim 0)]
}. | PathElimTest : (-> (path [_] bool tt tt) bool) | by {
lam x => use x [`(dim 0)]
}. | theorem | PathElimTest | example | example/README.prl | [] | [] | null | 221 | 223 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathEta(#l:lvl) :
(->
[a : (U #l)]
[m n : a]
(path [_] a m n)
(path [_] a m n))
by {
lam a m n p => abs j => use p [`j]
}. | PathEta(#l:lvl) :
(->
[a : (U #l)]
[m n : a]
(path [_] a m n)
(path [_] a m n)) | by {
lam a m n p => abs j => use p [`j]
}. | theorem | PathEta | example | example/README.prl | [] | [] | null | 225 | 233 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Choice :
// a choice of #(first argument) elements from #(second argument) elemnts.
// `tt` means "take", and `ff` means "drop".
(-> nat nat (U 0))
by {
lam n => elim n;
[ lam n => `record ]; // n = 0
with n'/ih n' => lam m => elim m;
[ `void ]; // m = 0
with m'/ih m' =>
`(record
[head : bool... | Choice :
// a choice of #(first argument) elements from #(second argument) elemnts.
// `tt` means "take", and `ff` means "drop".
(-> nat nat (U 0)) | by {
lam n => elim n;
[ lam n => `record ]; // n = 0
with n'/ih n' => lam m => elim m;
[ `void ]; // m = 0
with m'/ih m' =>
`(record
[head : bool]
[tail : (if [_] (U 0) head ($ n'/ih m') m'/ih)])
}. | theorem | Choice | example | example/semi-simplicial.prl | [] | [] | null | 13 | 26 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Choice/compose :
(->
[a b c : nat]
($ Choice b c)
($ Choice a b)
($ Choice a c))
by {
lam a => elim a;
[ lam b c p0 p1 => `tuple ]; // a = 0
with a'/ih a' => lam b => elim b;
[ lam c p0 p1 => elim p1 ]; // b = 0
with b'/ih b' => lam c => elim c;
[ lam p0 => elim p0 ]; // c = 0
with c'/ih c' ... | Choice/compose :
(->
[a b c : nat]
($ Choice b c)
($ Choice a b)
($ Choice a c)) | by {
lam a => elim a;
[ lam b c p0 p1 => `tuple ]; // a = 0
with a'/ih a' => lam b => elim b;
[ lam c p0 p1 => elim p1 ]; // b = 0
with b'/ih b' => lam c => elim c;
[ lam p0 => elim p0 ]; // c = 0
with c'/ih c' =>
lam p0 => let {head = p0/h, tail = p0/t} = p0; elim p0/h;
[ lam p1 => let {head = p1/h, ... | theorem | Choice/compose | example | example/semi-simplicial.prl | [] | [
"Choice"
] | null | 28 | 56 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Choice/compose/tt/tt :
(->
[a b c : nat]
[p0/t : ($ Choice b c)]
[p1/t : ($ Choice a b)]
(=
($ Choice (succ a) (succ c))
($ Choice/compose (succ a) (succ b) (succ c)
(tuple [head tt] [tail p0/t]) (tuple [head tt] [tail p1/t]))
(tuple [head tt] [tail ($ Choice/compose a b c p0/t p1/t)]))... | Choice/compose/tt/tt :
(->
[a b c : nat]
[p0/t : ($ Choice b c)]
[p1/t : ($ Choice a b)]
(=
($ Choice (succ a) (succ c))
($ Choice/compose (succ a) (succ b) (succ c)
(tuple [head tt] [tail p0/t]) (tuple [head tt] [tail p1/t]))
(tuple [head tt] [tail ($ Choice/compose a b c p0/t p1/t)]))... | by {
lam a b c p0/t p1/t =>
auto;
unfold Choice; reduce; assumption
}. | theorem | Choice/compose/tt/tt | example | example/semi-simplicial.prl | [] | [
"Choice",
"Choice/compose"
] | null | 58 | 72 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Choice/compose/tt/ff :
(->
[a b c : nat]
[p0/t : ($ Choice b c)]
[p1/t : ($ Choice (succ a) b)]
(=
($ Choice (succ a) (succ c))
($ Choice/compose (succ a) (succ b) (succ c)
(tuple [head tt] [tail p0/t]) (tuple [head ff] [tail p1/t]))
(tuple [head ff] [tail ($ Choice/compose (succ a) b c... | Choice/compose/tt/ff :
(->
[a b c : nat]
[p0/t : ($ Choice b c)]
[p1/t : ($ Choice (succ a) b)]
(=
($ Choice (succ a) (succ c))
($ Choice/compose (succ a) (succ b) (succ c)
(tuple [head tt] [tail p0/t]) (tuple [head ff] [tail p1/t]))
(tuple [head ff] [tail ($ Choice/compose (succ a) b c... | by {
lam a b c p0/t p1/t =>
auto;
unfold Choice; reduce; assumption
}. | theorem | Choice/compose/tt/ff | example | example/semi-simplicial.prl | [] | [
"Choice",
"Choice/compose"
] | null | 74 | 88 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Choice/compose/ff :
(->
[a b c : nat]
[p0/t : ($ Choice (succ b) c)]
[p1 : ($ Choice (succ a) (succ b))]
(=
($ Choice (succ a) (succ c))
($ Choice/compose (succ a) (succ b) (succ c)
(tuple [head ff] [tail p0/t]) p1)
(tuple [head ff] [tail ($ Choice/compose (succ a) (succ b) c p0/t p1)])... | Choice/compose/ff :
(->
[a b c : nat]
[p0/t : ($ Choice (succ b) c)]
[p1 : ($ Choice (succ a) (succ b))]
(=
($ Choice (succ a) (succ c))
($ Choice/compose (succ a) (succ b) (succ c)
(tuple [head ff] [tail p0/t]) p1)
(tuple [head ff] [tail ($ Choice/compose (succ a) (succ b) c p0/t p1)])... | by {
lam a b c p0/t p1 =>
auto;
unfold Choice; reduce; assumption
}. | theorem | Choice/compose/ff | example | example/semi-simplicial.prl | [] | [
"Choice",
"Choice/compose"
] | null | 90 | 104 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Eq/inv :
(-> [a : (U 0)] [x y : a]
(= a x y) (= a y x))
by {
lam a x y eq => assumption
}. | Eq/inv :
(-> [a : (U 0)] [x y : a]
(= a x y) (= a y x)) | by {
lam a x y eq => assumption
}. | theorem | Eq/inv | example | example/semi-simplicial.prl | [] | [] | null | 106 | 111 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Choice/compose/assoc :
(->
[a b c d : nat]
[p0 : ($ Choice c d)]
[p1 : ($ Choice b c)]
[p2 : ($ Choice a b)]
(=
($ Choice a d)
($ Choice/compose a b d ($ Choice/compose b c d p0 p1) p2)
($ Choice/compose a c d p0 ($ Choice/compose a b c p1 p2))))
by {
lam a => elim a;
[ lam b c d p0 p1 ... | Choice/compose/assoc :
(->
[a b c d : nat]
[p0 : ($ Choice c d)]
[p1 : ($ Choice b c)]
[p2 : ($ Choice a b)]
(=
($ Choice a d)
($ Choice/compose a b d ($ Choice/compose b c d p0 p1) p2)
($ Choice/compose a c d p0 ($ Choice/compose a b c p1 p2)))) | by {
lam a => elim a;
[ lam b c d p0 p1 p2 => unfold Choice/compose; auto ]; // a = 0
with a'/ind a' => lam b => elim b;
[ lam c d p0 p1 p2 => elim p2 ]; // b = 0
with b'/ind b' => lam c => elim c;
[ lam d p0 p1 => elim p1 ]; // c = 0
with c'/ind c' => lam d => elim d;
[ lam p0 => elim p0 ]; // d = 0
... | theorem | Choice/compose/assoc | example | example/semi-simplicial.prl | [] | [
"Choice",
"Choice/compose",
"Choice/compose/ff",
"Choice/compose/tt/ff",
"Choice/compose/tt/tt"
] | null | 113 | 197 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
MegaMutualDefs :
(-> nat
(record
[sst : (U 1)]
[folder : (-> sst nat (U 0))]
[pick : (-> [x : sst]
[n m : nat] ($ Choice n m)
($ folder x n)
($ folder x m))]
[pick-coh : (-> [x : sst] [n m o : nat]
[c1 : ($ Choice m o)]
[c2 : ($ Choice n m)]
... | MegaMutualDefs :
(-> nat
(record
[sst : (U 1)]
[folder : (-> sst nat (U 0))]
[pick : (-> [x : sst]
[n m : nat] ($ Choice n m)
($ folder x n)
($ folder x m))]
[pick-coh : (-> [x : sst] [n m o : nat]
[c1 : ($ Choice m o)]
[c2 : ($ Choice n m)]
... | by {
lam p => elim p;
[
{ sst = `record
, folder = lam x n => `record
, pick = lam x n m c f => `tuple
, pick-coh = lam x n m o c1 c2 f => `ax
};
, with p'/ind p' =>
let {sst=sst', folder=folder', pick=pick', pick-coh=pick-coh'}
= p'/ind;
{ sst = `(* [x : sst'] (-> ($ folder' x p... | theorem | MegaMutualDefs | example | example/semi-simplicial.prl | [] | [
"Choice",
"Choice/compose",
"Choice/compose/assoc",
"Eq/inv"
] | null | 228 | 292 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
SemiSimplicial :
(-> nat (U 1))
by {
lam n => `(! sst ($ MegaMutualDefs n))
}. | SemiSimplicial :
(-> nat (U 1)) | by {
lam n => `(! sst ($ MegaMutualDefs n))
}. | theorem | SemiSimplicial | example | example/semi-simplicial.prl | [] | [
"MegaMutualDefs"
] | null | 294 | 298 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Choice(#i:lvl) :
(->
[a b : (U #i)]
[r : (-> a b (U #i))]
[f : (-> [x : a] (* [y : b] ($ r x y)))]
(*
[f : (-> a b)]
(-> [x : a] ($ r x ($ f x)))))
by {
lam a b r f =>
{lam x => let {y,_} = f [`x]; `y,
lam x => let {_,z} = f [`x]; `z};
inversion; with _ aux0 => reduce at left in aux0... | Choice(#i:lvl) :
(->
[a b : (U #i)]
[r : (-> a b (U #i))]
[f : (-> [x : a] (* [y : b] ($ r x y)))]
(*
[f : (-> a b)]
(-> [x : a] ($ r x ($ f x))))) | by {
lam a b r f =>
{lam x => let {y,_} = f [`x]; `y,
lam x => let {_,z} = f [`x]; `z};
inversion; with _ aux0 => reduce at left in aux0; auto; assumption
}. | theorem | Choice | example | example/theorem-of-choice.prl | [] | [] | null | 1 | 15 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Not :
(-> bool bool)
by {
lam b =>
if b then `ff else `tt
}. | Not :
(-> bool bool) | by {
lam b =>
if b then `ff else `tt
}. | theorem | Not | example | example/tutorial.prl | [] | [] | null | 4 | 9 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
NotNot :
(->
[b : bool]
(= bool ($ Not ($ Not b)) b))
by {
lam b =>
// The next four lines can be replaced by auto.
unfold Not;
if b
then (reduce at left; refine bool/eq/tt)
else (reduce at left; refine bool/eq/ff)
}. | NotNot :
(->
[b : bool]
(= bool ($ Not ($ Not b)) b)) | by {
lam b =>
// The next four lines can be replaced by auto.
unfold Not;
if b
then (reduce at left; refine bool/eq/tt)
else (reduce at left; refine bool/eq/ff)
}. | theorem | NotNot | example | example/tutorial.prl | [] | [
"Not"
] | null | 14 | 25 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
RespectEquality :
(->
[family : (-> [b : bool] (U 0))]
[b : bool]
($ family b)
($ family ($ Not ($ Not b))))
by {
lam family b pf =>
rewrite ($ NotNot b);
[ with b' => `($ family b')
, use pf
];
auto
}. | RespectEquality :
(->
[family : (-> [b : bool] (U 0))]
[b : bool]
($ family b)
($ family ($ Not ($ Not b)))) | by {
lam family b pf =>
rewrite ($ NotNot b);
[ with b' => `($ family b')
, use pf
];
auto
}. | theorem | RespectEquality | example | example/tutorial.prl | [] | [
"Not",
"NotNot"
] | null | 30 | 43 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
EqualityIrrelevant :
(=
(-> [b : bool] (= bool ($ Not ($ Not b)) b))
NotNot
(lam [b] ax))
by {
auto
}. | EqualityIrrelevant :
(=
(-> [b : bool] (= bool ($ Not ($ Not b)) b))
NotNot
(lam [b] ax)) | by {
auto
}. | theorem | EqualityIrrelevant | example | example/tutorial.prl | [] | [
"Not",
"NotNot"
] | null | 51 | 58 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunToPair :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty))
by {
lam ty fun =>
{`($ fun tt), `($ fun ff)}
}. | FunToPair :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty)) | by {
lam ty fun =>
{`($ fun tt), `($ fun ff)}
}. | theorem | FunToPair | example | example/tutorial.prl | [] | [] | null | 64 | 72 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
HasAllPathsTo (#C,#c) = (-> [c' : #C] (path [_] #C c' #c)). | HasAllPathsTo (#C,#c) | = (-> [c' : #C] (path [_] #C c' #c)). | define | HasAllPathsTo | example | example/tutorial.prl | [] | [] | null | 76 | 76 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsContr (#C) = (* [c : #C] (HasAllPathsTo #C c)). | IsContr (#C) | = (* [c : #C] (HasAllPathsTo #C c)). | define | IsContr | example | example/tutorial.prl | [] | [
"HasAllPathsTo"
] | null | 77 | 77 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Fiber (#A,#B,#f,#b) = (* [a : #A] (path [_] #B ($ #f a) #b)). | Fiber (#A,#B,#f,#b) | = (* [a : #A] (path [_] #B ($ #f a) #b)). | define | Fiber | example | example/tutorial.prl | [] | [] | null | 78 | 78 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsEquiv (#A,#B,#f) = (-> [b : #B] (IsContr (Fiber #A #B #f b))). | IsEquiv (#A,#B,#f) | = (-> [b : #B] (IsContr (Fiber #A #B #f b))). | define | IsEquiv | example | example/tutorial.prl | [] | [
"Fiber",
"IsContr"
] | null | 79 | 79 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Equiv (#A,#B) = (* [f : (-> #A #B)] (IsEquiv #A #B f)). | Equiv (#A,#B) | = (* [f : (-> #A #B)] (IsEquiv #A #B f)). | define | Equiv | example | example/tutorial.prl | [] | [
"IsEquiv"
] | null | 80 | 80 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
WeakConnection(#l:lvl) :
(->
[ty : (U #l hcom)]
[a b : ty]
[p : (path [_] ty a b)]
(path [i] (path [_] ty (@ p i) b) p (abs [_] b)))
by {
(lam ty a b p =>
abs i j =>
`(hcom 1~>0 ty b
[i=0 [k] (hcom 0~>j ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[i=1 [k] (hcom 0~>1 ty (@ p k) [... | WeakConnection(#l:lvl) :
(->
[ty : (U #l hcom)]
[a b : ty]
[p : (path [_] ty a b)]
(path [i] (path [_] ty (@ p i) b) p (abs [_] b))) | by {
(lam ty a b p =>
abs i j =>
`(hcom 1~>0 ty b
[i=0 [k] (hcom 0~>j ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[i=1 [k] (hcom 0~>1 ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[j=0 [k] (hcom 0~>i ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[j=1 [k] (hcom 0~>1 ty (@ p k) [k=0 [... | theorem | WeakConnection | example | example/tutorial.prl | [] | [] | null | 82 | 96 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
GetEndpoints(#p, #t:[exp,exp].tac) = {
query pty <- #p;
match pty {
[ty l r | #jdg{(path [_] %ty %l %r)} =>
claim p/0 : (@ #p 0) = %l in %ty by {auto};
claim p/1 : (@ #p 1) = %r in %ty by {auto};
(#t p/0 p/1)
]
}
}. | GetEndpoints(#p, #t:[exp,exp].tac) | = {
query pty <- #p;
match pty {
[ty l r | #jdg{(path [_] %ty %l %r)} =>
claim p/0 : (@ #p 0) = %l in %ty by {auto};
claim p/1 : (@ #p 1) = %r in %ty by {auto};
(#t p/0 p/1)
]
}
}. | tactic | GetEndpoints | example | example/tutorial.prl | [] | [] | null | 98 | 107 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunToPairIsEquiv :
(->
[ty : (U 0 kan)]
(IsEquiv (-> bool ty) (* ty ty) ($ FunToPair ty)))
by {
lam ty pair =>
{ { lam b => if b then `(!proj1 pair) else `(!proj2 pair)
, abs _ => `pair }
, unfold Fiber;
lam {fun,p} =>
(GetEndpoints p [p/0 p/1] #tac{
(abs x =>
{lam b => if b the... | FunToPairIsEquiv :
(->
[ty : (U 0 kan)]
(IsEquiv (-> bool ty) (* ty ty) ($ FunToPair ty))) | by {
lam ty pair =>
{ { lam b => if b then `(!proj1 pair) else `(!proj2 pair)
, abs _ => `pair }
, unfold Fiber;
lam {fun,p} =>
(GetEndpoints p [p/0 p/1] #tac{
(abs x =>
{lam b => if b then `(!proj1 (@ p x)) else `(!proj2 (@ p x)),
abs y =>
`(@ ($ (WeakConnection #lv... | theorem | FunToPairIsEquiv | example | example/tutorial.prl | [] | [
"Fiber",
"FunToPair",
"GetEndpoints",
"IsEquiv",
"WeakConnection"
] | null | 112 | 141 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathFunToPair :
(->
[ty : (U 0 kan)]
(path [_] (U 0 kan) (-> bool ty) (* ty ty)))
by {
lam ty => abs x =>
`(V x (-> bool ty) (* ty ty)
(tuple [proj1 ($ FunToPair ty)] [proj2 ($ FunToPairIsEquiv ty)]))
}. | PathFunToPair :
(->
[ty : (U 0 kan)]
(path [_] (U 0 kan) (-> bool ty) (* ty ty))) | by {
lam ty => abs x =>
`(V x (-> bool ty) (* ty ty)
(tuple [proj1 ($ FunToPair ty)] [proj2 ($ FunToPairIsEquiv ty)]))
}. | theorem | PathFunToPair | example | example/tutorial.prl | [] | [
"FunToPair",
"FunToPairIsEquiv"
] | null | 143 | 151 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
RespectPaths :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty))
by {
lam ty fun =>
`(coe 0~>1 [x] (@ ($ PathFunToPair ty) x) fun)
}. | RespectPaths :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty)) | by {
lam ty fun =>
`(coe 0~>1 [x] (@ ($ PathFunToPair ty) x) fun)
}. | theorem | RespectPaths | example | example/tutorial.prl | [] | [
"PathFunToPair"
] | null | 158 | 166 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
ComputeCoercion :
(=
(* bool bool)
($ RespectPaths bool (lam [b] b))
(tuple [proj1 tt] [proj2 ff]))
by {
auto
}. | ComputeCoercion :
(=
(* bool bool)
($ RespectPaths bool (lam [b] b))
(tuple [proj1 tt] [proj2 ff])) | by {
auto
}. | theorem | ComputeCoercion | example | example/tutorial.prl | [] | [
"RespectPaths"
] | null | 171 | 178 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Refl :
(->
[ty : (U 0)]
[a : ty]
(path [_] ty a a))
by {
lam ty a =>
abs _ => `a
}. | Refl :
(->
[ty : (U 0)]
[a : ty]
(path [_] ty a a)) | by {
lam ty a =>
abs _ => `a
}. | theorem | Refl | example | example/tutorial.prl | [] | [] | null | 186 | 194 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunPath :
(->
[a b : (U 0)]
[f g : (-> a b)]
(path [_] (-> a b) f g)
[arg : a]
(path [_] b ($ f arg) ($ g arg)))
by {
lam a b f g p =>
lam arg => abs x =>
`($ (@ p x) arg)
}. | FunPath :
(->
[a b : (U 0)]
[f g : (-> a b)]
(path [_] (-> a b) f g)
[arg : a]
(path [_] b ($ f arg) ($ g arg))) | by {
lam a b f g p =>
lam arg => abs x =>
`($ (@ p x) arg)
}. | theorem | FunPath | example | example/tutorial.prl | [] | [] | null | 198 | 209 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a))
by {
// a -- x
// ------- |
// | | y
// p | | a
// | |
// b .... a
lam ty a b p =>
abs x =>
`(hcom 0~>1 ty a [x=0 [y] (@ p y)] [x=1 [_] a])
}. | PathInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a)) | by {
// a -- x
// ------- |
// | | y
// p | | a
// | |
// b .... a
lam ty a b p =>
abs x =>
`(hcom 0~>1 ty a [x=0 [y] (@ p y)] [x=1 [_] a])
}. | theorem | PathInv | example | example/tutorial.prl | [] | [] | null | 214 | 231 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathConcat :
(->
[ty : (U 0 kan)]
[a b c : ty]
[p : (path [_] ty a b)]
[q : (path [_] ty b c)]
(path [_] ty a c))
by {
// p -- x
// ------- |
// | | y
// a | | q
// | |
// a .... c
lam ty a b c p q =>
abs x =>
`(hcom 0~>1 ty (@ p x) [x=0 [_]... | PathConcat :
(->
[ty : (U 0 kan)]
[a b c : ty]
[p : (path [_] ty a b)]
[q : (path [_] ty b c)]
(path [_] ty a c)) | by {
// p -- x
// ------- |
// | | y
// a | | q
// | |
// a .... c
lam ty a b c p q =>
abs x =>
`(hcom 0~>1 ty (@ p x) [x=0 [_] a] [x=1 [y] (@ q y)])
}. | theorem | PathConcat | example | example/tutorial.prl | [] | [] | null | 233 | 251 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
InvRefl :
(->
[ty : (U 0 kan)]
[a : ty]
(path
[_] (path [_] ty a a)
($ PathInv ty a a (abs [_] a))
(abs [_] a)))
by {
// See diagram!
lam ty a =>
abs x y =>
`(hcom 0~>1 ty a
[x=0 [z] (hcom 0~>z ty a [y=0 [_] a] [y=1 [_] a])]
[x=1 [_] a]
[y=0 [_] a]
[y=1 [_] a])
}. | InvRefl :
(->
[ty : (U 0 kan)]
[a : ty]
(path
[_] (path [_] ty a a)
($ PathInv ty a a (abs [_] a))
(abs [_] a))) | by {
// See diagram!
lam ty a =>
abs x y =>
`(hcom 0~>1 ty a
[x=0 [z] (hcom 0~>z ty a [y=0 [_] a] [y=1 [_] a])]
[x=1 [_] a]
[y=0 [_] a]
[y=1 [_] a])
}. | theorem | InvRefl | example | example/tutorial.prl | [] | [
"PathInv"
] | null | 253 | 270 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
J(#l:lvl) :
(->
[ty : (U #l kan)]
[a : ty]
[fam : (-> [x : ty] (path [_] ty a x) (U #l kan))]
[d : ($ fam a (abs [_] a))]
[x : ty]
[p : (path [_] ty a x)]
($ fam x p))
by {
lam ty a fam d x p =>
`(coe 0~>1
[i] ($ fam
(hcom 0~>1 ty a [i=0 [_] a] [i=1 [j] (@ p j)])
(ab... | J(#l:lvl) :
(->
[ty : (U #l kan)]
[a : ty]
[fam : (-> [x : ty] (path [_] ty a x) (U #l kan))]
[d : ($ fam a (abs [_] a))]
[x : ty]
[p : (path [_] ty a x)]
($ fam x p)) | by {
lam ty a fam d x p =>
`(coe 0~>1
[i] ($ fam
(hcom 0~>1 ty a [i=0 [_] a] [i=1 [j] (@ p j)])
(abs [j] (hcom 0~>j ty a [i=0 [_] a] [i=1 [j] (@ p j)]))) d)
}. | theorem | J | example | example/tutorial.prl | [] | [] | null | 275 | 290 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
JInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a))
by {
lam ty a b p =>
exact
($ (J #lvl{0})
ty
a
(lam [b _] (path [_] ty b a))
(abs [_] a)
b
p)
; auto
//; unfold J; reduce at left right; ?
}. | JInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a)) | by {
lam ty a b p =>
exact
($ (J #lvl{0})
ty
a
(lam [b _] (path [_] ty b a))
(abs [_] a)
b
p)
; auto
//; unfold J; reduce at left right; ?
}. | theorem | JInv | example | example/tutorial.prl | [] | [] | null | 292 | 310 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Shannon :
(->
[ty : (-> bool (U 0))]
[elt : (-> [b : bool] ($ ty b))]
[b : bool]
(= ($ ty b) ($ elt b) (if [b] ($ ty b) b ($ elt tt) ($ elt ff))))
by {
lam ty elt b =>
elim b; auto
}. | Shannon :
(->
[ty : (-> bool (U 0))]
[elt : (-> [b : bool] ($ ty b))]
[b : bool]
(= ($ ty b) ($ elt b) (if [b] ($ ty b) b ($ elt tt) ($ elt ff)))) | by {
lam ty elt b =>
elim b; auto
}. | theorem | Shannon | example | example/tutorial.prl | [] | [] | null | 318 | 327 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Not :
(-> bool bool)
by {
?
}. | Not :
(-> bool bool) | by {
?
}. | theorem | Not | example | example/tutorial1.prl | [] | [] | null | 6 | 10 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
NotNot :
(->
[b : bool]
(= bool ($ Not ($ Not b)) b))
by {
?
}. | NotNot :
(->
[b : bool]
(= bool ($ Not ($ Not b)) b)) | by {
?
}. | theorem | NotNot | example | example/tutorial1.prl | [] | [
"Not"
] | null | 34 | 40 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
RespectEquality :
(->
[family : (-> [b : bool] (U 0))]
[b : bool]
($ family b)
($ family ($ Not ($ Not b))))
by {
?
}. | RespectEquality :
(->
[family : (-> [b : bool] (U 0))]
[b : bool]
($ family b)
($ family ($ Not ($ Not b)))) | by {
?
}. | theorem | RespectEquality | example | example/tutorial1.prl | [] | [
"Not"
] | null | 64 | 72 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
EqualityIrrelevant :
(=
(-> [b : bool] (= bool ($ Not ($ Not b)) b))
NotNot
(lam [b] ax))
by {
?
}. | EqualityIrrelevant :
(=
(-> [b : bool] (= bool ($ Not ($ Not b)) b))
NotNot
(lam [b] ax)) | by {
?
}. | theorem | EqualityIrrelevant | example | example/tutorial1.prl | [] | [
"Not",
"NotNot"
] | null | 96 | 103 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunToPair :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty))
by {
lam ty fun =>
{`($ fun tt), `($ fun ff)}
}. | FunToPair :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty)) | by {
lam ty fun =>
{`($ fun tt), `($ fun ff)}
}. | theorem | FunToPair | example | example/tutorial1.prl | [] | [] | null | 127 | 135 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
HasAllPathsTo (#C,#c) = (-> [c' : #C] (path [_] #C c' #c)). | HasAllPathsTo (#C,#c) | = (-> [c' : #C] (path [_] #C c' #c)). | define | HasAllPathsTo | example | example/tutorial1.prl | [] | [] | null | 139 | 139 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsContr (#C) = (* [c : #C] (HasAllPathsTo #C c)). | IsContr (#C) | = (* [c : #C] (HasAllPathsTo #C c)). | define | IsContr | example | example/tutorial1.prl | [] | [
"HasAllPathsTo"
] | null | 140 | 140 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Fiber (#A,#B,#f,#b) = (* [a : #A] (path [_] #B ($ #f a) #b)). | Fiber (#A,#B,#f,#b) | = (* [a : #A] (path [_] #B ($ #f a) #b)). | define | Fiber | example | example/tutorial1.prl | [] | [] | null | 141 | 141 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsEquiv (#A,#B,#f) = (-> [b : #B] (IsContr (Fiber #A #B #f b))). | IsEquiv (#A,#B,#f) | = (-> [b : #B] (IsContr (Fiber #A #B #f b))). | define | IsEquiv | example | example/tutorial1.prl | [] | [
"Fiber",
"IsContr"
] | null | 142 | 142 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Equiv (#A,#B) = (* [f : (-> #A #B)] (IsEquiv #A #B f)). | Equiv (#A,#B) | = (* [f : (-> #A #B)] (IsEquiv #A #B f)). | define | Equiv | example | example/tutorial1.prl | [] | [
"IsEquiv"
] | null | 143 | 143 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
WeakConnection(#l:lvl) :
(->
[ty : (U #l hcom)]
[a b : ty]
[p : (path [_] ty a b)]
(path [i] (path [_] ty (@ p i) b) p (abs [_] b)))
by {
(lam ty a b p =>
abs i j =>
`(hcom 1~>0 ty b
[i=0 [k] (hcom 0~>j ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[i=1 [k] (hcom 0~>1 ty (@ p k) [... | WeakConnection(#l:lvl) :
(->
[ty : (U #l hcom)]
[a b : ty]
[p : (path [_] ty a b)]
(path [i] (path [_] ty (@ p i) b) p (abs [_] b))) | by {
(lam ty a b p =>
abs i j =>
`(hcom 1~>0 ty b
[i=0 [k] (hcom 0~>j ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[i=1 [k] (hcom 0~>1 ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[j=0 [k] (hcom 0~>i ty (@ p k) [k=0 [w] (@ p w)] [k=1 [_] b])]
[j=1 [k] (hcom 0~>1 ty (@ p k) [k=0 [... | theorem | WeakConnection | example | example/tutorial1.prl | [] | [] | null | 145 | 159 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunToPairIsEquiv :
(->
[ty : (U 0 kan)]
(IsEquiv (-> bool ty) (* ty ty) ($ FunToPair ty)))
by {
lam ty pair =>
{ { lam b => if b then `(!proj1 pair) else `(!proj2 pair)
, abs _ => `pair }
, unfold Fiber;
lam {fun,p} =>
fresh x:dim -> refine path/intro; [
{lam b => if b then `(!proj1 ... | FunToPairIsEquiv :
(->
[ty : (U 0 kan)]
(IsEquiv (-> bool ty) (* ty ty) ($ FunToPair ty))) | by {
lam ty pair =>
{ { lam b => if b then `(!proj1 pair) else `(!proj2 pair)
, abs _ => `pair }
, unfold Fiber;
lam {fun,p} =>
fresh x:dim -> refine path/intro; [
{lam b => if b then `(!proj1 (@ p x)) else `(!proj2 (@ p x)),
abs y =>
`(@ ($ (WeakConnection #lvl{0}) (* ty... | theorem | FunToPairIsEquiv | example | example/tutorial1.prl | [] | [
"Fiber",
"FunToPair",
"IsEquiv",
"WeakConnection"
] | null | 161 | 202 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathFunToPair :
(->
[ty : (U 0 kan)]
(path [_] (U 0 kan) (-> bool ty) (* ty ty)))
by {
lam ty => abs x =>
`(V x (-> bool ty) (* ty ty)
(tuple [proj1 ($ FunToPair ty)] [proj2 ($ FunToPairIsEquiv ty)]))
}. | PathFunToPair :
(->
[ty : (U 0 kan)]
(path [_] (U 0 kan) (-> bool ty) (* ty ty))) | by {
lam ty => abs x =>
`(V x (-> bool ty) (* ty ty)
(tuple [proj1 ($ FunToPair ty)] [proj2 ($ FunToPairIsEquiv ty)]))
}. | theorem | PathFunToPair | example | example/tutorial1.prl | [] | [
"FunToPair",
"FunToPairIsEquiv"
] | null | 204 | 212 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
RespectPaths :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty))
by {
lam ty fun =>
`(coe 0~>1 [x] (@ ($ PathFunToPair ty) x) fun)
}. | RespectPaths :
(->
[ty : (U 0 kan)]
(-> bool ty)
(* ty ty)) | by {
lam ty fun =>
`(coe 0~>1 [x] (@ ($ PathFunToPair ty) x) fun)
}. | theorem | RespectPaths | example | example/tutorial1.prl | [] | [
"PathFunToPair"
] | null | 238 | 246 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
ComputeCoercion :
(=
(* bool bool)
($ RespectPaths bool (lam [b] b))
(tuple [proj1 tt] [proj2 ff]))
by {
auto
}. | ComputeCoercion :
(=
(* bool bool)
($ RespectPaths bool (lam [b] b))
(tuple [proj1 tt] [proj2 ff])) | by {
auto
}. | theorem | ComputeCoercion | example | example/tutorial1.prl | [] | [
"RespectPaths"
] | null | 270 | 277 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Refl :
(->
[ty : (U 0)]
[a : ty]
(path [_] ty a a))
by {
?
}. | Refl :
(->
[ty : (U 0)]
[a : ty]
(path [_] ty a a)) | by {
?
}. | theorem | Refl | example | example/tutorial2.prl | [] | [] | null | 6 | 13 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
FunPath :
(->
[a b : (U 0)]
[f g : (-> a b)]
(path [_] (-> a b) f g)
[arg : a]
(path [_] b ($ f arg) ($ g arg)))
by {
?
}. | FunPath :
(->
[a b : (U 0)]
[f g : (-> a b)]
(path [_] (-> a b) f g)
[arg : a]
(path [_] b ($ f arg) ($ g arg))) | by {
?
}. | theorem | FunPath | example | example/tutorial2.prl | [] | [] | null | 37 | 46 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a))
by {
// a -- x
// ------- |
// | | y
// p | | a
// | |
// b .... a
?
}. | PathInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a)) | by {
// a -- x
// ------- |
// | | y
// p | | a
// | |
// b .... a
?
}. | theorem | PathInv | example | example/tutorial2.prl | [] | [] | null | 70 | 85 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathConcat :
(->
[ty : (U 0 kan)]
[a b c : ty]
[p : (path [_] ty a b)]
[q : (path [_] ty b c)]
(path [_] ty a c))
by {
// p -- x
// ------- |
// | | y
// a | | q
// | |
// a .... c
?
}. | PathConcat :
(->
[ty : (U 0 kan)]
[a b c : ty]
[p : (path [_] ty a b)]
[q : (path [_] ty b c)]
(path [_] ty a c)) | by {
// p -- x
// ------- |
// | | y
// a | | q
// | |
// a .... c
?
}. | theorem | PathConcat | example | example/tutorial2.prl | [] | [] | null | 109 | 125 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
InvRefl :
(->
[ty : (U 0 kan)]
[a : ty]
(path
[_] (path [_] ty a a)
($ PathInv ty a a (abs [_] a))
(abs [_] a)))
by {
// See diagram!
lam ty a =>
abs x y =>
`(hcom 0~>1 ty a
[x=0 [z] (hcom 0~>z ty a [y=0 [_] a] [y=1 [_] a])]
[x=1 [_] a]
[y=0 [_] a]
[y=1 [_] a])
}. | InvRefl :
(->
[ty : (U 0 kan)]
[a : ty]
(path
[_] (path [_] ty a a)
($ PathInv ty a a (abs [_] a))
(abs [_] a))) | by {
// See diagram!
lam ty a =>
abs x y =>
`(hcom 0~>1 ty a
[x=0 [z] (hcom 0~>z ty a [y=0 [_] a] [y=1 [_] a])]
[x=1 [_] a]
[y=0 [_] a]
[y=1 [_] a])
}. | theorem | InvRefl | example | example/tutorial2.prl | [] | [
"PathInv"
] | null | 147 | 164 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
J(#l:lvl) :
(->
[ty : (U #l kan)]
[a : ty]
[fam : (-> [x : ty] (path [_] ty a x) (U #l kan))]
[d : ($ fam a (abs [_] a))]
[x : ty]
[p : (path [_] ty a x)]
($ fam x p))
by {
lam ty a fam d x p =>
`(coe 0~>1
[i] ($ fam
(hcom 0~>1 ty a [i=0 [_] a] [i=1 [j] (@ p j)])
(ab... | J(#l:lvl) :
(->
[ty : (U #l kan)]
[a : ty]
[fam : (-> [x : ty] (path [_] ty a x) (U #l kan))]
[d : ($ fam a (abs [_] a))]
[x : ty]
[p : (path [_] ty a x)]
($ fam x p)) | by {
lam ty a fam d x p =>
`(coe 0~>1
[i] ($ fam
(hcom 0~>1 ty a [i=0 [_] a] [i=1 [j] (@ p j)])
(abs [j] (hcom 0~>j ty a [i=0 [_] a] [i=1 [j] (@ p j)]))) d)
}. | theorem | J | example | example/tutorial2.prl | [] | [] | null | 189 | 204 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
JInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a))
by {
lam ty a b p =>
exact
($ (J #lvl{0})
ty
a
(lam [b _] (path [_] ty b a))
(abs [_] a)
b
p);
?
}. | JInv :
(->
[ty : (U 0 kan)]
[a b : ty]
[p : (path [_] ty a b)]
(path [_] ty b a)) | by {
lam ty a b p =>
exact
($ (J #lvl{0})
ty
a
(lam [b _] (path [_] ty b a))
(abs [_] a)
b
p);
?
}. | theorem | JInv | example | example/tutorial2.prl | [] | [] | null | 226 | 243 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsContr (#C) = (* [c : #C] (-> [c' : #C] (path [_] #C c' c))). | IsContr (#C) | = (* [c : #C] (-> [c' : #C] (path [_] #C c' c))). | define | IsContr | example | example/univalence.prl | [] | [] | null | 1 | 1 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Fiber (#A,#B,#f,#b) = (* [a : #A] (path [_] #B ($ #f a) #b)). | Fiber (#A,#B,#f,#b) | = (* [a : #A] (path [_] #B ($ #f a) #b)). | define | Fiber | example | example/univalence.prl | [] | [] | null | 3 | 3 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsEquiv (#A,#B,#f) = (-> [b : #B] (IsContr (Fiber #A #B #f b))). | IsEquiv (#A,#B,#f) | = (-> [b : #B] (IsContr (Fiber #A #B #f b))). | define | IsEquiv | example | example/univalence.prl | [] | [
"Fiber",
"IsContr"
] | null | 5 | 5 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Equiv (#A,#B) = (* [f : (-> #A #B)] (IsEquiv #A #B f)). | Equiv (#A,#B) | = (* [f : (-> #A #B)] (IsEquiv #A #B f)). | define | Equiv | example | example/univalence.prl | [] | [
"IsEquiv"
] | null | 7 | 7 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsProp (#C) = (-> [c c' : #C] (path [_] #C c c')). | IsProp (#C) | = (-> [c c' : #C] (path [_] #C c c')). | define | IsProp | example | example/univalence.prl | [] | [] | null | 9 | 9 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsSet (#C) = (-> [c c' : #C] (IsProp (path [_] #C c c'))). | IsSet (#C) | = (-> [c c' : #C] (IsProp (path [_] #C c c'))). | define | IsSet | example | example/univalence.prl | [] | [
"IsProp"
] | null | 11 | 11 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Retract (#A,#f,#g) = (-> [a : #A] (path [_] #A ($ #g ($ #f a)) a)). | Retract (#A,#f,#g) | = (-> [a : #A] (path [_] #A ($ #g ($ #f a)) a)). | define | Retract | example | example/univalence.prl | [] | [] | null | 13 | 13 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IdEquiv(#l:lvl) :
(-> [ty : (U #l hcom)] (Equiv ty ty))
by {
lam ty =>
{ lam a => use a
, lam a =>
{ {use a, abs _ => use a}
, lam {_,c'} => abs i =>
{`(hcom 1~>0 ty a [i=0 [j] (@ c' j)] [i=1 [j] a]),
abs j => `(hcom 1~>j ty a [i=0 [j] (@ c' j)] [i=1 [j] a])}
}
}
}. | IdEquiv(#l:lvl) :
(-> [ty : (U #l hcom)] (Equiv ty ty)) | by {
lam ty =>
{ lam a => use a
, lam a =>
{ {use a, abs _ => use a}
, lam {_,c'} => abs i =>
{`(hcom 1~>0 ty a [i=0 [j] (@ c' j)] [i=1 [j] a]),
abs j => `(hcom 1~>j ty a [i=0 [j] (@ c' j)] [i=1 [j] a])}
}
}
}. | theorem | IdEquiv | example | example/univalence.prl | [] | [
"Equiv"
] | null | 15 | 27 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
UA(#l:lvl) :
(-> [ty/a ty/b : (U #l kan)]
[e : (Equiv ty/a ty/b)]
(path [_] (U #l kan) ty/a ty/b))
by {
lam ty/a ty/b e =>
abs x => `(V x ty/a ty/b e)
}. | UA(#l:lvl) :
(-> [ty/a ty/b : (U #l kan)]
[e : (Equiv ty/a ty/b)]
(path [_] (U #l kan) ty/a ty/b)) | by {
lam ty/a ty/b e =>
abs x => `(V x ty/a ty/b e)
}. | theorem | UA | example | example/univalence.prl | [] | [
"Equiv"
] | null | 32 | 39 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
UABeta(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[e : (Equiv ty/a ty/b)]
[a : ty/a]
(path [_] ty/b
(coe 0~>1 [x] (@ ($ (UA #l) ty/a ty/b e) x) a)
($ (!proj1 e) a)))
by {
unfold UA;
lam ty/a ty/b {f,_} a =>
abs x => `(coe x~>1 [_] ty/b ($ f a))
}. | UABeta(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[e : (Equiv ty/a ty/b)]
[a : ty/a]
(path [_] ty/b
(coe 0~>1 [x] (@ ($ (UA #l) ty/a ty/b e) x) a)
($ (!proj1 e) a))) | by {
unfold UA;
lam ty/a ty/b {f,_} a =>
abs x => `(coe x~>1 [_] ty/b ($ f a))
}. | theorem | UABeta | example | example/univalence.prl | [] | [
"Equiv",
"UA"
] | null | 41 | 53 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PathToEquiv(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[p : (path [_] (U #l kan) ty/a ty/b)]
(Equiv ty/a ty/b))
by {
lam ty/a ty/b p =>
`(coe 0~>1 [x] (Equiv ty/a (@ p x)) ($ (IdEquiv #l) ty/a))
}. | PathToEquiv(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[p : (path [_] (U #l kan) ty/a ty/b)]
(Equiv ty/a ty/b)) | by {
lam ty/a ty/b p =>
`(coe 0~>1 [x] (Equiv ty/a (@ p x)) ($ (IdEquiv #l) ty/a))
}. | theorem | PathToEquiv | example | example/univalence.prl | [] | [
"Equiv",
"IdEquiv"
] | null | 58 | 66 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
LemPropF(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[p : (-> dim ty/a)]
[b0 : ($ ty/b (@ p 0))]
[b1 : ($ ty/b (@ p 1))]
(path [x] ($ ty/b (@ p x)) b0 b1))
by {
lam ty/a ty/b prop/b p b0 b1 => abs x =>
use prop/b
[ use... | LemPropF(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[p : (-> dim ty/a)]
[b0 : ($ ty/b (@ p 0))]
[b1 : ($ ty/b (@ p 1))]
(path [x] ($ ty/b (@ p x)) b0 b1)) | by {
lam ty/a ty/b prop/b p b0 b1 => abs x =>
use prop/b
[ use p [`x]
, `(coe 0~>x [i] ($ ty/b (@ p i)) b0)
, `(coe 1~>x [i] ($ ty/b (@ p i)) b1)
, `x
]
}. | theorem | LemPropF | example | example/univalence.prl | [] | [
"IsProp"
] | null | 68 | 85 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
LemSig(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[u v : (* [a : ty/a] ($ ty/b a))]
[p : (path [_] ty/a (!proj1 u) (!proj1 v))]
(path [_] (* [a : ty/a] ($ ty/b a)) u v))
by {
lam ty/a ty/b prop/b {u1, u2} {v1, v2} p => abs x =>
... | LemSig(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[u v : (* [a : ty/a] ($ ty/b a))]
[p : (path [_] ty/a (!proj1 u) (!proj1 v))]
(path [_] (* [a : ty/a] ($ ty/b a)) u v)) | by {
lam ty/a ty/b prop/b {u1, u2} {v1, v2} p => abs x =>
{ use p [`x]
, use (LemPropF #l) [`ty/a, `ty/b, `prop/b, abs i => use p [`i], `u2, `v2, `x]
}
}. | theorem | LemSig | example | example/univalence.prl | [] | [
"IsProp",
"LemPropF"
] | null | 87 | 100 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PropSig(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/a : (IsProp ty/a)]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[u v : (* [a : ty/a] ($ ty/b a))]
(path [_] (* [a : ty/a] ($ ty/b a)) u v))
by {
lam ty/a ty/b prop/a prop/b u v =>
use (LemSig #l)
[ `ty/a
... | PropSig(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/a : (IsProp ty/a)]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[u v : (* [a : ty/a] ($ ty/b a))]
(path [_] (* [a : ty/a] ($ ty/b a)) u v)) | by {
lam ty/a ty/b prop/a prop/b u v =>
use (LemSig #l)
[ `ty/a
, `ty/b
, `prop/b
, `u
, `v
, use prop/a [let {u1, _} = u; `u1, let {v1, _} = v; `v1]
]
}. | theorem | PropSig | example | example/univalence.prl | [] | [
"IsProp",
"LemSig"
] | null | 102 | 120 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PropPi(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[f g : (-> [a : ty/a] ($ ty/b a))]
(path [_] (-> [a : ty/a] ($ ty/b a)) f g))
by {
lam ty/a ty/b prop/b f g =>
abs x => lam a =>
use prop/b [`a, use f [`a], use g [`a], `x];
}. | PropPi(#l:lvl) :
(->
[ty/a : (U #l kan)]
[ty/b : (-> ty/a (U #l kan))]
[prop/b : (-> [a : ty/a] (IsProp ($ ty/b a)))]
[f g : (-> [a : ty/a] ($ ty/b a))]
(path [_] (-> [a : ty/a] ($ ty/b a)) f g)) | by {
lam ty/a ty/b prop/b f g =>
abs x => lam a =>
use prop/b [`a, use f [`a], use g [`a], `x];
}. | theorem | PropPi | example | example/univalence.prl | [] | [
"IsProp"
] | null | 122 | 133 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
LemProp(#l:lvl) :
(->
[ty/a : (U #l kan)]
[prop/a : (IsProp ty/a)]
[a : ty/a]
(IsContr ty/a))
by {
lam ty/a prop/a a =>
{`a , lam a' => use prop/a [`a', `a]}
}. | LemProp(#l:lvl) :
(->
[ty/a : (U #l kan)]
[prop/a : (IsProp ty/a)]
[a : ty/a]
(IsContr ty/a)) | by {
lam ty/a prop/a a =>
{`a , lam a' => use prop/a [`a', `a]}
}. | theorem | LemProp | example | example/univalence.prl | [] | [
"IsContr",
"IsProp"
] | null | 136 | 145 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PropSet(#l:lvl) :
(->
[ty : (U #l kan)]
[prop : (IsProp ty)]
(IsSet ty))
by {
unfold IsProp IsSet;
lam ty prop a b p q => abs x y =>
`(hcom 0~>1 ty a
[y=0 [z] (@ ($ prop a a) z)]
[y=1 [z] (@ ($ prop a b) z)]
[x=0 [z] (@ ($ prop a (@ p y)) z)]
[x=1 [z] (@ ($ prop a (@ q y)) z)]... | PropSet(#l:lvl) :
(->
[ty : (U #l kan)]
[prop : (IsProp ty)]
(IsSet ty)) | by {
unfold IsProp IsSet;
lam ty prop a b p q => abs x y =>
`(hcom 0~>1 ty a
[y=0 [z] (@ ($ prop a a) z)]
[y=1 [z] (@ ($ prop a b) z)]
[x=0 [z] (@ ($ prop a (@ p y)) z)]
[x=1 [z] (@ ($ prop a (@ q y)) z)])
}. | theorem | PropSet | example | example/univalence.prl | [] | [
"IsProp",
"IsSet"
] | null | 147 | 160 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PropIsContr(#l:lvl) :
(->
[ty/a : (U #l kan)]
(IsProp (IsContr ty/a)))
by {
lam ty/a isContr =>
claim contr/a/prop : (IsProp (IsContr ty/a)) by {
let {_,contr} = isContr;
claim prop/a : (IsProp ty/a) by {
lam a a' => abs x =>
`(hcom 1~>0 ty/a (@ ($ contr a) x)
[x=... | PropIsContr(#l:lvl) :
(->
[ty/a : (U #l kan)]
(IsProp (IsContr ty/a))) | by {
lam ty/a isContr =>
claim contr/a/prop : (IsProp (IsContr ty/a)) by {
let {_,contr} = isContr;
claim prop/a : (IsProp ty/a) by {
lam a a' => abs x =>
`(hcom 1~>0 ty/a (@ ($ contr a) x)
[x=0 [_] a]
[x=1 [y] (@ ($ contr a') y)])
};
use (PropSig... | theorem | PropIsContr | example | example/univalence.prl | [] | [
"IsContr",
"IsProp",
"PropPi",
"PropSet",
"PropSig"
] | null | 162 | 191 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
PropIsEquiv(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[f : (-> ty/a ty/b)]
(IsProp (IsEquiv ty/a ty/b f)))
by {
lam ty/a ty/b f e0 e1 =>
abs x => lam b =>
use (PropIsContr #l)
[ `(Fiber ty/a ty/b f b)
, use e0 [`b]
, use e1 [`b]
, `x
]
}. | PropIsEquiv(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[f : (-> ty/a ty/b)]
(IsProp (IsEquiv ty/a ty/b f))) | by {
lam ty/a ty/b f e0 e1 =>
abs x => lam b =>
use (PropIsContr #l)
[ `(Fiber ty/a ty/b f b)
, use e0 [`b]
, use e1 [`b]
, `x
]
}. | theorem | PropIsEquiv | example | example/univalence.prl | [] | [
"Fiber",
"IsEquiv",
"IsProp",
"PropIsContr"
] | null | 193 | 207 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
EquivLemma(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[e1 e2 : (Equiv ty/a ty/b)]
(path [_] (-> ty/a ty/b) (!proj1 e1) (!proj1 e2))
(path [_] (Equiv ty/a ty/b) e1 e2))
by {
lam ty/a ty/b =>
use (LemSig #l)
[ `(-> ty/a ty/b)
, lam f => `(IsEquiv ty/a ty/b f)
, use (PropIsEquiv #l) [`ty/... | EquivLemma(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[e1 e2 : (Equiv ty/a ty/b)]
(path [_] (-> ty/a ty/b) (!proj1 e1) (!proj1 e2))
(path [_] (Equiv ty/a ty/b) e1 e2)) | by {
lam ty/a ty/b =>
use (LemSig #l)
[ `(-> ty/a ty/b)
, lam f => `(IsEquiv ty/a ty/b f)
, use (PropIsEquiv #l) [`ty/a, `ty/b]
]
}. | theorem | EquivLemma | example | example/univalence.prl | [] | [
"Equiv",
"IsEquiv",
"LemSig",
"PropIsEquiv"
] | null | 209 | 222 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
UARet(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
(Retract
(Equiv ty/a ty/b)
($ (UA #l) ty/a ty/b)
($ (PathToEquiv #l) ty/a ty/b)))
by {
lam ty/a ty/b e =>
use (EquivLemma #l)
[ `ty/a
, `ty/b
, use (PathToEquiv #l) [`ty/a, `ty/b, use (UA #l) [`ty/a, `ty/b, `e]]
, `e
, ... | UARet(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
(Retract
(Equiv ty/a ty/b)
($ (UA #l) ty/a ty/b)
($ (PathToEquiv #l) ty/a ty/b))) | by {
lam ty/a ty/b e =>
use (EquivLemma #l)
[ `ty/a
, `ty/b
, use (PathToEquiv #l) [`ty/a, `ty/b, use (UA #l) [`ty/a, `ty/b, `e]]
, `e
, abs x => lam a =>
use (UABeta #l) [`ty/a, `ty/b, `e, `(coe 1~>x [_] ty/a a), `x]
];
unfold PathToEquiv at right in concl; au... | theorem | UARet | example | example/univalence.prl | [] | [
"Equiv",
"EquivLemma",
"PathToEquiv",
"Retract",
"UA",
"UABeta"
] | null | 224 | 243 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
IsContrPath(#l:lvl) :
(->
[ty/a : (U #l kan)]
(IsContr (* [ty/b : (U #l kan)] (path [_] (U #l kan) ty/a ty/b))))
by {
lam ty/a =>
{ {use ty/a, abs _ => use ty/a},
lam {ty/b,p} => abs x =>
{ `(hcom 0~>1 (U #l kan) ty/a [x=0 [y] (@ p y)] [x=1 [_] ty/a])
, abs y => `(hcom 0~>y (U #l kan) ty/a ... | IsContrPath(#l:lvl) :
(->
[ty/a : (U #l kan)]
(IsContr (* [ty/b : (U #l kan)] (path [_] (U #l kan) ty/a ty/b)))) | by {
lam ty/a =>
{ {use ty/a, abs _ => use ty/a},
lam {ty/b,p} => abs x =>
{ `(hcom 0~>1 (U #l kan) ty/a [x=0 [y] (@ p y)] [x=1 [_] ty/a])
, abs y => `(hcom 0~>y (U #l kan) ty/a [x=0 [y] (@ p y)] [x=1 [_] ty/a])
}
}
}. | theorem | IsContrPath | example | example/univalence.prl | [] | [
"IsContr"
] | null | 245 | 258 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
RetIsContr(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[f : (-> ty/a ty/b)]
[g : (-> ty/b ty/a)]
[h : (-> [a : ty/a] (path [_] ty/a ($ g ($ f a)) a))]
[contr/b : (IsContr ty/b)]
(IsContr ty/a))
by {
lam ty/a ty/b f g h {b,p} =>
{`($ g b),
lam a => abs x =>
`(hcom 0~>1 ty/a ($ g (@ ($ p ($ f a... | RetIsContr(#l:lvl) :
(->
[ty/a ty/b : (U #l kan)]
[f : (-> ty/a ty/b)]
[g : (-> ty/b ty/a)]
[h : (-> [a : ty/a] (path [_] ty/a ($ g ($ f a)) a))]
[contr/b : (IsContr ty/b)]
(IsContr ty/a)) | by {
lam ty/a ty/b f g h {b,p} =>
{`($ g b),
lam a => abs x =>
`(hcom 0~>1 ty/a ($ g (@ ($ p ($ f a)) x))
[x=0 [y] (@ ($ h a) y)]
[x=1 [_] ($ g b)])}
}. | theorem | RetIsContr | example | example/univalence.prl | [] | [
"IsContr"
] | null | 260 | 275 | true | https://github.com/RedPRL/sml-redprl | c72190de76f7ed1cfbe1d2046c96e99ac5022b0c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.