File tree Expand file tree Collapse file tree
Languages/LambdaCalculus/Unscoped/Untyped Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,22 @@ theorem ReflTransGen.to_eqvGen (h : ReflTransGen r a b) : EqvGen r a b := by
5151theorem SymmGen.to_eqvGen (h : SymmGen r a b) : EqvGen r a b := by
5252 induction h <;> grind
5353
54+ /-- Sandwich: if `r ⊆ p ⊆ r*` then `r* = p*`. -/
55+ theorem ReflTransGen.sandwich_to_eq {α} {r p : α → α → Prop }
56+ (h₁ : ∀ {a b}, r a b → p a b)
57+ (h₂ : ∀ {a b}, p a b → ReflTransGen r a b) :
58+ ∀ {a b}, ReflTransGen r a b ↔ ReflTransGen p a b := by
59+ intro a b
60+ constructor
61+ · intro hr
62+ induction hr with
63+ | refl => exact ReflTransGen.refl
64+ | tail hab hbc ih => exact ReflTransGen.tail ih (h₁ hbc)
65+ · intro hp
66+ induction hp with
67+ | refl => exact ReflTransGen.refl
68+ | tail hab hbc ih => exact ReflTransGen.trans ih (h₂ hbc)
69+
5470attribute [scoped grind →] ReflGen.to_eqvGen TransGen.to_eqvGen ReflTransGen.to_eqvGen
5571 SymmGen.to_eqvGen
5672
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ Authors: Zayn Wang
55-/
66module
77
8- public import Cslib.Languages.LambdaCalculus.Unscoped.Untyped.ConfluentReduction
8+ public import Cslib.Foundations.Data.Relation
99public import Cslib.Languages.LambdaCalculus.Unscoped.Untyped.ParallelReduction
1010
1111/-!
@@ -31,7 +31,7 @@ the complete-development machinery from `ParallelReduction`.
3131-/
3232
3333namespace Lambda
34- open Term
34+ open Relation
3535
3636/-- Parallel Reduction is Diamond. -/
3737private lemma diamond_par : Diamond Par := by
@@ -42,10 +42,10 @@ private lemma diamond_par : Diamond Par := by
4242public theorem churchRosser_beta : Confluent Beta := by
4343 -- Confluence of Par from diamond
4444 have hPar : Confluent Par :=
45- confluent_of_diamond (r := Par) diamond_par
45+ Diamond.toConfluent (r := Par) diamond_par
4646 -- Identify BetaStar and ParStar via sandwich
4747 have hEq {a b : Term} : BetaStar a b ↔ ParStar a b :=
48- rtc_eq_of_sandwich (r := Beta) (p := Par)
48+ ReflTransGen.sandwich_to_eq (r := Beta) (p := Par)
4949 (by intro a b h; exact beta_subset_par h)
5050 (by intro a b h; exact par_subset_betaStar h)
5151 -- Transport confluence
You can’t perform that action at this time.
0 commit comments