Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 103 items • Updated • 3
statement stringlengths 1 693 | proof stringlengths 0 9.09k | type stringclasses 7
values | symbolic_name stringlengths 1 30 | library stringclasses 95
values | filename stringclasses 522
values | imports listlengths 0 0 | deps listlengths 0 25 | docstring stringclasses 1
value | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
nctx | = name | schema | nctx | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ctx | = some [A:tp] block x : name, h : hyp x A | schema | ctx | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"hyp",
"tp"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
dual_sym : [ ⊢ dual A A' ] → [ ⊢ dual A' A] | =
/ total 1 /
fn d ⇒
case d of
| [ ⊢ D1] ⇒ [ ⊢ D⊥]
| [ ⊢ D⊥] ⇒ [ ⊢ D1]
| [ ⊢ D⊗ Dl Dr] ⇒
let [ ⊢ l] = dual_sym [ ⊢ Dl] in
let [ ⊢ r] = dual_sym [ ⊢ Dr] in
[ ⊢ D⅋ l r]
| [ ⊢ D⅋ Dl Dr] ⇒
let [ ⊢ l] = dual_sym [ ⊢ Dl] in
let [ ⊢ r] = dual_sym [ ⊢ Dr] in
[ ⊢ D⊗ l r]
| [ ⊢ D⊕ Dl Dr] ⇒
let [ ⊢ l] = dual_sym [ ⊢... | rec | dual_sym | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
dual_uniq : [ ⊢ dual A A' ] → [ ⊢ dual A A''] → [ ⊢ eq A' A''] | =
/ total 1 /
fn d1 ⇒ fn d2 ⇒ case d1 of
| [ ⊢ D1] ⇒
let [ ⊢ D1] = d2 in
[ ⊢ refl]
| [ ⊢ D⊥] ⇒
let [ ⊢ D⊥] = d2 in
[ ⊢ refl]
| [ ⊢ D⊗ d1l d1r] ⇒
let [ ⊢ D⊗ d2l d2r] = d2 in
let [ ⊢ refl] = dual_uniq [ ⊢ d1l] [ ⊢ d2l] in
let [ ⊢ refl] = dual_uniq [ ⊢ d1r] [ ⊢ d2r] in
[ ⊢ refl]
| [ ⊢ D⅋ d1l d1r] ⇒
let [... | rec | dual_uniq | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"eq",
"refl"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
lin_name_must_appear : (g : nctx) [g ⊢ linear (\x. P[..])] → [ ⊢ imposs] | =
/ total 1 /
fn linP ⇒ case linP of
% principal cases are inferred to be impossible
| [g ⊢ l_wait2 linQ] ⇒ lin_name_must_appear [g ⊢ linQ]
| [g ⊢ l_out2 (\y. linQ)] ⇒ lin_name_must_appear [g, y:name ⊢ linQ]
| [g ⊢ l_out3 (\y. linQ)] ⇒ lin_name_must_appear [g, y:name ⊢ linQ]
| [g ⊢ l_inp2 (\y.\z. linQ)] ⇒ lin_name_must... | rec | lin_name_must_appear | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"nctx"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
Result : (g : ctx){P : [g ⊢ proc]}{Q : [g, x:name ⊢ proc]} → ctype | =
| Res : {Q' : [g ⊢ proc]}
→ [g, x:name ⊢ eq_proc Q Q'[..]]
→ [g ⊢ P ⇛ Q']
→ Result [g ⊢ P] [g, x:name ⊢ Q] | inductive | Result | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"ctx",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
Result' : (g : ctx){P : [g ⊢ proc]}{Q : [g, x:name ⊢ proc]} → ctype | =
| Res' : {Q' : [g ⊢ proc]}
→ [g, x:name ⊢ eq_proc Q Q'[..]]
→ [g ⊢ P ≡ Q']
→ Result' [g ⊢ P] [g, x:name ⊢ Q] | inductive | Result' | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"ctx",
"proc",
"≡"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
str_step' : (g : ctx) [g, x:name, h:hyp x A[] ⊢ P[..,x] ⇛ Q[..,x]]
→ [g, x:name ⊢ P ⇛ Q] | =
/ total 1 /
fn sPP ⇒ case sPP of
| [g, x:name, h:hyp x A[] ⊢ βfwd] ⇒ [g, x:name ⊢ βfwd]
| [g, x:name, h:hyp x A[] ⊢ β1⊥] ⇒ [g, x:name ⊢ β1⊥]
| [g, x:name, h:hyp x A[] ⊢ β⊗⅋] ⇒ [g, x:name |- β⊗⅋]
| [g, x:name, h:hyp x A[] ⊢ β⊕&1] ⇒ [g, x:name |- β⊕&1]
| [g, x:name, h:hyp x A[] ⊢ β⊕&2] ⇒ [g, x:name |- β⊕&2]
| [g, x:nam... | rec | str_step' | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"ctx",
"hyp",
"str_equiv'"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
str_equiv' : (g : ctx) [g, x:name, h:hyp x A[] ⊢ P[..,x] ≡ Q[..,x]]
→ [g, x:name ⊢ P ≡ Q] | =
/ total 1 /
fn ePP ⇒ case ePP of
| [g, x:name, h:hyp x A[] ⊢ ≡comm D[]] ⇒ [g, x:name ⊢ ≡comm D[]]
| [g, x:name, h:hyp x A[] ⊢ ≡assoc] ⇒ [g, x:name ⊢ ≡assoc] | rec | str_equiv' | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"ctx",
"hyp",
"≡"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
str_step : (g : ctx) [g, x:name ⊢ P[..] ⇛ Q] → Result [g ⊢ P] [g, x:name ⊢ Q] | =
/ total 1 /
fn sPP' ⇒ case sPP' of
| [g, x:name ⊢ βfwd] ⇒ Res [g ⊢ _] [g, x:name ⊢ refl_proc] [g ⊢ βfwd]
| [g, x:name ⊢ β1⊥] ⇒ Res [g ⊢ _] [g, x:name ⊢ refl_proc] [g ⊢ β1⊥]
| [g, x:name ⊢ β⊗⅋] ⇒ Res [g ⊢ _] [g, x:name ⊢ refl_proc] [g ⊢ β⊗⅋]
| [g, x:name ⊢ β⊕&1] ⇒ Res [g ⊢ _] [g, x:name ⊢ refl_proc] [g ⊢ β⊕&1]
| [g, x... | rec | str_step | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"Result",
"ctx",
"hyp",
"str_equiv",
"str_step'"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
str_equiv : (g : ctx) [g, x:name ⊢ P[..] ≡ Q] → Result' [g ⊢ P] [g, x:name ⊢ Q] | =
/ total 1 /
fn ePP' ⇒ case ePP' of
| [g, x:name ⊢ ≡comm D[]] ⇒ Res' [g ⊢ _] [g, x:name ⊢ refl_proc] [g ⊢ ≡comm D[]]
| [g, x:name ⊢ ≡assoc] ⇒ Res' [g ⊢ _] [g, x:name ⊢ refl_proc] [g ⊢ ≡assoc] | rec | str_equiv | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"Result'",
"ctx",
"≡"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
str_hyp : (g:ctx) [g, z:name, hz:hyp z C[] ⊢ hyp X[..] A[]]
→ [g ⊢ hyp X A[]] | =
/ total (str_hyp h) /
fn h ⇒ let [g, z:name, hz: hyp z C[] ⊢ H[..]] = h in [g ⊢ H] | rec | str_hyp | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"ctx",
"hyp"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
str_lin : (g : nctx) [g, x:name ⊢ linear \y. P[.., y]]
→ [g ⊢ linear \y. P] | =
/ total 1 /
fn linP ⇒ case linP of
| [g, x:name ⊢ l_fwd] ⇒
[g ⊢ l_fwd]
| [g, x:name ⊢ l_fwd2] ⇒
[g ⊢ l_fwd2]
| [g, x:name ⊢ l_close] ⇒
[g ⊢ l_close]
| [g, x:name ⊢ l_wait] ⇒
[g ⊢ l_wait]
| [g, x:name ⊢ l_out linQ] ⇒
let [g ⊢ linQ'] = str_lin [g, x:name ⊢ linQ] in
[g ⊢ l_out linQ']
| [g, x:name ⊢ l_inp (\y... | rec | str_lin | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"nctx"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
str_wtp : (g : ctx) [g, z:name, h:hyp z C[] ⊢ wtp P[..]]
→ [g ⊢ wtp P] | =
/ total 1 /
fn tpP ⇒ case tpP of
| [g, z:name, hz:hyp z C[] ⊢ wtp_fwd D[] #bx.x[..] #bx.h[..] #bly.x[..] #bly.h[..]] ⇒
[g ⊢ wtp_fwd D[] #bx.x #bx.h #bly.x #bly.h]
| [g, z:name, hz:hyp z C[] ⊢ wtp_close #bx.x[..] #bx.h[..]] ⇒
[g ⊢ wtp_close #bx.x #bx.h]
| [g, z:name, hz:hyp z C[] ⊢ wtp_wait #bx.x[..] #bx.h[..] wtp... | rec | str_wtp | case-studies/classical-processes | case-studies/classical-processes/cp_lemmas.bel | [] | [
"ctx",
"hyp",
"str_hyp",
"str_lin"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
lin_s≡ : (g : ctx) [g, x:name ⊢ P[..,x] ≡ P'[..,x] ]
→ [g ⊢ linear (\x. P)]
→ [g ⊢ linear (\x. P')] | =
/ total 1 /
fn ePP' ⇒ fn lP ⇒ case ePP' of
| [g, x:name ⊢ ≡comm _] ⇒
(case lP of
| [g ⊢ l_pcomp1 (\y. linP')] ⇒ [g ⊢ l_pcomp2 (\y. linP')]
| [g ⊢ l_pcomp2 (\y. linP')] ⇒ [g ⊢ l_pcomp1 (\y. linP')]
)
| [g, x:name ⊢ ≡assoc] ⇒
(case lP of
| [g ⊢ l_pcomp1 (\y. l_pcomp1 (\x. linP[..,x,y]))] ⇒
let [g, x:nam... | rec | lin_s≡ | case-studies/classical-processes | case-studies/classical-processes/cp_thrm.bel | [] | [
"ctx",
"str_lin",
"≡"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
wtp_s≡ : (g : ctx) [g ⊢ wtp P ] → [g ⊢ P ≡ P' ] → [g ⊢ wtp P' ] | =
/ total 1 /
fn tpP ⇒ fn ePP' ⇒ case ePP' of
| [g ⊢ ≡comm D[]] ⇒
let [g ⊢ wtp_pcomp D'[] (\x.\h. wtp_P) (\x.\h. wtp_Q) linP linQ] = tpP in
let [ ⊢ refl] = dual_uniq [⊢ D] [⊢ D'] in
let [ ⊢ D''] = dual_sym [ ⊢ D] in
[g ⊢ wtp_pcomp D''[] (\x.\h. wtp_Q) (\x.\h. wtp_P) linQ linP]
| [g ⊢ ≡assoc] ⇒
let [g ⊢ wtp_p... | rec | wtp_s≡ | case-studies/classical-processes | case-studies/classical-processes/cp_thrm.bel | [] | [
"ctx",
"dual_sym",
"dual_uniq",
"hyp",
"lin_name_must_appear",
"refl",
"str_lin",
"str_wtp",
"≡"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
lin_s : (g : ctx) [g, x:name, h:hyp x A[] ⊢ wtp P[..,x] ]
→ [g, x:name ⊢ P[..,x] ⇛ P'[..,x] ]
→ [g ⊢ linear (\x. P)]
→ [g ⊢ linear (\x. P')] | =
/ total 2 /
fn tpP ⇒ fn sPP' ⇒ fn linP ⇒
case sPP' of
| [g, x:name ⊢ βfwd] ⇒
let [g, x:name, h:hyp x A[] ⊢
wtp_pcomp D[] (\x'.\h'. tpP')
(\x'.\h'.tpQ)
linP''[..,x] linQ[..,x]] = tpP in
(case linP of
| [g ⊢ l_pcomp1 (\x. l_fwd2)] ⇒
str_lin [g, x:name ⊢ linQ]
| [g ⊢ l... | rec | lin_s | case-studies/classical-processes | case-studies/classical-processes/cp_thrm.bel | [] | [
"ctx",
"hyp",
"lin_s≡",
"str_lin",
"str_step",
"wtp_s",
"wtp_s≡"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
wtp_s : (g : ctx) [g ⊢ wtp P ] → [g ⊢ P ⇛ P' ] → [g ⊢ wtp P' ] | =
/ total 2 /
fn tpP ⇒ fn sPP' ⇒ case sPP' of
| [g ⊢ βfwd] ⇒
let [g ⊢ wtp_pcomp D[] (\x. \h. wtp_P) (\x. \h. wtp_Q) linP linQ] = tpP in
let ([ ⊢ D] : [ ⊢ dual A A']) = [ ⊢ D] in
let [g, x:name,h:hyp x A[] ⊢ wtp_fwd D'[] x h #y.1[..] #y.2[..] ] = [_ ⊢ wtp_P] in
let ( [⊢ D'] : [ ⊢ dual A[] A'']) = [ ⊢ D'] in
le... | rec | wtp_s | case-studies/classical-processes | case-studies/classical-processes/cp_thrm.bel | [] | [
"ctx",
"dual_uniq",
"hyp",
"lin_name_must_appear",
"lin_s",
"refl",
"str_hyp",
"str_lin",
"str_wtp",
"wtp_s≡"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
names: type = | LF | names | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | ||
proc: type | =
| p_zero: proc % 0
| p_in: names → (names → proc) → proc % x(y).P(y), where x(y) is an input of the name y through channel x
| p_out: names → names → proc → proc % x(u).P, where x(u) is an output of the name u through channel x
| p_par: proc → proc → proc ... | LF | proc | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ctx | = names | schema | ctx | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
cong: proc → proc → type | =
% Abelian Monoid Laws for Parallel Composition
| par_assoc: cong (P p_par (Q p_par R)) ((P p_par Q) p_par R)
| par_unit: cong (P p_par p_zero) P
| par_comm: cong (P p_par Q) (Q p_par P)
% Scope Extension Laws
| sc_ext_zero: cong (p_res \x.p_zero) p_zero
| sc_ext_par: cong ((p_res P) p_par Q) (p_res \x.((P x... | LF | cong | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
red: proc → proc → type | =
| r_com: red ((p_out X Y P) p_par (p_in X Q)) (P p_par (Q Y))
| r_par: red P Q → red (P p_par R) (Q p_par R)
| r_res: ({x:names} red (P x) (Q x)) → red (p_res P) (p_res Q)
| r_str: P cong P' → red P' Q' → Q' cong Q → red P Q | LF | red | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"cong",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
f_act: type | =
| f_tau: f_act
| f_out: names → names → f_act | LF | f_act | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
b_act: type | =
| b_in: names → b_act
| b_out: names → b_act | LF | b_act | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fstep: proc → f_act → proc → type | =
| fs_out: fstep (p_out X Y P) (f_out X Y) P
| fs_par1: fstep P A P' → fstep (P p_par Q) A (P' p_par Q)
| fs_par2: fstep Q A Q' → fstep (P p_par Q) A (P p_par Q')
| fs_com1: fstep P (f_out X Y) P' → bstep Q (b_in X) Q'
→ fstep (P p_par Q) f_tau (P' p_par (Q' Y))
| fs_com2: bstep P (b_in X) P' → fstep Q (... | LF | fstep | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"bstep",
"f_act",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bstep: proc → b_act → (names → proc) → type | =
| bs_in: bstep (p_in X P) (b_in X) P
| bs_par1: bstep P A P' → bstep (P p_par Q) A \x.((P' x) p_par Q)
| bs_par2: bstep Q A Q' → bstep (P p_par Q) A \x.(P p_par (Q' x))
| bs_res: ({z:names} bstep (P z) A (P' z))
→ bstep (p_res P) A \x.(p_res \z.(P' z x))
| bs_open: ({z:names} fstep (P z) (f_out X z) (P'... | LF | bstep | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/1_definitions.bel | [] | [
"b_act",
"fstep",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_inp_rew: proc → names → (names → proc) → type | =
| inp_base: Q cong ((p_in X R) p_par S)
→ ({y:names} (Q' y) cong ((R y) p_par S)) → ex_inp_rew Q X Q'
| inp_ind: Q cong (p_res P) → ({y:names} (Q' y) cong (p_res (P' y)))
→ ({w:names} ex_inp_rew (P w) X \y.(P' y w)) → ex_inp_rew Q X Q' | LF | ex_inp_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/2_input_rewriting.bel | [] | [
"cong",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_in_rew_par1: (g:ctx) {R:[g ⊢ proc]} [g ⊢ ex_inp_rew Q X \y.Q'[..,y]]
→ [g ⊢ ex_inp_rew (Q p_par R) X \y.(Q'[..,y] p_par R[..])] | =
/ total d (bs_in_rew_par1 _ _ _ _ _ d) /
mlam R ⇒ fn d ⇒ case d of
| [g ⊢ inp_base C1 \y.C2[..,y]] ⇒ [g ⊢ inp_base (c_trans (c_par C1)
(c_sym par_assoc)) \y.(c_trans (c_par C2[..,y]) (c_sym par_assoc))]
| [g ⊢ inp_ind C1 (\y.C2[..,y]) (\w.D1[..,w])] ⇒
let [g,w:names ⊢ D2[..,w]] = bs_in_rew_par1 [g,w:n... | rec | bs_in_rew_par1 | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/2_input_rewriting.bel | [] | [
"ctx",
"ex_inp_rew",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_in_rew_par2: (g:ctx) {R:[g ⊢ proc]} [g ⊢ ex_inp_rew Q X \y.Q'[..,y]]
→ [g ⊢ ex_inp_rew (R p_par Q) X \y.(R[..] p_par Q'[..,y])] | =
/ total d (bs_in_rew_par2 _ _ _ _ _ d) /
mlam R ⇒ fn d ⇒ case d of
| [g ⊢ inp_base C1 \y.C2[..,y]] ⇒
[g ⊢ inp_base (c_trans par_comm (c_trans (c_par C1) (c_sym par_assoc)))
\y.(c_trans par_comm (c_trans (c_par C2[..,y]) (c_sym par_assoc)))]
| [g ⊢ inp_ind C1 (\y.C2[..,y]) (\w.D1[..,w])] ⇒
let [g,... | rec | bs_in_rew_par2 | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/2_input_rewriting.bel | [] | [
"ctx",
"ex_inp_rew",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_in_rew_res: (g:ctx) [g,z:names ⊢ ex_inp_rew Q[..,z] X[..] \y.Q'[..,z,y]]
→ [g ⊢ ex_inp_rew (p_res \z.Q[..,z]) X \y.(p_res \z.Q'[..,z,y])] | =
/ total d (bs_in_rew_res _ _ _ _ d) /
fn d ⇒ case d of
| [g,z:names ⊢ inp_base C1[..,z] \y.C2[..,z,y]] ⇒
[g ⊢ inp_ind (c_res \z.C1[..,z]) (\y.(c_res \z.C2[..,z,y]))
(\w.(inp_base c_ref \y.c_ref))]
| [g,z:names ⊢ inp_ind C1[..,z] (\y.C2[..,z,y]) (\w.D1[..,z,w])] ⇒
let [g,z:names ⊢ D2[..,z]] = bs_i... | rec | bs_in_rew_res | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/2_input_rewriting.bel | [] | [
"ctx",
"ex_inp_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_in_rew: (g:ctx) [g ⊢ bstep Q (b_in X) \y.Q'[..,y]]
→ [g ⊢ ex_inp_rew Q X \y.Q'[..,y]] | =
/ total b (bs_in_rew _ _ _ _ b) /
fn b ⇒ case b of
| [g ⊢ bs_in] ⇒ [g ⊢ inp_base (c_sym par_unit) \y.(c_sym par_unit)]
| [g ⊢ bs_par1 B1]:[g ⊢ bstep (P p_par R) (b_in X) \y.(P' p_par (R[..]))] ⇒
let [g ⊢ D1] = bs_in_rew [g ⊢ B1] in
let [g ⊢ D2] = bs_in_rew_par1 [g ⊢ R] [g ⊢ D1] in [g ⊢ D2]
| [g ⊢ b... | rec | bs_in_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/2_input_rewriting.bel | [] | [
"bs_in_rew_par1",
"bs_in_rew_par2",
"bs_in_rew_res",
"bstep",
"ctx",
"ex_inp_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_fout_rew: proc → names → names → proc → type | =
| fout_base: Q cong ((p_out X Y R) p_par S) → Q' cong (R p_par S)
→ ex_fout_rew Q X Y Q'
| fout_ind: Q cong (p_res P) → Q' cong (p_res P')
→ ({w:names} ex_fout_rew (P w) X Y (P' w)) → ex_fout_rew Q X Y Q' | LF | ex_fout_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/3_free_output_rewriting.bel | [] | [
"cong",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_out_rew_par1: (g:ctx) {R:[g ⊢ proc]} [g ⊢ ex_fout_rew Q X Y Q']
→ [g ⊢ ex_fout_rew (Q p_par R) X Y (Q' p_par R)] | =
/ total d (fs_out_rew_par1 _ _ _ _ _ _ d) /
mlam R ⇒ fn d ⇒ case d of
| [g ⊢ fout_base C1 C2] ⇒ [g ⊢ fout_base (c_trans (c_par C1)
(c_sym par_assoc)) (c_trans (c_par C2) (c_sym par_assoc))]
| [g ⊢ fout_ind C1 C2 \w.D1[..,w]] ⇒ let [g,w:names ⊢ D2[..,w]]
= fs_out_rew_par1 [g,w:names ⊢ R[..]] [g,w:names... | rec | fs_out_rew_par1 | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/3_free_output_rewriting.bel | [] | [
"ctx",
"ex_fout_rew",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_out_rew_par2: (g:ctx) {R:[g ⊢ proc]} [g ⊢ ex_fout_rew Q X Y Q']
→ [g ⊢ ex_fout_rew (R p_par Q) X Y (R p_par Q')] | =
/ total d (fs_out_rew_par2 _ _ _ _ _ _ d) /
mlam R ⇒ fn d ⇒ case d of
| [g ⊢ fout_base C1 C2] ⇒ [g ⊢ fout_base (c_trans par_comm (c_trans (c_par C1)
(c_sym par_assoc))) (c_trans par_comm (c_trans (c_par C2) (c_sym par_assoc)))]
| [g ⊢ fout_ind C1 C2 \w.D1[..,w]] ⇒ let [g,w:names ⊢ D2[..,w]]
= fs_out_r... | rec | fs_out_rew_par2 | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/3_free_output_rewriting.bel | [] | [
"ctx",
"ex_fout_rew",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_out_rew_res: (g:ctx) ([g,z:names ⊢ ex_fout_rew Q[..,z] X[..] Y[..] Q'[..,z]])
→ [g ⊢ ex_fout_rew (p_res \z.Q[..,z]) X Y (p_res \z.Q'[..,z])] | =
/ total d (fs_out_rew_res _ _ _ _ _ d) /
fn d ⇒ case d of
| [g,z:names ⊢ fout_base C1[..,z] C2[..,z]] ⇒ [g ⊢ fout_ind (c_res \z.C1[..,z])
(c_res \z.C2[..,z]) \z.(fout_base c_ref c_ref)]
| [g,z:names ⊢ fout_ind C1[..,z] C2[..,z] \w.D1[..,z,w]] ⇒ let [g,z:names ⊢ D2[..,z]]
= fs_out_rew_res [g,z:names,w:... | rec | fs_out_rew_res | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/3_free_output_rewriting.bel | [] | [
"ctx",
"ex_fout_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_out_rew: (g:ctx) [g ⊢ fstep Q (f_out X Y) Q']
→ [g ⊢ ex_fout_rew Q X Y Q'] | =
/ total f (fs_out_rew _ _ _ _ _ f) /
fn f ⇒ case f of
| [g ⊢ fs_out] ⇒ [g ⊢ fout_base (c_sym par_unit) (c_sym par_unit)]
| [g ⊢ fs_par1 B1]:[g ⊢ fstep (P p_par R) (f_out X Y) (P' p_par R)] ⇒
let [g ⊢ D1] = fs_out_rew [g ⊢ B1] in
let [g ⊢ D2] = fs_out_rew_par1 [g ⊢ R] [g ⊢ D1] in [g ⊢ D2]
| [g ⊢ fs_... | rec | fs_out_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/3_free_output_rewriting.bel | [] | [
"ctx",
"ex_fout_rew",
"fs_out_rew_par1",
"fs_out_rew_par2",
"fs_out_rew_res",
"fstep",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_bout_rew: proc → names → (names → proc) → type | =
| bout_base: Q cong (p_res \z.((p_out X z (R z)) p_par (S z)))
→ ({y:names} (Q' y) cong ((R y) p_par (S y))) → ex_bout_rew Q X Q'
| bout_ind: Q cong (p_res P) → ({y:names} (Q' y) cong (p_res (P' y)))
→ ({w:names} ex_bout_rew (P w) X \y.(P' y w)) → ex_bout_rew Q X Q' | LF | ex_bout_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/4_bound_output_rewriting.bel | [] | [
"cong",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_out_rew_par1: (g:ctx) {R:[g ⊢ proc]} [g ⊢ ex_bout_rew Q X \y.Q'[..,y]]
→ [g ⊢ ex_bout_rew (Q p_par R) X \y.(Q'[..,y] p_par R[..])] | =
/ total d (bs_out_rew_par1 _ _ _ _ _ d) /
mlam R ⇒ fn d ⇒ case d of
| [g ⊢ bout_base C1 \y.C2[..,y]] ⇒
[g ⊢ bout_base (c_trans (c_par C1) (c_trans sc_ext_par (c_res \z.(c_sym par_assoc))))
\y.(c_trans (c_par C2[..,y]) (c_sym par_assoc))]
| [g ⊢ bout_ind C1 (\y.C2[..,y]) (\w.D1[..,w])] ⇒ let [g,w:names... | rec | bs_out_rew_par1 | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/4_bound_output_rewriting.bel | [] | [
"ctx",
"ex_bout_rew",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_out_rew_par2: (g:ctx) {R:[g ⊢ proc]} [g ⊢ ex_bout_rew Q X \y.Q'[..,y]]
→ [g ⊢ ex_bout_rew (R p_par Q) X \y.(R[..] p_par Q'[..,y])] | =
/ total d (bs_out_rew_par2 _ _ _ _ _ d) /
mlam R ⇒ fn d ⇒ case d of
| [g ⊢ bout_base C1 \y.C2[..,y]] ⇒ [g ⊢ bout_base (c_trans par_comm
(c_trans (c_par C1) (c_trans sc_ext_par (c_res \z.(c_sym par_assoc)))))
\y.(c_trans par_comm (c_trans (c_par C2[..,y]) (c_sym par_assoc)))]
| [g ⊢ bout_ind C1 (\y.C2[... | rec | bs_out_rew_par2 | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/4_bound_output_rewriting.bel | [] | [
"ctx",
"ex_bout_rew",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_out_rew_res: (g:ctx) [g,z:names ⊢ ex_bout_rew Q[..,z] X[..] \y.Q'[..,z,y]]
→ [g ⊢ ex_bout_rew (p_res \z.Q[..,z]) X \y.(p_res \z.Q'[..,z,y])] | =
/ total d (bs_out_rew_res _ _ _ _ d) /
fn d ⇒ case d of
| [g,z:names ⊢ bout_base C1[..,z] \y.C2[..,z,y]] ⇒ [g ⊢ bout_ind (c_res \z.C1[..,z])
(\y.(c_res \z.C2[..,z,y])) (\z.(bout_base c_ref \y.c_ref))]
| [g,z:names ⊢ bout_ind C1[..,z] (\y.C2[..,z,y]) (\w.D1[..,z,w])] ⇒
let [g,z:names ⊢ D2[..,z]] = bs_o... | rec | bs_out_rew_res | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/4_bound_output_rewriting.bel | [] | [
"ctx",
"ex_bout_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_out_rew_open: (g:ctx) [g,z:names ⊢ ex_fout_rew Q[..,z] X[..] z Q'[..,z]]
→ [g ⊢ ex_bout_rew (p_res \z.Q[..,z]) X \z.Q'[..,z]] | =
/ total d (bs_out_rew_open _ _ _ _ d) /
fn d ⇒ case d of
| [g,z:names ⊢ fout_base C1[..,z] C2[..,z]] ⇒
[g ⊢ bout_base (c_res \z.C1[..,z]) \z.C2[..,z]]
| [g,z:names ⊢ fout_ind C1[..,z] C2[..,z] \w.D1[..,w,z]] ⇒
let [g,z:names ⊢ D2[..,z]] = bs_out_rew_open [g,z:names,w:names ⊢ D1[..,z,w]] in
[g ⊢... | rec | bs_out_rew_open | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/4_bound_output_rewriting.bel | [] | [
"ctx",
"ex_bout_rew",
"ex_fout_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
bs_out_rew: (g:ctx) [g ⊢ bstep Q (b_out X) \y.Q'[..,y]]
→ [g ⊢ ex_bout_rew Q X \y.Q'[..,y]] | =
/ total b (bs_out_rew _ _ _ _ b) /
fn b ⇒ case b of
| [g ⊢ bs_par1 B1]:[g ⊢ bstep (P p_par R) (b_out X) \y.(P' p_par R[..])] ⇒
let [g ⊢ D1] = bs_out_rew [g ⊢ B1] in
let [g ⊢ D2] = bs_out_rew_par1 [g ⊢ R] [g ⊢ D1] in [g ⊢ D2]
| [g ⊢ bs_par2 B2]:[g ⊢ bstep (R p_par P) (b_out X) \y.(R[..] p_par P')] ⇒
... | rec | bs_out_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/4_bound_output_rewriting.bel | [] | [
"bs_out_rew_open",
"bs_out_rew_par1",
"bs_out_rew_par2",
"bs_out_rew_res",
"bstep",
"ctx",
"ex_bout_rew",
"fs_out_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_com1_impl_red_base: (g:ctx) [g ⊢ P2 cong ((p_in X \x.R[..,x])
p_par S)] → [g,w:names ⊢ Q2[..,w] cong (R[..,w] p_par S[..])]
→ [g ⊢ ex_fout_rew P1 X Y Q1]
→ [g ⊢ (P1 p_par P2) red (Q1 p_par Q2[..,Y])] | =
/ total d1 (fs_com1_impl_red_base _ _ _ _ _ _ _ _ _ _ _ d1) /
fn c3 ⇒ fn c4 ⇒ fn d1 ⇒ case d1 of
| [g ⊢ fout_base C1 C2] ⇒
let [g ⊢ C3] = c3 in
let [g,w:names ⊢ C4[..,w]] = c4 in
[g ⊢ r_str (c_trans (c_par C1) (c_trans par_comm (c_trans (c_par C3)
par_comm))) (r_str par_assoc (r_par (r_str (c_t... | rec | fs_com1_impl_red_base | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"cong",
"ctx",
"ex_fout_rew",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_com1_impl_red: (g:ctx) [g ⊢ ex_fout_rew P1 X Y Q1]
→ [g ⊢ ex_inp_rew P2 X \x.Q2[..,x]]
→ [g ⊢ (P1 p_par P2) red (Q1 p_par Q2[..,Y])] | =
/ total d2 (fs_com1_impl_red _ _ _ _ _ _ _ _ d2) /
fn d1 ⇒ fn d2 ⇒ case d2 of
| [g ⊢ inp_base C3 \y.C4[..,y]] ⇒
let [g ⊢ R] = fs_com1_impl_red_base [g ⊢ C3]
[g,y:names ⊢ C4[..,y]] d1 in [g ⊢ R]
| [g ⊢ inp_ind C3 (\y.C4[..,y]) (\w.D2[..,w])] ⇒
let [g ⊢ D1] = d1 in
let [g,w:names ⊢ R1[..,w]] =... | rec | fs_com1_impl_red | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"ctx",
"ex_fout_rew",
"ex_inp_rew",
"fs_com1_impl_red_base",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_com2_impl_red_base: (g:ctx) [g ⊢ P1 cong ((p_in X \x.R[..,x]) p_par S)]
→ [g,w:names ⊢ Q1[..,w] cong (R[..,w] p_par S[..])]
→ [g ⊢ ex_fout_rew P2 X Y Q2] → [g ⊢ (P1 p_par P2) red (Q1[..,Y] p_par Q2)] | =
/ total d2 (fs_com2_impl_red_base _ _ _ _ _ _ _ _ _ _ _ d2) /
fn c1 ⇒ fn c2 ⇒ fn d2 ⇒ case d2 of
| [g ⊢ fout_base C3 C4] ⇒
let [g ⊢ C1] = c1 in
let [g,w:names ⊢ C2[..,w]] = c2 in
[g ⊢ r_str (c_trans (c_par C1) (c_trans par_comm (c_trans (c_par C3) par_comm)))
(r_str par_assoc (r_par (r_str (c_t... | rec | fs_com2_impl_red_base | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"cong",
"ctx",
"ex_fout_rew",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_com2_impl_red: (g:ctx) [g ⊢ ex_inp_rew P1 X \x.Q1[..,x]]
→ [g ⊢ ex_fout_rew P2 X Y Q2] → [g ⊢ (P1 p_par P2) red (Q1[..,Y] p_par Q2)] | =
/ total d1 (fs_com2_impl_red _ _ _ _ _ _ _ d1 _) /
fn d1 ⇒ fn d2 ⇒ case d1 of
| [g ⊢ inp_base C1 \y.C2[..,y]] ⇒
let [g ⊢ R] = fs_com2_impl_red_base [g ⊢ C1] [g,y:names ⊢ C2[..,y]] d2 in [g ⊢ R]
| [g ⊢ inp_ind C1 (\y.C2[..,y]) (\w.D1[..,w])] ⇒
let [g ⊢ D2] = d2 in
let [g,w:names ⊢ R1[..,w]] = fs_... | rec | fs_com2_impl_red | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"ctx",
"ex_fout_rew",
"ex_inp_rew",
"fs_com2_impl_red_base",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_close1_impl_red_base: (g:ctx) [g ⊢ P2 cong ((p_in X \x.R[..,x]) p_par S)]
→ [g,w:names ⊢ Q2[..,w] cong (R[..,w] p_par S[..])] → [g ⊢ ex_bout_rew P1 X \x.Q1[..,x]]
→ [g ⊢ (P1 p_par P2) red (p_res \x.(Q1[..,x] p_par Q2[..,x]))] | =
/ total d1 (fs_close1_impl_red_base _ _ _ _ _ _ _ _ _ _ d1) /
fn c3 ⇒ fn c4 ⇒ fn d1 ⇒ case d1 of
| [g ⊢ bout_base C1 \y.C2[..,y]] ⇒
let [g ⊢ C3] = c3 in
let [g,w:names ⊢ C4[..,w]] = c4 in
[g ⊢ r_str (c_trans (c_par C1) sc_ext_par) (r_res \z.(r_str (c_trans par_comm
(c_trans (c_par C3[..]) par_c... | rec | fs_close1_impl_red_base | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"cong",
"ctx",
"ex_bout_rew",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_close1_impl_red: (g:ctx) [g ⊢ ex_bout_rew P1 X \x.Q1[..,x]]
→ [g ⊢ ex_inp_rew P2 X \x.Q2[..,x]]
→ [g ⊢ (P1 p_par P2) red (p_res \x.(Q1[..,x] p_par Q2[..,x]))] | =
/ total d2 (fs_close1_impl_red _ _ _ _ _ _ _ d2) /
fn d1 ⇒ fn d2 ⇒ case d2 of
| [g ⊢ inp_base C3 \y.C4[..,y]] ⇒
let [g ⊢ R] = fs_close1_impl_red_base [g ⊢ C3] [g,y:names ⊢ C4[..,y]] d1 in [g ⊢ R]
| [g ⊢ inp_ind C3 (\y.C4[..,y]) (\w.D2[..,w])] ⇒
let [g ⊢ D1] = d1 in
let [g,w:names ⊢ R1[..,w]] = fs... | rec | fs_close1_impl_red | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"ctx",
"ex_bout_rew",
"ex_inp_rew",
"fs_close1_impl_red_base",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_close2_impl_red_base: (g:ctx) [g ⊢ P1 cong ((p_in X \x.R[..,x]) p_par S)]
→ [g,w:names ⊢ Q1[..,w] cong (R[..,w] p_par S[..])] → [g ⊢ ex_bout_rew P2 X \x.Q2[..,x]]
→ [g ⊢ (P1 p_par P2) red (p_res \x.(Q1[..,x] p_par Q2[..,x]))] | =
/ total d2 (fs_close2_impl_red_base _ _ _ _ _ _ _ _ _ _ d2) /
fn c1 ⇒ fn c2 ⇒ fn d2 ⇒ case d2 of
| [g ⊢ bout_base C3 \y.C4[..,y]] ⇒
let [g ⊢ C1] = c1 in
let [g,w:names ⊢ C2[..,w]] = c2 in
[g ⊢ r_str (c_trans par_comm (c_trans (c_par C3) (c_trans sc_ext_par (c_res \z.par_comm))))
(r_res \z.(r_st... | rec | fs_close2_impl_red_base | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"cong",
"ctx",
"ex_bout_rew",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fs_close2_impl_red: (g:ctx) [g ⊢ ex_inp_rew P1 X \x.Q1[..,x]]
→ [g ⊢ ex_bout_rew P2 X \x.Q2[..,x]]
→ [g ⊢ (P1 p_par P2) red (p_res \x.(Q1[..,x] p_par Q2[..,x]))] | =
/ total d1 (fs_close2_impl_red _ _ _ _ _ _ d1 _) /
fn d1 ⇒ fn d2 ⇒ case d1 of
| [g ⊢ inp_base C1 \y.C2[..,y]] ⇒
let [g ⊢ R] = fs_close2_impl_red_base [g ⊢ C1] [g,y:names ⊢ C2[..,y]] d2 in [g ⊢ R]
| [g ⊢ inp_ind C1 (\y.C2[..,y]) (\w.D1[..,w])] ⇒
let [g ⊢ D2] = d2 in
let [g,w:names ⊢ R1[..,w]] = fs... | rec | fs_close2_impl_red | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"ctx",
"ex_bout_rew",
"ex_inp_rew",
"fs_close2_impl_red_base",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
fstep_impl_red: (g:ctx) [g ⊢ fstep P f_tau Q] → [g ⊢ P red Q] | =
/ total f (fstep_impl_red _ _ _ f) /
fn f ⇒ case f of
| [g ⊢ fs_par1 F1] ⇒ let [g ⊢ R] = fstep_impl_red [g ⊢ F1] in
[g ⊢ r_par R]
| [g ⊢ fs_par2 F2] ⇒ let [g ⊢ R] = fstep_impl_red [g ⊢ F2] in
[g ⊢ r_str par_comm (r_par R) par_comm]
| [g ⊢ fs_com1 F1 B1] ⇒
... | rec | fstep_impl_red | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/5_theorem1.bel | [] | [
"bs_in_rew",
"bs_out_rew",
"ctx",
"fs_close1_impl_red",
"fs_close2_impl_red",
"fs_com1_impl_red",
"fs_com2_impl_red",
"fs_out_rew",
"fstep",
"names",
"red"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_fstepcong: proc → proc → f_act → proc → type | =
| fsc: fstep Q A Q' → P' cong Q' → ex_fstepcong P Q A P' | LF | ex_fstepcong | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"cong",
"f_act",
"fstep",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_bstepcong: proc → proc → b_act → (names → proc) → type | =
| bsc: bstep Q A Q' → ({x:names} (P' x) cong (Q' x))
→ ex_bstepcong P Q A P' | LF | ex_bstepcong | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"b_act",
"bstep",
"cong",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
eqp: proc → proc → type | =
| prefl: eqp P P | LF | eqp | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
eqf: f_act → f_act → type | =
| frefl: eqf A A | LF | eqf | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"f_act"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
eqb: b_act → b_act → type | =
| brefl: eqb A A | LF | eqb | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"b_act"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_str_fstep: (g:ctx) [g,x:names ⊢ fstep P[..] A Q] → ctype | =
| ex_fstep: {F:[g,x:names ⊢ fstep P[..] A Q]} [g ⊢ fstep P A' Q']
→ [g,x:names ⊢ eqf A A'[..]] → [g,x:names ⊢ eqp Q Q'[..]]
→ ex_str_fstep [g,x:names ⊢ F] | inductive | ex_str_fstep | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"ctx",
"eqf",
"eqp",
"fstep",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_str_bstep: (g:ctx) [g,x:names ⊢ bstep P[..] A \z.Q[..,x,z]]
→ ctype | =
| ex_bstep: {B:[g,x:names ⊢ bstep P[..] A \z.Q[..,x,z]]}
[g ⊢ bstep P A' \z.Q'[..,z]] → [g,x:names ⊢ eqb A A'[..]]
→ [g,x:names,z:names ⊢ eqp Q[..,x,z] Q'[..,z]]
→ ex_str_bstep [g,x:names ⊢ B] | inductive | ex_str_bstep | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"bstep",
"ctx",
"eqb",
"eqp",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
strengthen_fstep: (g:ctx) {F:[g,x:names ⊢ fstep P[..] A Q]}
→ ex_str_fstep [g,x:names ⊢ F] | =
/ total f (strengthen_fstep _ _ _ _ f) /
mlam F ⇒ case [_,x:names ⊢ F] of
| [g,x:names ⊢ fs_out] ⇒ ex_fstep [g,x:names ⊢ F] [g ⊢ fs_out]
[g,x:names ⊢ frefl] [g,x:names ⊢ prefl]
| [g,x:names ⊢ fs_par1 F1[..,x]] ⇒
let ex_fstep [g,x:names ⊢ F1[..,x]] [g ⊢ F1'] e1 e2
= strengthen_fstep [g,x:names ... | rec | strengthen_fstep | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"ctx",
"ex_str_fstep",
"fstep",
"names",
"strengthen_bstep"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
strengthen_bstep: (g:ctx) {B:[g,x:names ⊢ bstep P[..] A
\z.Q[..,x,z]]} → ex_str_bstep [g,x:names ⊢ B] | =
/ total b (strengthen_bstep _ _ _ _ b) /
mlam B ⇒ case [_,x:names ⊢ B] of
| [g,x:names ⊢ bs_in] ⇒ ex_bstep [g,x:names ⊢ B] [g ⊢ bs_in]
[g,x:names ⊢ brefl] [g,x:names,z:names ⊢ prefl]
| [g,x:names ⊢ bs_par1 B1[..,x]] ⇒
let ex_bstep [g,x:names ⊢ B1[..,x]] [g ⊢ B1'] e1 e2
= strengthen_bstep [g,x:... | rec | strengthen_bstep | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"bstep",
"ctx",
"ex_str_bstep",
"names",
"strengthen_fstep"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
cong_fstepleft_impl_fstepright: (g:ctx) [g ⊢ P cong Q]
→ [g ⊢ fstep P A P'] → [g ⊢ ex_fstepcong P Q A P'] | =
/ total c (cong_fstepleft_impl_fstepright _ _ _ _ _ c _)/
fn c ⇒ fn f ⇒ case c of
| [g ⊢ par_unit] ⇒ let [g ⊢ fs_par1 F1] = f in [g ⊢ fsc F1 par_unit]
| [g ⊢ par_comm] ⇒
(case f of
| [g ⊢ fs_par1 F1] ⇒ [g ⊢ fsc (fs_par2 F1) par_comm]
| [g ⊢ fs_par2 F2] ⇒ [g ⊢ fsc (fs_par1 F2) par_comm]
| ... | rec | cong_fstepleft_impl_fstepright | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"cong",
"cong_bstepleft_impl_bstepright",
"cong_fstepright_impl_fstepleft",
"ctx",
"ex_fstepcong",
"fstep",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
cong_fstepright_impl_fstepleft: (g:ctx) [g ⊢ P cong Q]
→ [g ⊢ fstep Q A Q'] → [g ⊢ ex_fstepcong Q P A Q'] | =
/ total c (cong_fstepright_impl_fstepleft _ _ _ _ _ c _)/
fn c ⇒ fn f ⇒ case c of
| [g ⊢ par_unit] ⇒
let [g ⊢ F] = f in [g ⊢ fsc (fs_par1 F) (c_sym par_unit)]
| [g ⊢ par_comm] ⇒
(case f of
| [g ⊢ fs_par1 F1] ⇒ [g ⊢ fsc (fs_par2 F1) par_comm]
| [g ⊢ fs_par2 F2] ⇒ [g ⊢ fsc (fs_par1 F2) par_com... | rec | cong_fstepright_impl_fstepleft | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"cong",
"cong_bstepright_impl_bstepleft",
"cong_fstepleft_impl_fstepright",
"ctx",
"ex_fstepcong",
"fstep",
"names",
"strengthen_bstep",
"strengthen_fstep"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
cong_bstepleft_impl_bstepright: (g:ctx) [g ⊢ P cong Q]
→ [g ⊢ bstep P A \x.P'[..,x]] → [g ⊢ ex_bstepcong P Q A \x.P'[..,x]] | =
/ total c (cong_bstepleft_impl_bstepright _ _ _ _ _ c _)/
fn c ⇒ fn b ⇒ case c of
| [g ⊢ par_unit] ⇒
let [g ⊢ bs_par1 B1] = b in [g ⊢ bsc B1 \x.par_unit]
| [g ⊢ par_comm] ⇒
(case b of
| [g ⊢ bs_par1 B1] ⇒ [g ⊢ bsc (bs_par2 B1) \x.par_comm]
| [g ⊢ bs_par2 B2] ⇒ [g ⊢ bsc (bs_par1 B2) \x.par_co... | rec | cong_bstepleft_impl_bstepright | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"bstep",
"cong",
"cong_bstepright_impl_bstepleft",
"cong_fstepleft_impl_fstepright",
"ctx",
"ex_bstepcong",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
cong_bstepright_impl_bstepleft: (g:ctx) [g ⊢ P cong Q]
→ [g ⊢ bstep Q A \x.Q'[..,x]] → [g ⊢ ex_bstepcong Q P A \x.Q'[..,x]] | =
/ total c (cong_bstepright_impl_bstepleft _ _ _ _ _ c _)/
fn c ⇒ fn b ⇒ case c of
| [g ⊢ par_unit] ⇒
let [g ⊢ B] = b in [g ⊢ bsc (bs_par1 B) \x.(c_sym par_unit)]
| [g ⊢ par_comm] ⇒
(case b of
| [g ⊢ bs_par1 B1] ⇒ [g ⊢ bsc (bs_par2 B1) \x.par_comm]
| [g ⊢ bs_par2 B2] ⇒ [g ⊢ bsc (bs_par1 B2) \... | rec | cong_bstepright_impl_bstepleft | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/6_stepcong_lemma.bel | [] | [
"bstep",
"cong",
"cong_bstepleft_impl_bstepright",
"cong_fstepright_impl_fstepleft",
"ctx",
"ex_bstepcong",
"names",
"strengthen_bstep",
"strengthen_fstep"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ex_red_rew: proc → proc → type | =
| red_base: P cong (((p_out X Y R1) p_par (p_in X R2)) p_par S)
→ Q cong ((R1 p_par (R2 Y)) p_par S) → ex_red_rew P Q
| red_ind: P cong (p_res P') → Q cong (p_res Q')
→ ({w:names} ex_red_rew (P' w) (Q' w)) → ex_red_rew P Q | LF | ex_red_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/7_reduction_rewriting.bel | [] | [
"cong",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
red_impl_red_rew_par: (g:ctx) {R:[g ⊢ proc]} [g ⊢ ex_red_rew P Q]
→ [g ⊢ ex_red_rew (P p_par R) (Q p_par R)] | =
/ total d (red_impl_red_rew_par _ _ _ _ d) /
mlam R ⇒ fn d ⇒ case d of
| [g ⊢ red_base C1 C2] ⇒
[g ⊢ red_base (c_trans (c_par C1) (c_sym par_assoc))
(c_trans (c_par C2) (c_sym par_assoc))]
| [g ⊢ red_ind C1 C2 \w.D1[..,w]] ⇒
let [g,w:names ⊢ D2[..,w]] = red_impl_red_rew_par
[g,w:names ⊢ R[..... | rec | red_impl_red_rew_par | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/7_reduction_rewriting.bel | [] | [
"ctx",
"ex_red_rew",
"names",
"proc"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
red_impl_red_rew_res: (g:ctx) [g,z:names ⊢ ex_red_rew P[..,z] Q[..,z]]
→ [g ⊢ ex_red_rew (p_res \z.P[..,z]) (p_res \z.Q[..,z])] | =
/ total d (red_impl_red_rew_res _ _ _ d) /
fn d ⇒ case d of
| [g,z:names ⊢ red_base C1[..,z] C2[..,z]] ⇒
[g ⊢ red_ind c_ref c_ref \z.(red_base C1[..,z] C2[..,z])]
| [g,z:names ⊢ red_ind C1[..,z] C2[..,z] \w.D1[..,z,w]] ⇒
let [g,z:names ⊢ D2[..,z]] = red_impl_red_rew_res [g,z:names,w:names ⊢ D1[..,z,w]... | rec | red_impl_red_rew_res | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/7_reduction_rewriting.bel | [] | [
"ctx",
"ex_red_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
red_impl_red_rew_str: (g:ctx) [g ⊢ P cong P'] → [g ⊢ ex_red_rew P' Q']
→ [g ⊢ Q' cong Q] → [g ⊢ ex_red_rew P Q] | =
/ total d (red_impl_red_rew_str _ _ _ _ _ _ d _) /
fn c1 ⇒ fn d ⇒ fn c2 ⇒ case d of
| [g ⊢ red_base C1' C2'] ⇒
let [g ⊢ C1] = c1 in
let [g ⊢ C2] = c2 in
[g ⊢ red_base (c_trans C1 C1') (c_trans (c_sym C2) C2')]
| [g ⊢ red_ind C1' C2' \w.D1[..,w]] ⇒
let [g ⊢ C1] = c1 in
let [g ⊢ C2] = c2 ... | rec | red_impl_red_rew_str | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/7_reduction_rewriting.bel | [] | [
"cong",
"ctx",
"ex_red_rew"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
red_impl_red_rew: (g:ctx) [g ⊢ P red Q] → [g ⊢ ex_red_rew P Q] | =
/ total r (red_impl_red_rew _ _ _ r) /
fn r ⇒ case r of
| [g ⊢ r_com] ⇒ [g ⊢ red_base (c_sym par_unit) (c_sym par_unit)]
| [g ⊢ r_par R1]:[g ⊢ (P p_par R) red (Q p_par R)] ⇒
let [g ⊢ D1] = red_impl_red_rew [g ⊢ R1] in
let [g ⊢ D2] = red_impl_red_rew_par [g ⊢ R] [g ⊢ D1] in [g ⊢ D2]
| [g ⊢ r_res \z.... | rec | red_impl_red_rew | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/7_reduction_rewriting.bel | [] | [
"ctx",
"ex_red_rew",
"names",
"red",
"red_impl_red_rew_par",
"red_impl_red_rew_res",
"red_impl_red_rew_str"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
red_rew_impl_fstepcong: (g:ctx) [g ⊢ ex_red_rew P Q]
→ [g ⊢ ex_fstepcong P P f_tau Q] | =
/ total d (red_rew_impl_fstepcong _ _ _ d) /
fn d ⇒ case d of
| [g ⊢ red_base C1 C2] ⇒
let [g ⊢ fsc F C3] = cong_fstepright_impl_fstepleft
[g ⊢ C1] [g ⊢ fs_par1 (fs_com1 fs_out bs_in)] in
[g ⊢ fsc F (c_trans C2 C3)]
| [g ⊢ red_ind C1 C2 \w.D1[..,w]] ⇒
let [g,w:names ⊢ fsc F1[..,w] C3[..,w]] ... | rec | red_rew_impl_fstepcong | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/8_theorem2.bel | [] | [
"cong_fstepright_impl_fstepleft",
"ctx",
"ex_fstepcong",
"ex_red_rew",
"names"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
red_impl_fstepcong: (g:ctx) [g ⊢ P red Q]
→ [g ⊢ ex_fstepcong P P f_tau Q] | =
/ total r (red_impl_fstepcong _ _ _ r) /
fn r ⇒ let [g ⊢ D1] = red_impl_red_rew r in
let [g ⊢ D2] = red_rew_impl_fstepcong [g ⊢ D1] in [g ⊢ D2] | rec | red_impl_fstepcong | case-studies/harmony-lemma-formalization | case-studies/harmony-lemma-formalization/8_theorem2.bel | [] | [
"ctx",
"ex_fstepcong",
"red",
"red_impl_red_rew",
"red_rew_impl_fstepcong"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
i : type = | LF | i | examples | examples/cut-elim-crec-cover.bel | [] | [] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | ||
o : type | = % formulas
| imp : o -> o -> o
| not : o -> o
| true : o
| forall : (i -> o) -> o | LF | o | examples | examples/cut-elim-crec-cover.bel | [] | [
"not",
"true"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
hyp : o -> type = | LF | hyp | examples | examples/cut-elim-crec-cover.bel | [] | [] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | ||
conc : o -> type | = % Conclusion (right)
| axiom : (hyp A -> conc A)
| truer : conc true
| impr : (hyp A -> conc B) -> conc (imp A B)
| impl : conc A -> (hyp B -> conc C) -> (hyp (imp A B) -> conc C)
| notr : ({p:o}hyp A -> conc p) -> conc (not A)
| notl : conc A -> (hyp (not A) -> conc C)
| forallr : ({a:... | LF | conc | examples | examples/cut-elim-crec-cover.bel | [] | [
"hyp",
"not",
"true"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ctx | = some [a: o] hyp a + i + o | schema | ctx | examples | examples/cut-elim-crec-cover.bel | [] | [
"hyp"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ass: o -> o -> type | =
| assume : {A:o}conc A -> (hyp A -> conc C) -> ass A C | LF | ass | examples | examples/cut-elim-crec-cover.bel | [] | [
"conc",
"hyp"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ca : (g:ctx) [g |- ass A C] -> [g |- conc C] | =
% / total e (ca _ _ _ e ) /
fn e => case e of
| [g |- assume A (axiom H) (\h.E)] => [g |- E[.., H]]
| [g |- assume A D (\h. axiom h)] => [g |- D]
| [g |- assume (imp A B) (impr \h.D) (\h. impl E1 (\h2.E2[.., h, h2]) h)] =>
let... | rec | ca | examples | examples/cut-elim-crec-cover.bel | [] | [
"ass",
"conc",
"ctx",
"hyp",
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
lemma: (g:ctx)[g, u:hyp true |- conc C[..]] -> [g |- conc C] | =
%/ total d (lemma _ _ d)/
fn d => case d of
| [g, h:hyp true |- truer] => [g |- truer]
| [g, h:hyp true |- axiom H[..]] => [g |- axiom H]
| [g, h:hyp true |- axiom h] => [g |- truer]
| [g, h:hyp true |- impr (\v. D[.., v, h])] =>
let [g, v:hyp _ |- E] = lemma [g, v:hyp _, h:hyp true |- D] in
[g |- impr (\v. E)... | rec | lemma | examples | examples/cut-elim-crec.bel | [] | [
"conc",
"ctx",
"hyp",
"true"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ca : (g:ctx){A:[g |- o]} [g |- conc A] -> [g, u: hyp A |- conc C[..]]
-> [g |- conc C] | =
% / total e (ca _ _ _ _ e) /
mlam A' => fn d => fn e => case e of
| [g, h:hyp B |- axiom H1[..]] => [g |- axiom H1]
| [g, h:hyp A |- axiom h] => d
|[g, h:hyp A |- impr (\h1. E2[.., h1, h])] =>
let [g |- D] = d in
let [g, h1: hyp B1 |- E2'] =
ca [g, h1: hyp _ |- A[..]]
[g, h1 |- D[..]]
... | rec | ca | examples | examples/cut-elim-crec.bel | [] | [
"conc",
"ctx",
"hyp",
"lemma",
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
o : type | = % formulas
| imp : o -> o -> o
| not : o -> o
% | true : o
| forall : (i -> o) -> o | LF | o | examples | examples/cut-elim.bel | [] | [
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
conc : o -> type | = % Conclusion (right)
| axiom : (hyp A -> conc A)
% | truer : conc true
| impr : (hyp A -> conc B) -> conc (imp A B)
| impl : conc A -> (hyp B -> conc C) -> (hyp (imp A B) -> conc C)
| notr : ({p:o}hyp A -> conc p) -> conc (not A)
| notl : conc A -> (hyp (not A) -> conc C)
| forallr : ({... | LF | conc | examples | examples/cut-elim.bel | [] | [
"hyp",
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ca : {g:ctx}{A:[g |- o]} [g |- conc A] -> [g, u: hyp A |- conc C[..]]
-> [g |- conc C] | =
% / total e (ca _ _ _ _ e) /
mlam g => mlam A' => fn d => fn e => case e of
| [g, h:hyp B |- axiom H1[..]] => [g |- axiom H1]
| [g, h:hyp A |- axiom h] => d
|[g, h:hyp A |- impr (\h1. E2)] =>
let [g |- D] = d in
let [g, h1: hyp B1 |- E2'] =
ca [g, h1: hyp _] [g, h1 |- A[..]]
[g, h1 |- D[..]... | rec | ca | examples | examples/cut-elim.bel | [] | [
"conc",
"ctx",
"hyp",
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
o : type | = % formulas
| imp : o -> o -> o
| all : (i -> o) -> o
| not : o -> o | LF | o | examples | examples/fol-handbook.bel | [] | [
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
nd : o -> type | = % Natural deduction
| impi : (nd A -> nd B) -> nd (imp A B)
| impe : nd (imp A B) -> nd A -> nd B
| noti : ({p:o} nd A -> nd p) -> nd (not A)
| note : nd (not A) -> {C:o} nd A -> nd C
| alli : ({a:i} nd (A a)) -> nd (all (\x. A x))
| alle : nd (all (\x.A x)) -> {T:i} nd (A T) | LF | nd | examples | examples/fol-handbook.bel | [] | [
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
hil : o -> type | = % Hilbert deductions
| k : hil (imp A (imp B A))
| s : hil (imp (imp A (imp B C)) (imp (imp A B) (imp A C)))
| n1 : hil (imp (imp A (not B)) (imp (imp A B) (not A)))
| n2 : hil (imp (not A) (imp A B))
| f1 : {T:i} hil (imp (all (\x.A x)) (A T))
| f2 : hil (imp (all (\x.(imp B (A x)))) (imp B (all (\x.... | LF | hil | examples | examples/fol-handbook.bel | [] | [
"f2",
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
hilCtx | = i + some [a:o] hil a | schema | hilCtx | examples | examples/fol-handbook.bel | [] | [
"hil"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
trivial_imp : {g:hilCtx}{A:[g |- o]}[g |- hil (imp A (imp A A))] | =
/ total a (trivial_imp g a) /
mlam g => mlam A => [g |- k] | rec | trivial_imp | examples | examples/fol-handbook.bel | [] | [
"hil",
"hilCtx"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ded: (g:hilCtx) [g, u:hil A |- hil B[..]]
-> [g |- hil (imp A B)] | =
/ total h (ded g _ _ h) /
fn h => case h of
| [g, u: hil _ |- #p[..]] => [g |- mp k #p] % SPECIAL!
% Can only be done by giving type annotation to k or s in
% the output; this is also done in the Twelf implementation
%
% ded_id : ded ([u:hil A] u) (mp (mp s k) (k : hil (A imp (A imp A)))).
% we define a little le... | rec | ded | examples | examples/fol-handbook.bel | [] | [
"f2",
"hil",
"hilCtx",
"trivial_imp"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ndhilCtx | = some [a:o] block _t:nd a, u:hil a + i + o | schema | ndhilCtx | examples | examples/fol-handbook.bel | [] | [
"hil",
"nd"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ndhil : (g:ndhilCtx) [g |- nd A] -> [g |- hil A] | =
/ total d (ndhil g a d) /
fn d => case d of
| [g |- #p.1] => [g |- #p.2]
| {B1:[g |- o]}{B2:[g |- o]}{D:[g, u: nd B1 |- nd B2[..]]}
[g |- impi \u. D] =>
let {H:[g, u:hil A1 |- hil A2]}
[g, b: block _t:nd A1, u: hil A1[..] |- H[.., b.2]] =
ndhil [g, b:block _t:nd B1, u:hil B1[..] |- D[.., b.1]]
in
... | rec | ndhil | examples | examples/fol-handbook.bel | [] | [
"ded",
"hil",
"nd",
"ndhilCtx",
"not"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ndhil_main : [ |- nd A] -> [ |- hil A] | =
/ total d (ndhil_main d) /
fn d => ndhil d | rec | ndhil_main | examples | examples/fol-handbook.bel | [] | [
"hil",
"nd",
"ndhil"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
ctx | = some [t:tp] block x : tm, u : oft x t | schema | ctx | examples | examples/stlc.bel | [] | [
"oft",
"tm",
"tp"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
tps : [⊢ oft M A] → [⊢ eval M M'] → [⊢ oft M' A] | =
intros
{ M : ( |- tm), A : ( |- tp), M' : ( |- tm)
| z6 : [ |- oft M A], y7 : [ |- eval M M']
; split y7 as
case e_app:
{ M1 : ( |- tm),
M3 : ( |- tm),
A : ( |- tp),
M' : ( |- tm),
M2 : (y6 : tm |- tm),
E : ( |- eval M1 (lam (\y1. M2))),
E1 : ( |- eval M2[M3] M')
| z6 : [ |- oft (app M1 ... | proof | tps | examples | examples/stlc.bel | [] | [
"eval",
"oft",
"split",
"tm",
"tp"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
tctx | = tp + some [t:tp] block x:exp, u:type_of x t, v:step x x , _t:notLam x | schema | tctx | examples | examples/subject-red-crec.bel | [] | [
"exp",
"notLam",
"step",
"tp",
"type_of"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
tps': (g:tctx)[g |- type_of M T] -> [g |- step M N]
-> [g |- type_of N T] | =
/ total s (tps' _ _ _ _ d s)/
fn d => fn s => case s of
| [g |- s_lam \x.\v. \n. S] =>
let [g |- tof_lam \x.\u. D] = d in
let [g, b: block x:exp, u:type_of x T, v:step x x, _t:notLam x |- F[.., b.1, b.2]] =
tps' [g, b:block x:exp, u:type_of x _ , v:step x x, _t:notLam x |- D[.., b.1, b.2]]
[g, b |- S[.... | rec | tps' | examples | examples/subject-red-crec.bel | [] | [
"exp",
"notLam",
"step",
"tctx",
"type_of"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
tps: (g:tctx)[g |- type_of M T] -> [g |- step M N]
-> [g |- type_of N T] | =
% / total d (tps _ _ _ _ d s)/
fn d => fn s => case d of
| [g |- tof_lam \x.\u. D] =>
let [g |- s_lam \x.\v. \n. S] = s in
let [g, b: block x:exp, u:type_of x T, v:step x x, _t:notLam x |- F[.., b.1, b.2]] =
tps [g, b:block x:exp, u:type_of x _ , v:step x x, _t:notLam x |- D[.., b.1, b.2]]
[g, b |- S[..... | rec | tps | examples | examples/subject-red-crec.bel | [] | [
"exp",
"notLam",
"step",
"tctx",
"type_of"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
tps': {g:tctx}[g |- type_of M T] -> [g |- step M N]
-> [g |- type_of N T] | =
/ total s (tps' _ _ _ _ d s)/
mlam g => fn d => fn s => case s of
| [g |- s_lam \x.\v. \n. S] =>
let [g |- tof_lam \x.\u. D] = d in
let % {F::(type_of M T)[g, x:exp, u:type_of x T]}
[g, b: block x:exp, u:type_of x T, v:step x x, _t:notLam x |- F[.., b.1, b.2]] =
tps' [g, b:block x:exp, u:type_of x _ ,... | rec | tps' | examples | examples/subject-red.bel | [] | [
"exp",
"notLam",
"step",
"tctx",
"type_of"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 | |
tps: {g:tctx}[g |- type_of M T] -> [g |- step M N]
-> [g |- type_of N T] | =
% / total d (tps _ _ _ _ d s)/
mlam g => fn d => fn s => case d of
| [g |- tof_lam \x.\u. D] =>
let [g |- s_lam \x.\v. \n. S] = s in
let % {F::(type_of M T)[g, x:exp, u:type_of x T]}
[g, b: block x:exp, u:type_of x T, v:step x x, _t:notLam x |- F[.., b.1, b.2]] =
tps [g, b:block x:exp, u:type_of x _ ,... | rec | tps | examples | examples/subject-red.bel | [] | [
"exp",
"notLam",
"step",
"tctx",
"type_of"
] | https://github.com/Beluga-lang/Beluga | 820615cc4758086eb7641f62340a3ab93a689303 |
Declarations from Beluga.
820615cc4758086eb7641f62340a3ab93a689303| Column | Type | Description |
|---|---|---|
| statement | string | Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof |
| proof | string | Verbatim proof/body, empty if the declaration has none |
| type | string | Declaration keyword |
| symbolic_name | string | Declaration identifier |
| library | string | Sub-library |
| filename | string | Repository-relative source path |
| imports | list[string] | File-level Require/Import modules |
| deps | list[string] | Intra-corpus identifiers referenced |
| docstring | string | Preceding documentation comment, empty if absent |
| source_url | string | Upstream repository |
| commit | string | Upstream commit extracted |
| Type | Count |
|---|---|
| rec | 1,589 |
| LF | 471 |
| inductive | 318 |
| schema | 179 |
| proof | 51 |
| coinductive | 11 |
| typedef | 4 |
Result : (g : ctx){P : [g ⊢ proc]}{Q : [g, x:name ⊢ proc]} → ctype
=
| Res : {Q' : [g ⊢ proc]}
→ [g, x:name ⊢ eq_proc Q Q'[..]]
→ [g ⊢ P ⇛ Q']
→ Result [g ⊢ P] [g, x:name ⊢ Q]
Result | case-studies/classical-processes/cp_lemmas.belEach declaration is split into a statement (signature/claim) and a proof (body) that are disjoint
and together form the complete declaration, for proof modeling, autoformalization, retrieval, and
dependency analysis via deps.
@misc{beluga_dataset,
title = {Beluga},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/Beluga-lang/Beluga, commit 820615cc4758},
url = {https://huggingface.co/datasets/phanerozoic/Beluga}
}