Skip to content

Commit

Permalink
remove unnecessary reducible conversion in reducibility of list terms
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoDralliam committed Jul 14, 2023
1 parent d2ed98d commit b7efd26
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 130 deletions.
2 changes: 1 addition & 1 deletion coq-partialfun
12 changes: 6 additions & 6 deletions theories/LogicalRelation.v
Original file line number Diff line number Diff line change
Expand Up @@ -910,11 +910,11 @@ Section ListRedTm.
with ListProp : term -> Type :=
| nilR {P} (wfΓ : [|- Γ]) :
[Γ |- P] ->
[parRedΓ wfΓ | Γ ||- _ ≅ P] ->
[Γ |- par ≅ P] ->
ListProp (tNil P)
| consR {P hd tl} (wfΓ : [|- Γ]):
[Γ |- P] ->
[parRedΓ wfΓ | Γ ||- _ ≅ P] ->
[Γ |- par ≅ P] ->
[parRedΓ wfΓ | Γ ||- hd : _] ->
ListRedTm tl ->
ListProp (tCons P hd tl)
Expand Down Expand Up @@ -1025,15 +1025,15 @@ Section ListRedTmEq.
(* KM: plugging in the parameter type directly... Is that ok ? *)
| nilReq {P P'} (wfΓ : [|- Γ]) :
[Γ |- P] ->
[parRedΓ wfΓ | Γ ||- _ ≅ P] ->
[Γ |- par ≅ P] ->
[Γ |- P'] ->
[parRedΓ wfΓ | Γ ||- _ ≅ P'] ->
[Γ |- par ≅ P'] ->
ListPropEq (tNil P) (tNil P')
| consReq {P P' hd hd' tl tl'} (wfΓ : [|- Γ]) :
[Γ |- P] ->
[parRedΓ wfΓ | Γ ||- _ ≅ P] ->
[Γ |- par ≅ P] ->
[Γ |- P'] ->
[parRedΓ wfΓ | Γ ||- _ ≅ P'] ->
[Γ |- par ≅ P'] ->
[parRedΓ wfΓ | Γ ||- hd ≅ hd' : _] ->
ListRedTmEq tl tl' ->
ListPropEq (tCons P hd tl) (tCons P' hd' tl')
Expand Down
9 changes: 5 additions & 4 deletions theories/LogicalRelation/Irrelevance.v
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ Proof.
eapply ListRedInduction; intros; econstructor; tea.
- now eapply redtmwf_conv.
- now eapply convtm_conv.
- now eapply eqvPar.
- now eapply eqvPar.
- etransitivity ; tea; now symmetry.
- etransitivity ; tea; now symmetry.
- now eapply eqvPar.
- now eapply ty_conv.
- now eapply convneulist_conv.
Expand All @@ -313,9 +313,10 @@ Proof.
all: cbn in * ; tea.
now eapply convtm_conv.
- econstructor ; tea.
all: now eapply eqvPar.
all: etransitivity ; tea; now symmetry.
- econstructor ; tea.
all: now eapply eqvPar.
3: now eapply eqvPar.
all: etransitivity ; tea; now symmetry.
- econstructor.
2,3: now eapply ListRedTm_map_inv_irrelevance.
2: now eapply ListRedTm_map_inv_eq_irrelevance.
Expand Down
4 changes: 2 additions & 2 deletions theories/LogicalRelation/Transitivity.v
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ Proof.
+ etransitivity ; tea. etransitivity ; tea.
rewrite eqR. eapply lrefl ; tea.
+ eapply h. rewrite eqR. eassumption.
- intros * ????? uv.
- intros * ?????? uv.
inversion uv ; subst.
2:{ apply convneulist_whne_list in conv. inv_whne. }
econstructor; tea; irrelevance.
- intros * ????? ? h ? uv.
inversion uv ; subst.
2:{ apply convneulist_whne_list in conv. inv_whne. }
econstructor ; try easy. 1: irrelevance.
econstructor ; try easy.
eapply ih; tea; irrelevance.
- intros * ????? uv.
assert (whne_list l').
Expand Down
42 changes: 6 additions & 36 deletions theories/LogicalRelation/Weakening.v
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,10 @@ Section Weakenings.
+ assumption.
- intros. unshelve econstructor; tea.
+ now eapply wft_wk.
+ irrelevance0.
1: now rewrite wk_id_ren_on.
unshelve eapply wkEq; tea.
2: irrelevance.
pose proof (h := ListRedTy.parRed LA wk_id wfΓ);
now rewrite wk_id_ren_on in h.
+ cbn; now eapply convty_wk.
- intros. unshelve econstructor; tea.
+ now eapply wft_wk.
+ irrelevance0.
1: now rewrite wk_id_ren_on.
unshelve eapply wkEq; tea.
2: irrelevance.
pose proof (h := ListRedTy.parRed LA wk_id wfΓ);
now rewrite wk_id_ren_on in h.
+ cbn; now eapply convty_wk.
+ fold ren_term.
irrelevance0.
2: now apply ih.
Expand Down Expand Up @@ -393,34 +383,14 @@ Section Weakenings.
assumption.
- intros. unshelve econstructor; tea.
+ now eapply wft_wk.
+ irrelevance0.
1: now rewrite wk_id_ren_on.
unshelve eapply wkEq; tea.
2: irrelevance.
pose proof (h := ListRedTy.parRed LA wk_id wfΓ);
now rewrite wk_id_ren_on in h.
+ cbn; now eapply convty_wk.
+ now eapply wft_wk.
+ irrelevance0.
1: now rewrite wk_id_ren_on.
unshelve eapply wkEq; tea.
2: irrelevance.
pose proof (h := ListRedTy.parRed LA wk_id wfΓ);
now rewrite wk_id_ren_on in h.
+ cbn; now eapply convty_wk.
- intros. unshelve econstructor; tea.
+ now eapply wft_wk.
+ irrelevance0.
1: now rewrite wk_id_ren_on.
unshelve eapply wkEq; tea.
2: irrelevance.
pose proof (h := ListRedTy.parRed LA wk_id wfΓ);
now rewrite wk_id_ren_on in h.
+ cbn; now eapply convty_wk.
+ now eapply wft_wk.
+ irrelevance0.
1: now rewrite wk_id_ren_on.
unshelve eapply wkEq; tea.
2: irrelevance.
pose proof (h := ListRedTy.parRed LA wk_id wfΓ);
now rewrite wk_id_ren_on in h.
+ cbn; now eapply convty_wk.
+ irrelevance0.
2: now apply ih.
now rewrite 2! wk_id_ren_on.
Expand Down
Loading

0 comments on commit b7efd26

Please sign in to comment.