Higher-kinded relational parametricity of pure Fω

TheoremFundamental theorem of higher-kinded parametricity for Fω#✓fully proved

The full binary higher-kinded fundamental theorem of pure Fω.

theorem fundamental {Δ : List Kind} {m : Nat} {Γ : Ctx Δ m}
    {t : Tm Δ m} {A : Ty Δ .star} (ht : Typing Γ t A)
    (ρ : KEnv SystemF.Rel Δ) (σ τ : Fin m → SystemF.Model)
    (hστ : ∀ i, ((Γ i).interpret ρ).holds (σ i) (τ i)) :
    (A.interpret ρ).holds (Tm.close σ t) (Tm.close τ t)
Uses 24 · Used by 1

TheoremClosed typed Fω terms are related to themselves#✓fully proved

Every closed-term typed expression is related to itself at every kind environment.

theorem fundamental_closed {Δ : List Kind} {Γ : Ctx Δ 0}
    {t : Tm Δ 0} {A : Ty Δ .star} (ht : Typing Γ t A)
    (ρ : KEnv SystemF.Rel Δ) :
    (A.interpret ρ).holds (Tm.eraseModel t) (Tm.eraseModel t)
Uses 11 · Used by 4

DefinitionHigher-kinded identity type#✓fully proved

A genuine higher-kind identity type: ∀ F : * → *, ∀ X : *, F X → F X.

def higherIdType {Δ : List Kind} : Ty Δ .star :=
  .all (κ := .arrow .star .star) (.all (κ := .star)
    (.arr (.app (.var (.succ .zero)) (.var .zero))
      (.app (.var (.succ .zero)) (.var .zero))))
Uses 3 · Used by 3

DefinitionHigher-kinded polymorphic identity term#✓fully proved

The pure higher-kinded polymorphic identity term.

def higherId {Δ : List Kind} {m : Nat} : Tm Δ m :=
  .tabs (κ := .arrow .star .star) (.tabs (κ := .star)
    (.lam (.app (.var (.succ .zero)) (.var .zero)) (.var 0)))
Uses 4 · Used by 1

TheoremTyping of the higher-kinded identity#✓fully proved

The higher-kinded identity is typed in every existing term context.

theorem higherId_typed {Δ : List Kind} {m : Nat} (Γ : Ctx Δ m) :
    Typing Γ higherId higherIdType
Uses 9

TheoremClosed inhabitants of the higher-kinded identity type are identities#✓fully proved

Every closed-term inhabitant is beta-identity at every kind-correct instantiation.

The inhabitant is arbitrary, not the manually defined higherId. The input is any locally closed model term; no CBV termination or normalization is claimed.

theorem higher_kinded_identity {Δ : List Kind} {t : Tm Δ 0}
    (ht : Typing Fin.elim0 t higherIdType)
    (F : Ty Δ (.arrow .star .star)) (A : Ty Δ .star) (x : SystemF.Model) :
    SystemF.BetaEq
      (SystemF.Model.app (Tm.eraseModel (.tapp (.tapp t F) A)) x) x
Uses 21

Different higher-kind type instantiations preserve every admissible binary relation.

theorem higher_kinded_related {Δ : List Kind} {t : Tm Δ 0}
    (ht : Typing Fin.elim0 t higherIdType)
    (F G : Ty Δ (.arrow .star .star)) (A B : Ty Δ .star)
    (Φ : SystemF.Rel → SystemF.Rel) (R : SystemF.Rel)
    {x y : SystemF.Model} (hxy : (Φ R).holds x y) :
    (Φ R).holds
      (SystemF.Model.app (Tm.eraseModel (.tapp (.tapp t F) A)) x)
      (SystemF.Model.app (Tm.eraseModel (.tapp (.tapp t G) B)) y)
Uses 14

TheoremNo closed Fω term inhabits \(\forall X, X\)#✓fully proved

The empty relation excludes all closed-term inhabitants of ∀ X : *, X.

theorem forall_var_uninhabited {Δ : List Kind} (t : Tm Δ 0) :
    ¬ Typing Fin.elim0 t (.all (κ := .star) (.var .zero))
Uses 11

TheoremNo closed Fω term inhabits \(\forall F, \forall X, F\,X\)#✓fully proved

A constant empty operator excludes ∀ F : * → *, ∀ X : *, F X.

theorem higher_result_uninhabited {Δ : List Kind} (t : Tm Δ 0) :
    ¬ Typing Fin.elim0 t (.all (κ := .arrow .star .star)
      (.all (κ := .star) (.app (.var (.succ .zero)) (.var .zero))))
Uses 11
9 fully proved

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.