Commit 5237f34c authored by Gaspard Ferey's avatar Gaspard Ferey

WIP

parent 4a8ab344
...@@ -294,7 +294,7 @@ Notation "Γ '⊢' t '≡β' u" := ((RSTClosure RW_Beta ) Γ t u) (at lev ...@@ -294,7 +294,7 @@ Notation "Γ '⊢' t '≡β' u" := ((RSTClosure RW_Beta ) Γ t u) (at lev
Notation "Γ '⊢' t '≡Γ' u" := ((RSTClosure RW_Gamma ) Γ t u) (at level 40, t at level 25). Notation "Γ '⊢' t '≡Γ' u" := ((RSTClosure RW_Gamma ) Γ t u) (at level 40, t at level 25).
Notation "Γ '⊢' t '≡βΓ' u" := ((RSTClosure RW_Beta_Gamma) Γ t u) (at level 40, t at level 25). Notation "Γ '⊢' t '≡βΓ' u" := ((RSTClosure RW_Beta_Gamma) Γ t u) (at level 40, t at level 25).
Notation "Γ '⊢' t '≡' u" := (Γ t ≡βΓ u) (at level 40, t at level 25). Notation "Γ '⊢' t '≡' u" := (Γ t ≡βΓ u) (at level 40, t at level 25).
Reserved Notation "Γ '⊢' t ':' A" (at level 40, t at level 25). Reserved Notation "Γ '⊢' t ':' A" (at level 40, t at level 25).
Reserved Notation "Γ ✓" (at level 40). Reserved Notation "Γ ✓" (at level 40).
......
...@@ -3,15 +3,6 @@ Require Import LPTerm. ...@@ -3,15 +3,6 @@ Require Import LPTerm.
Require Import WF. Require Import WF.
Lemma no_type_kind : forall Γ A, Γ kind : A -> False.
Proof.
intros.
remember kind as x.
induction H ; try inversion Heqx.
apply IHtyping1.
easy.
Qed.
Lemma inversion_rel : forall Γ t u, Γ -> t u Γ -> exists s A Δ, Δ t : A /\ Δ u : A /\ Δ A : s. Lemma inversion_rel : forall Γ t u, Γ -> t u Γ -> exists s A Δ, Δ t : A /\ Δ u : A /\ Δ A : s.
Proof. Proof.
intros. intros.
......
Require Import LPTerm. Require Import LPTerm.
Require Import WF.
Require Import conversion. Require Import conversion.
Inductive Sort : Set := SKind | SType | SObject.
Theorem kind_not_typable2 : forall Γ T t, Γ t : T -> ~ (t = kind). Theorem kind_not_typable2 : forall Γ T t, Γ t : T -> ~ (t = kind).
Proof. intros. induction H; try easy. Qed. Proof. intros. induction H; try easy. Qed.
Theorem kind_not_typable : forall Γ T, Γ kind : T -> False. Theorem kind_not_typable : forall Γ T, Γ kind : T -> False.
Proof. intros. pose proof (kind_not_typable2 _ _ _ H). easy. Qed. Proof. intros. pose proof (kind_not_typable2 _ _ _ H). easy. Qed.
Lemma not_var_kind_gamma : forall Γ x, Γ -> x : kind Γ -> False. Lemma not_var_kind_gamma : forall Γ x, Γ -> ~ (x : kind Γ).
Proof. Proof.
induction Γ ; intros. intros. intro.
- inversion H0. remember (kind) as K.
- inversion H0 ; subst. induction H0.
+ inversion H ; subst. inversion H3 ; subst. eapply no_type_kind ; eassumption. - remember (Γ, x : A) as Γ'.
+ inversion H ; subst ; eapply IHΓ ; eassumption. destruct H; inversion HeqΓ'.
- inversion H0 ; subst ; inversion H ; subst ; eapply IHΓ ; eassumption. + subst. apply (kind_not_typable _ _ H0).
+ subst. apply (kind_not_typable _ _ H0).
- apply IHInCtx. eapply vardecl_WF. apply H. easy.
-apply IHInCtx. eapply ruldecl_WF. apply H. easy.
Qed. Qed.
Lemma not_rel_kind_gamma_left : forall Γ t, Γ, kind t -> False. Lemma not_rel_kind_gamma_left : forall Γ t, Γ, kind t -> False.
Proof. Proof. intros; inversion H ; subst ; eapply kind_not_typable ; eassumption. Qed.
intros Γ t H ; inversion H ; subst ; eapply no_type_kind ; eassumption.
Qed.
Lemma not_rel_kind_gamma_right : forall Γ t, Γ, t kind -> False. Lemma not_rel_kind_gamma_right : forall Γ t, Γ, t kind -> False.
Proof. Proof. intros; inversion H ; subst ; eapply kind_not_typable ; eassumption. Qed.
intros Γ t H ; inversion H ; subst ; eapply no_type_kind ; eassumption.
Qed.
Lemma rel_kind_in_left : forall Γ t, Γ -> kind t Γ -> False. Lemma rel_kind_in_left : forall Γ t, Γ -> kind t Γ -> False.
Proof. Proof.
intros Γ. intros.
induction Γ ; intros u Γwf H. remember (kind) as K.
- inversion H. induction H0; subst.
- eapply IHΓ ; inversion H ; subst. - eapply not_rel_kind_gamma_left. apply H.
+ now inversion Γwf. - apply IHInRelCtx. eapply vardecl_WF. apply H. easy.
+ eassumption. - apply IHInRelCtx. eapply ruldecl_WF. apply H. easy.
- inversion H ; subst.
+ eapply not_rel_kind_gamma_left ; eassumption.
+ eapply IHΓ.
* now inversion Γwf.
* eassumption.
Qed. Qed.
Lemma rel_kind_in_right : forall Γ t, Γ -> t kind Γ -> False. Lemma rel_kind_in_right : forall Γ t, Γ -> t kind Γ -> False.
Proof. Proof.
intros Γ. intros.
induction Γ ; intros u Γwf H. remember (kind) as K.
- inversion H. induction H0; subst.
- eapply IHΓ ; inversion H ; subst. - eapply not_rel_kind_gamma_right. apply H.
+ now inversion Γwf. - apply IHInRelCtx. eapply vardecl_WF. apply H. easy.
+ eassumption. - apply IHInRelCtx. eapply ruldecl_WF. apply H. easy.
- inversion H ; subst.
+ eapply not_rel_kind_gamma_right ; eassumption.
+ eapply IHΓ.
* now inversion Γwf.
* eassumption.
Qed. Qed.
Inductive of_typed_kind : term -> Prop := Theorem conv_kind_not_typable : forall Γ t T, Γ t : T -> ~ (Γ t T).
| IKType : of_typed_kind type
| IKPiType : forall A B, of_typed_kind B -> of_typed_kind (Π A ~ B).
Lemma inhabit_kind : forall Γ t, Γ -> Γ t : kind -> of_typed_kind t.
Proof. Proof.
intros. intros. intro.
remember kind as x. induction H0.
induction H0 ; subst.
- exfalso ; eapply not_var_kind_gamma ; eassumption. Qed.
- constructor.
- assert (Γ, x : A ).
constructor ; eassumption.
pose proof (IHtyping2 H0 eq_refl).
now constructor.
- inversion Heqx.
-
Lemma inverse_kind : forall Γ t, Γ -> forall u, Γ u t -> u = kind <-> t = kind. Lemma kind_conv : forall Γ t T, Γ t : T -> Γ type t -> type = t.
Proof. Proof.
intros. intros.
induction H0. remember kind as K.
induction H.
- easy. - easy.
- split ; intro. - subst; try easy.
apply IHConv2 ; now apply IHConv1.
apply IHConv1 ; now apply IHConv2.
- split ; intro ; now apply IHConv.
- split ; intro.
+ inversion H0.
+ (* FALSE because t and u might not be typable *) admit.
- inversion H0 ; split ; intro ; subst.
+ exfalso ; eapply not_rel_kind_gamma_left ; eassumption.
+ exfalso ; eapply not_rel_kind_gamma_right ; eassumption.
+ exfalso ; eapply rel_kind_in_left.
* inversion H ; subst ; eassumption.
* eassumption.
+ exfalso ; eapply rel_kind_in_right.
* inversion H ; subst ; eassumption.
* eassumption.
+ exfalso ; eapply rel_kind_in_left.
* inversion H ; subst ; eassumption.
* eassumption.
+ exfalso ; eapply rel_kind_in_right.
* inversion H ; subst ; eassumption.
* eassumption.
- split. admit. (* a better definition of context is needed here *)
Admitted.
Lemma type_kind : forall Γ A, Γ type : A -> A = kind. Lemma type_kind : forall Γ A, Γ type : A -> A = kind.
Proof. Proof.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment