LF Specification

[View unique.elf]
ty : type.
i : ty.
arr : ty -> ty -> ty.

tm : type.
u : tm.
lam : ty -> (tm -> tm) -> tm.
app : tm -> tm -> tm.

of : tm -> ty -> type.

of/u : of u i.
of/app : {A:ty} {B:ty} {M:tm} {N:tm} of M (arr A B) -> of N A -> of (app M N) B.
of/lam : {A:ty} {B:ty} {R:tm -> tm} ({x:tm} of x A -> of (R x) B) -> of (lam A ([x:tm] R x)) (arr A B).

Reasoning

[View unique.thm]

Click on a command or tactic to see a detailed view of its use.

Specification "unique.elf".

Define ctx : olist -> prop by
  ctx nil
; nabla x p,
    ctx ( < p : of x A > :: < x : tm > :: G ) := ctx G.

Theorem member_prune : forall G E, nabla (n:lfobj),
  member (E n) G -> exists F, E = x\ F.

Define fresh : lfobj -> lfobj -> prop by
  nabla x, fresh x A.

Define name : lfobj -> prop by
  nabla x, name x.

Theorem ctx_mem : forall G E,
  ctx G -> member E G ->
     (exists X, E = <X : tm> /\ name X)
  \/ (exists P X A, E = < P : of X A > /\ fresh X A /\ fresh P A).

Theorem ctx_unique : forall G P Q X A B,
  ctx G -> member < P : of X A > G -> member < Q : of X B > G ->
  A = B /\ P = Q.

Theorem unique_ty : forall G M A B P1 P2,
  ctx G ->
  < G |- P1 : of M A > -> < G |- P2 : of M B > -> A = B.

Theorem unique_proof : forall G M A B P1 P2,
  ctx G ->
  < G |- P1 : of M A > -> < G |- P2 : of M B > -> P1 = P2.