Skip to content

Commit

Permalink
Semantic proof of the type inversion lemmas.
Browse files Browse the repository at this point in the history
We leverage the knowledge that convertibility implies well-typedness instead
of performing syntactic inversions.
  • Loading branch information
ppedrot committed Sep 11, 2023
1 parent 967feba commit 3b197fe
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions theories/TypeConstructorsInj.v
Original file line number Diff line number Diff line change
Expand Up @@ -599,32 +599,26 @@ Lemma prod_ty_inv Γ A B :
[Γ |- A] × [Γ,, A |- B].
Proof.
intros Hty.
inversion Hty ; subst ; clear Hty.
1: easy.
eapply termGen in H as (?&[-> ]&_).
split ; now econstructor.
apply TypeRefl, prod_ty_inj in Hty as [HA HB].
split; boundary.
Qed.

Lemma sig_ty_inv Γ A B :
[Γ |- tSig A B] ->
[Γ |- A] × [Γ,, A |- B].
Proof.
intros Hty.
inversion Hty ; subst ; clear Hty.
1: easy.
eapply termGen in H as (?&[-> ]&_).
split ; now econstructor.
apply TypeRefl, sig_ty_inj in Hty as [HA HB].
split; boundary.
Qed.

Lemma id_ty_inv Γ A x y :
[Γ |- tId A x y] ->
[Γ |- A] × [Γ |- x : A] × [Γ |- y : A].
Proof.
intros Hty.
inversion Hty ; subst ; clear Hty.
1: easy.
eapply termGen in H as (?&[-> ]&_).
split ; now econstructor.
apply TypeRefl, id_ty_inj in Hty as [HA HB].
prod_splitter; boundary.
Qed.

Lemma termGen' Γ t A :
Expand Down

0 comments on commit 3b197fe

Please sign in to comment.