Skip to content

Commit 8ab99d8

Browse files
author
Martin Baillon
committed
Lambda.v goes through
1 parent 115ba00 commit 8ab99d8

File tree

5 files changed

+484
-128
lines changed

5 files changed

+484
-128
lines changed

_CoqProject

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ theories/LogicalRelation/Escape.v
2929
theories/LogicalRelation/ShapeView.v
3030
theories/LogicalRelation/Reflexivity.v
3131
theories/LogicalRelation/Irrelevance.v
32-
theories/LogicalRelation/Split.v
3332
theories/LogicalRelation/Transitivity.v
3433
theories/LogicalRelation/Weakening.v
3534
theories/LogicalRelation/Monotonicity.v
35+
theories/LogicalRelation/Split.v
3636
theories/LogicalRelation/Universe.v
3737
theories/LogicalRelation/Neutral.v
3838
theories/LogicalRelation/Reduction.v

theories/GenericTyping.v

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,11 +1452,32 @@ Section GenericConsequences.
14521452
intros * []; constructor; now eapply convneu_whne.
14531453
Qed.
14541454

1455+
Lemma isWfFun_Ltrans {wl wl' Γ A B t} (f : wl' ≤ε wl) :
1456+
isWfFun wl Γ A B t -> isWfFun wl' Γ A B t.
1457+
Proof.
1458+
intros [] ; constructor.
1459+
- now eapply wft_Ltrans.
1460+
- now eapply convty_Ltrans.
1461+
- now eapply ty_Ltrans.
1462+
- now eapply ty_Ltrans.
1463+
- now eapply convneu_Ltrans.
1464+
Qed.
1465+
14551466
Lemma isWfPair_isPair : forall l Γ A B t, isWfPair l Γ A B t -> isPair t.
14561467
Proof.
14571468
intros * []; constructor; now eapply convneu_whne.
14581469
Qed.
14591470

1471+
Lemma isWfPair_Ltrans {wl wl' Γ A B t} (f : wl' ≤ε wl) :
1472+
isWfPair wl Γ A B t -> isWfPair wl' Γ A B t.
1473+
Proof.
1474+
intros [] ; constructor.
1475+
all: try now eapply wft_Ltrans.
1476+
1,2,3,5 : now eapply convty_Ltrans.
1477+
1,2: now eapply ty_Ltrans.
1478+
now eapply convneu_Ltrans.
1479+
Qed.
1480+
14601481
End GenericConsequences.
14611482

14621483
#[export] Hint Resolve tyr_wf_l tmr_wf_l well_typed_well_formed : gen_typing.

theories/LogicalRelation/Reflexivity.v

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Section Reflexivities.
1919
all: cbn in * ; eassumption.
2020
(* econstructor; tea; now eapply escapeEqTerm. *)
2121
Qed.
22+
2223

2324
Definition WreflLRTyEq {l wl Γ A} (lr : W[ Γ ||-< l > A ]< wl > ) :
2425
W[ Γ ||-< l > A ≅ A | lr ]< wl >.
@@ -119,7 +120,104 @@ Section Reflexivities.
119120
all: cbn; now eauto.
120121
- intros; now eapply reflIdRedTmEq.
121122
Qed.
123+
(*
124+
Definition reflLRTmEq_inv@{h i j k l} {l wl Γ A} (lr : [ LogRel@{i j k l} l | Γ ||- A ]< wl > ) :
125+
forall t,
126+
[ Γ ||-<l> t ≅ t : A | lr ]< wl > ->
127+
[ Γ ||-<l> t : A | lr ]< wl >.
128+
Proof.
129+
pattern l, wl, Γ, A, lr; eapply LR_rect_TyUr; clear l wl Γ A lr; intros l wl Γ A.
130+
- intros h t [? ? ? ? Rt%RedTyRecFwd@{j k h i k}] ; cbn in *.
131+
(* Need an additional universe level h < i *)
132+
destruct redL.
133+
now unshelve econstructor.
134+
- intros ? t [???[]].
135+
econstructor ; cbn in *.
136+
1: eassumption.
137+
now eapply lrefl.
138+
- intros ??? t [].
139+
unshelve econstructor ; cbn in *.
140+
4: now eapply (PiRedTm.red redL).
141+
1,2: shelve.
142+
1: now eapply (PiRedTm.refl redL).
143+
1: now eapply (PiRedTm.isfun redL).
144+
+ cbn in *.
145+
intros.
146+
eapply (PiRedTm.app redL) ; eassumption.
147+
+ cbn in * ; intros.
148+
eapply (PiRedTm.eq redL) ; eassumption.
149+
- intros NA t Nt ; cbn in *.
150+
epose (test := NatRedEqInduction _ _ _ NA
151+
(fun t u Htu => [Γ ||-Nat t : A | NA ]< wl >)
152+
(fun t u Htu => NatProp NA t)).
153+
cbn in *.
154+
eapply test.
155+
5: eassumption.
156+
2: now constructor.
157+
2: intros ; now constructor.
158+
2:{ intros. constructor ; destruct r.
159+
160+
Search hyp: Notations.conv_neu_conv.
161+
2: now eapply lrefl.
162+
destruct Nt.
163+
Print TermRedWf.
164+
165+
; destruct Nt.
166+
econstructor.
167+
+ eassumption.
168+
+ etransitivity ; [ | eassumption].
169+
now symmetry.
170+
+ About NatRedEqInduction.
171+
pose (test := NatRedEqInduction _ _ _ NA).
172+
173+
174+
Print NatPropEq.
175+
refine (fix f := match prop with
176+
| zeroRed => _
177+
| succReq n n' Hnn' => f' Hnn'
178+
| neReq _ _ => _
179+
end
180+
with f' := match Hnn' with
181+
| Build_NatRedTmEq _ _ _ _ => _
182+
end
183+
).
184+
).
185+
122186
187+
188+
eapply X0.
189+
replace (PiRedTm.nf redL) with (PiRedTm.nf redR) at 2.
190+
1: now eapply eqApp.
191+
eapply whredtm_det.
192+
all: econstructor.
193+
2,4: destruct redL, redR ; cbn in *.
194+
2,3: inversion isfun ; inversion isfun0 ; subst ; constructor.
195+
2-5: now eapply convneu_whne.
196+
* now eapply (PiRedTm.red redR).
197+
* now eapply (PiRedTm.red redL).
198+
+ cbn in *.
199+
intros.
200+
201+
destruct redR ; cbn in *.
202+
inversion isfun ; subst ; constructor.
203+
now eapply convneu_whne.
204+
205+
destruct redL ; cbn in *.
206+
207+
1-2: now econstructor.
208+
+ intros ; now eapply eqTree.
209+
+
210+
all: cbn; now eauto.
211+
- intros; now apply reflNatRedTmEq.
212+
- intros; now apply reflBoolRedTmEq.
213+
- intros; now apply reflEmptyRedTmEq.
214+
- intros ??? t [].
215+
unshelve econstructor ; cbn in *.
216+
1-2: now econstructor.
217+
all: cbn; now eauto.
218+
- intros; now eapply reflIdRedTmEq.
219+
Qed.
220+
*)
123221
Definition WreflLRTmEq@{h i j k l} {l wl Γ A}
124222
(lr : WLogRel@{i j k l} l wl Γ A ) :
125223
forall t,

0 commit comments

Comments
 (0)