Finish ST Conv

This commit is contained in:
Yiyun Liu 2025-02-06 00:08:02 -05:00
parent 64bcf8e9c1
commit c24cc7c9b0
2 changed files with 61 additions and 0 deletions

View file

@ -107,6 +107,10 @@ Module EPar.
all : hauto lq:on ctrs:R use:morphing_up. all : hauto lq:on ctrs:R use:morphing_up.
Qed. Qed.
Lemma substing n m (a b : PTm n) (ρ : fin n -> PTm m) :
R a b -> R (subst_PTm ρ a) (subst_PTm ρ b).
Proof. hauto l:on use:morphing, refl. Qed.
End EPar. End EPar.
Inductive SNe {n} : PTm n -> Prop := Inductive SNe {n} : PTm n -> Prop :=
@ -572,6 +576,15 @@ Module RRed.
RRed.R a b. RRed.R a b.
Proof. induction 1; hauto lq:on ctrs:RRed.R. Qed. Proof. induction 1; hauto lq:on ctrs:RRed.R. Qed.
Lemma substing n m (a b : PTm n) (ρ : fin n -> PTm m) :
R a b -> R (subst_PTm ρ a) (subst_PTm ρ b).
Proof.
move => h. move : m ρ. elim : n a b / h => n.
move => a b m ρ /=.
eapply AppAbs'; eauto; cycle 1. by asimpl.
all : hauto lq:on ctrs:R.
Qed.
End RRed. End RRed.
Module RPar. Module RPar.
@ -1482,6 +1495,15 @@ Module ERed.
sauto lq:on. sauto lq:on.
Admitted. Admitted.
Lemma substing n m (a b : PTm n) (ρ : fin n -> PTm m) :
R a b -> R (subst_PTm ρ a) (subst_PTm ρ b).
Proof.
move => h. move : m ρ. elim : n a b /h => n.
move => a m ρ /=.
eapply AppEta'; eauto. by asimpl.
all : hauto lq:on ctrs:R.
Qed.
End ERed. End ERed.
Module EReds. Module EReds.
@ -1546,6 +1568,12 @@ Module EReds.
rtc ERed.R a b. rtc ERed.R a b.
Proof. induction 1; hauto l:on use:FromEPar, @relations.rtc_transitive. Qed. Proof. induction 1; hauto l:on use:FromEPar, @relations.rtc_transitive. Qed.
Lemma substing n m (a b : PTm n) (ρ : fin n -> PTm m) :
rtc ERed.R a b -> rtc ERed.R (subst_PTm ρ a) (subst_PTm ρ b).
Proof.
induction 1; hauto lq:on ctrs:rtc use:ERed.substing.
Qed.
End EReds. End EReds.
#[export]Hint Constructors ERed.R RRed.R EPar.R : red. #[export]Hint Constructors ERed.R RRed.R EPar.R : red.
@ -1632,6 +1660,12 @@ Module RERed.
hauto q:on use:ToBetaEtaPar, RPar.FromRRed use:red_sn_preservation, epar_sn_preservation. hauto q:on use:ToBetaEtaPar, RPar.FromRRed use:red_sn_preservation, epar_sn_preservation.
Qed. Qed.
Lemma substing n m (a b : PTm n) (ρ : fin n -> PTm m) :
RERed.R a b -> RERed.R (subst_PTm ρ a) (subst_PTm ρ b).
Proof.
hauto q:on use:ToBetaEta, FromBeta, FromEta, RRed.substing, ERed.substing.
Qed.
End RERed. End RERed.
Module REReds. Module REReds.
@ -1716,6 +1750,12 @@ Module REReds.
hauto lq:on rew:off ctrs:rtc inv:RERed.R. hauto lq:on rew:off ctrs:rtc inv:RERed.R.
Qed. Qed.
Lemma substing n m (a b : PTm n) (ρ : fin n -> PTm m) :
rtc RERed.R a b -> rtc RERed.R (subst_PTm ρ a) (subst_PTm ρ b).
Proof.
induction 1; hauto lq:on ctrs:rtc use:RERed.substing.
Qed.
End REReds. End REReds.
Module LoRed. Module LoRed.
@ -2207,4 +2247,10 @@ Module DJoin.
hauto lq:on ctrs:rtc use:REReds.FromRReds unfold:R. hauto lq:on ctrs:rtc use:REReds.FromRReds unfold:R.
Qed. Qed.
Lemma substing n m (a b : PTm n) (ρ : fin n -> PTm m) :
R a b -> R (subst_PTm ρ a) (subst_PTm ρ b).
Proof.
hauto lq:on rew:off ctrs:rtc unfold:R use:REReds.substing.
Qed.
End DJoin. End DJoin.

View file

@ -735,3 +735,18 @@ Proof.
hauto lq:on ctrs:rtc unfold:BJoin.R. hauto lq:on ctrs:rtc unfold:BJoin.R.
+ hauto lq:on use:@relations.rtc_r, InterpUniv_back_closs. + hauto lq:on use:@relations.rtc_r, InterpUniv_back_closs.
Qed. Qed.
Lemma ST_Conv n Γ (a : PTm n) A B i :
Γ a A ->
Γ B PUniv i ->
DJoin.R A B ->
Γ a B.
Proof.
move => ha /SemWt_Univ h h0.
move => ρ hρ.
have {}h0 : DJoin.R (subst_PTm ρ A) (subst_PTm ρ B) by eauto using DJoin.substing.
move /ha : (hρ){ha} => [m [PA [h1 h2]]].
move /h : (hρ){h} => [S hS].
have ? : PA = S by eauto using InterpUniv_Join'. subst.
eauto.
Qed.