Documentation

LeanSce.SCE.Elaboration.Uniqueness

Uniqueness of elaboration: source lookups are functional, and elabExp is syntax-directed — a term has at most one source type and one Core term.

theorem index_lookup_uniqueness {T T₁ T₂ : SCE.Typ} {n : Nat} (h₁ : SCE.SLookup T n T₁) (h₂ : SCE.SLookup T n T₂) :
T₁ = T₂
theorem record_lookup_uniqueness {T T₁ T₂ : SCE.Typ} {l : String} (h₁ : SCE.SRLookup T l T₁) (h₂ : SCE.SRLookup T l T₂) :
T₁ = T₂
theorem elaboration_inference_uniqueness {Γ T₁ T₂ : SCE.Typ} {e : SCE.Exp} {ce₁ ce₂ : Core.Exp} (h₁ : elabExp Γ e T₁ ce₁) (h₂ : elabExp Γ e T₂ ce₂) :
T₁ = T₂
theorem inference_uniqueness {Γ A₁ A₂ : SCE.Typ} {e : SCE.Exp} (h₁ : SCE.HasType Γ e A₁) (h₂ : SCE.HasType Γ e A₂) :
A₁ = A₂

A source expression has at most one type in a given context.

theorem elaboration_uniqueness {Γ T₁ T₂ : SCE.Typ} {e : SCE.Exp} {ce₁ ce₂ : Core.Exp} (h₁ : elabExp Γ e T₁ ce₁) (h₂ : elabExp Γ e T₂ ce₂) :
ce₁ = ce₂