@@ -9,7 +9,7 @@ public import Cslib.Languages.LambdaCalculus.Unscoped.Untyped.DeBruijnSyntax
99public import Cslib.Foundations.Data.Relation
1010
1111/-!
12- # One-step β-reduction and its reflexive-transitive closure
12+ # One-step β-reduction and its reflexive-transitive closure (Star)
1313
1414This file defines the usual compatible one-step β-reduction on de Bruijn lambda terms.
1515It also introduces its reflexive-transitive closure and proves basic closure lemmas for
@@ -18,25 +18,20 @@ application and abstraction.
1818## Main definitions
1919
2020* `Lambda.Beta`: one-step β-reduction.
21- * `Lambda.BetaStar`: the reflexive-transitive closure of `Beta`.
2221
2322 ## Main lemmas
2423
2524Inside `namespace BetaStar` we provide the standard constructors and congruence lemmas:
2625
27- * `BetaStar.refl`
28- * `BetaStar.head`
29- * `BetaStar.tail`
30- * `BetaStar.trans`
31- * `BetaStar.appL`, `BetaStar.appR`, `BetaStar.app`
32- * `BetaStar.abs`
26+ * `BetaStar.appL`, `BetaStar.appR`, `BetaStar.app`, `BetaStar.abs`
3327
3428 These lemmas are used later to compare β-reduction with parallel reduction.
3529-/
3630
3731
3832namespace Lambda
3933open Term
34+ open Relation.ReflTransGen
4035
4136/-- One-step β-reduction (compatible closure). -/
4237@ [reduction_sys "β" ]
@@ -45,51 +40,33 @@ public inductive Beta : Term → Term → Prop
4540 | appL {t t' u} : Beta t t' → Beta (t·u) (t'·u)
4641 | appR {t u u'} : Beta u u' → Beta (t·u) (t·u')
4742 | red (t' s : Term) : Beta ((λ.t')·s) (t'.sub 0 s)
48- public abbrev BetaStar := Relation.ReflTransGen Beta
4943
5044namespace BetaStar
5145
52- public theorem refl (t : Term) : BetaStar t t :=
53- Relation.ReflTransGen.refl
54-
55- public theorem head {a b c} (hab : Beta a b) (hbc : BetaStar b c) :
56- BetaStar a c :=
57- Relation.ReflTransGen.head hab hbc
58-
59- public theorem tail {a b c} (hab : BetaStar a b) (hbc : Beta b c) :
60- BetaStar a c :=
61- Relation.ReflTransGen.tail hab hbc
62-
63- public theorem trans {a b c}
64- (hab : BetaStar a b) (hbc : BetaStar b c) :
65- BetaStar a c :=
66- Relation.ReflTransGen.trans hab hbc
67-
68- public theorem appL {t t' u : Term} (h : BetaStar t t') :
69- BetaStar (t·u) (t'·u) := by
46+ public theorem appL {t t' u : Term} (h : t ↠β t') :
47+ (t·u) ↠β (t'·u) := by
7048 induction h with
71- | refl => exact BetaStar. refl (t·u)
72- | tail hab hbc ih => exact BetaStar. tail ih (Beta.appL hbc)
49+ | refl => exact refl (t·u)
50+ | tail hab hbc ih => exact tail ih (Beta.appL hbc)
7351
74- public theorem appR {t u u' : Term} (h : BetaStar u u') :
75- BetaStar (t·u) (t·u') := by
52+ public theorem appR {t u u' : Term} (h : u ↠β u') :
53+ (t·u) ↠β (t·u') := by
7654 induction h with
77- | refl => exact BetaStar. refl (t·u)
78- | tail hab hbc ih => exact BetaStar. tail ih (Beta.appR hbc)
55+ | refl => exact refl (t·u)
56+ | tail hab hbc ih => exact tail ih (Beta.appR hbc)
7957
8058public theorem app {t t' u u'}
81- (ht : BetaStar t t')
82- (hu : BetaStar u u') :
83- BetaStar (t·u) (t'·u') := by
59+ (ht : t ↠β t') (hu : u ↠β u') :
60+ (t·u) ↠β (t'·u') := by
8461 induction ht with
85- | refl => exact BetaStar. appR hu
86- | tail hab hbc ih => exact BetaStar. tail ih (Beta.appL hbc)
62+ | refl => exact appR hu
63+ | tail hab hbc ih => exact tail ih (Beta.appL hbc)
8764
88- public theorem abs {t t' : Term} (h : BetaStar t t') :
89- BetaStar (λ.t) (λ.t') := by
65+ public theorem abs {t t' : Term} (h : t ↠β t') :
66+ (λ.t) ↠β (λ.t') := by
9067 induction h with
91- | refl => exact BetaStar. refl (λ.t)
92- | tail hab hbc ih => exact BetaStar. tail ih (Beta.abs hbc)
68+ | refl => exact refl (λ.t)
69+ | tail hab hbc ih => exact tail ih (Beta.abs hbc)
9370
9471end BetaStar
9572end Lambda
0 commit comments