Revise the par reduction relation

This commit is contained in:
Yiyun Liu 2024-12-20 16:26:32 -05:00
parent 67bcc69de7
commit a9de3013c9

View file

@ -133,12 +133,10 @@ End RPar.
Module EPar. Module EPar.
Inductive R {n} : Tm n -> Tm n -> Prop := Inductive R {n} : Tm n -> Tm n -> Prop :=
(****************** Eta ***********************) (****************** Eta ***********************)
| AppEta a0 a1 : | AppEta a :
R a0 a1 -> R a (Abs (App (ren_Tm shift a) (VarTm var_zero)))
R a0 (Abs (App (ren_Tm shift a1) (VarTm var_zero))) | PairEta a :
| PairEta a0 a1 : R a (Pair (Proj1 a) (Proj2 a))
R a0 a1 ->
R a0 (Pair (Proj1 a1) (Proj2 a1))
(*************** Congruence ********************) (*************** Congruence ********************)
| Var i : R (VarTm i) (VarTm i) | Var i : R (VarTm i) (VarTm i)
@ -165,20 +163,29 @@ Module EPar.
induction a; hauto lq:on ctrs:EPar.R. induction a; hauto lq:on ctrs:EPar.R.
Qed. Qed.
Lemma AppEta' n (a b : Tm n) :
b = (Abs (App (ren_Tm shift a) (VarTm var_zero))) ->
R a b.
Proof. move => ->. by apply AppEta. Qed.
Lemma renaming n m (a b : Tm n) (ξ : fin n -> fin m) : Lemma renaming n m (a b : Tm n) (ξ : fin n -> fin m) :
R a b -> R (ren_Tm ξ a) (ren_Tm ξ b). R a b -> R (ren_Tm ξ a) (ren_Tm ξ b).
Proof. Proof.
move => h. move : m ξ. move => h. move : m ξ.
elim : n a b /h. elim : n a b /h.
move => n a m ξ /=.
move => n a0 a1 ha iha m ξ /=. apply AppEta'. by asimpl.
move /(_ _ ξ) /AppEta : iha.
by asimpl.
all : qauto ctrs:R. all : qauto ctrs:R.
Qed. Qed.
Derive Dependent Inversion inv with (forall n (a b : Tm n), R a b) Sort Prop. Derive Dependent Inversion inv with (forall n (a b : Tm n), R a b) Sort Prop.
Lemma morph n m (a : Tm n) (ρ0 ρ1 : fin n -> Tm m) :
(forall i, R (ρ0 i) (ρ1 i)) ->
R (subst_Tm ρ0 a) (subst_Tm ρ1 a).
Proof.
move : m ρ0 ρ1.
End EPar. End EPar.