Finish one example case of violate sn
This commit is contained in:
parent
aa2c2ca151
commit
20eef78014
1 changed files with 140 additions and 81 deletions
|
@ -1,5 +1,6 @@
|
|||
From Ltac2 Require Ltac2.
|
||||
Import Ltac2.Notations.
|
||||
|
||||
Import Ltac2.Control.
|
||||
Require Import ssreflect ssrbool.
|
||||
Require Import FunInd.
|
||||
|
@ -803,8 +804,34 @@ Module Type NoForbid.
|
|||
Axiom P_AppPair : forall n (a b c : PTm n), ~ P (PApp (PPair a b) c).
|
||||
Axiom P_ProjAbs : forall n p (a : PTm (S n)), ~ P (PProj p (PAbs a)).
|
||||
|
||||
Axiom P_AppInv : forall n (a b : PTm n), P (PApp a b) -> P a /\ P b.
|
||||
Axiom P_AbsInv : forall n (a : PTm (S n)), P (PAbs a) -> P a.
|
||||
Axiom P_renaming : forall n m (ξ : fin n -> fin m) a , P (ren_PTm ξ a) <-> P a.
|
||||
|
||||
End NoForbid.
|
||||
|
||||
Module Type NoForbid_FactSig (M : NoForbid).
|
||||
|
||||
Axiom P_EReds : forall n (a b : PTm n), rtc ERed.R a b -> M.P a -> M.P b.
|
||||
|
||||
Axiom P_RReds : forall n (a b : PTm n), rtc RRed.R a b -> M.P a -> M.P b.
|
||||
|
||||
End NoForbid_FactSig.
|
||||
|
||||
Module NoForbid_Fact (M : NoForbid) : NoForbid_FactSig M.
|
||||
Import M.
|
||||
|
||||
Lemma P_EReds : forall n (a b : PTm n), rtc ERed.R a b -> P a -> P b.
|
||||
Proof.
|
||||
induction 1; eauto using P_ERed, rtc_l, rtc_refl.
|
||||
Qed.
|
||||
|
||||
Lemma P_RReds : forall n (a b : PTm n), rtc RRed.R a b -> P a -> P b.
|
||||
Proof.
|
||||
induction 1; eauto using P_RRed, rtc_l, rtc_refl.
|
||||
Qed.
|
||||
End NoForbid_Fact.
|
||||
|
||||
Module SN_NoForbid : NoForbid.
|
||||
Definition P := @SN.
|
||||
Arguments P {n}.
|
||||
|
@ -821,17 +848,35 @@ Module SN_NoForbid : NoForbid.
|
|||
Lemma P_ProjAbs : forall n p (a : PTm (S n)), ~ P (PProj p (PAbs a)).
|
||||
Proof. sfirstorder use:PProjAbs_imp. Qed.
|
||||
|
||||
Lemma P_AppInv : forall n (a b : PTm n), P (PApp a b) -> P a /\ P b.
|
||||
Admitted.
|
||||
|
||||
Lemma P_AbsInv : forall n (a : PTm (S n)), P (PAbs a) -> P a.
|
||||
Proof.
|
||||
move => n a. move E : (PAbs a) => u h.
|
||||
move : E. move : a.
|
||||
induction h; sauto lq:on rew:off.
|
||||
Qed.
|
||||
|
||||
Lemma P_renaming : forall n m (ξ : fin n -> fin m) a , P (ren_PTm ξ a) <-> P a.
|
||||
Admitted.
|
||||
|
||||
End SN_NoForbid.
|
||||
|
||||
Lemma bool_dec (a : bool) : a \/ ~~ a.
|
||||
Proof. hauto lq:on inv:bool. Qed.
|
||||
Module UniqueNF (M : NoForbid) (MFacts : NoForbid_FactSig M).
|
||||
Import M MFacts.
|
||||
#[local]Hint Resolve P_ERed P_RRed P_AppPair P_ProjAbs : forbid.
|
||||
|
||||
Lemma η_split n (a0 a1 : PTm n) :
|
||||
ERed.R a0 a1 ->
|
||||
P a0 ->
|
||||
exists b, rtc RRed.R a0 b /\ NeERed.R_nonelim b a1.
|
||||
Proof.
|
||||
move => h. elim : n a0 a1 /h .
|
||||
- move => n a0 a1 ha [b [ih0 ih1]].
|
||||
- move => n a0 a1 ha ih /[dup] hP.
|
||||
move /P_AbsInv /P_AppInv => [/P_renaming ha0 _].
|
||||
have {ih} := ih ha0.
|
||||
move => [b [ih0 ih1]].
|
||||
case /orP : (orNb (ishf b)).
|
||||
exists (PAbs (PApp (ren_PTm shift b) (VarPTm var_zero))).
|
||||
split. apply RReds.AbsCong. apply RReds.AppCong; auto using rtc_refl.
|
||||
|
@ -851,7 +896,16 @@ Proof.
|
|||
apply : RRed.AbsCong => /=.
|
||||
apply RRed.AppAbs'. by asimpl.
|
||||
(* violates SN *)
|
||||
+ admit.
|
||||
+ move => p p0 h. exfalso.
|
||||
have : P (PApp (ren_PTm shift a0) (VarPTm var_zero))
|
||||
by sfirstorder use:P_AbsInv.
|
||||
|
||||
have : rtc RRed.R (PApp (ren_PTm shift a0) (VarPTm var_zero))
|
||||
(PApp (ren_PTm shift (PPair p p0)) (VarPTm var_zero))
|
||||
by hauto lq:on use:RReds.AppCong, RReds.renaming, rtc_refl.
|
||||
|
||||
move : P_RReds. repeat move/[apply] => /=.
|
||||
hauto l:on use:P_AppPair.
|
||||
- move => n a0 a1 h.
|
||||
move => [b [ih0 ih1]].
|
||||
case /orP : (orNb (ishf b)).
|
||||
|
@ -909,6 +963,11 @@ Proof.
|
|||
- hauto lq:on ctrs:rtc, NeERed.R_nonelim.
|
||||
Admitted.
|
||||
|
||||
|
||||
|
||||
End UniqueNF.
|
||||
|
||||
|
||||
Lemma η_nf_to_ne n (a0 a1 : PTm n) :
|
||||
ERed'.R a0 a1 -> nf a0 -> ~~ ne a0 -> ne a1 ->
|
||||
(a0 = PAbs (PApp (ren_PTm shift a1) (VarPTm var_zero))) \/
|
||||
|
|
Loading…
Add table
Reference in a new issue