Theory HIT_Syntax
theory HIT_Syntax
imports Main
begin
section ‹A structural HIT calculus›
text ‹
This stand-alone Isabelle/HOL session fixes a small type theory whose
∗‹only› type formers are function spaces and higher inductive types drawn
from a signature environment. The calculus is finitary, one-dimensional
and nondependent: signatures contain finite lists of point and path
constructors, constructor arguments have fixed higher-inductive types, and
eliminators have a constant motive. The development studies syntax,
reduction, typing, signature well-formedness, free dimension support,
boundary coherence, substitution, subject reduction, progress, multi-step
type safety, strong normalization, confluence, and canonical forms.
Two design decisions make the treatment uniform.
▪ Higher inductive types are not built in one at a time. A signature
lists point constructors and path constructors, each with a list of
argument specifications, and each path constructor with two endpoints
expressed over its own arguments. Ordinary inductive types are the
signatures with no path constructors, so the natural numbers, the unit
type and the empty type are instances of the same schema.
▪ Path constructors are ∗‹cubical-style›: a path constructor applied
to its arguments takes a further dimension argument, and the eliminator
computes on it judgmentally. The endpoints are not separate rules but
the result of substituting the two constant dimensions, so the boundary
of a path constructor is part of dimension substitution rather than of
reduction. This is a small syntax with dimension variables, not a
formalization of cubical type theory or its Kan operations.
Dimension variables are natural numbers. Index ‹0› is reserved: it is the
dimension bound by the path methods of an eliminator. Ambient dimension
contexts therefore consist of strictly positive indices, and no shifting is
ever required.
›
subsection ‹Types, dimensions, endpoints, and terms›
datatype ty =
Fun ty ty
| Hit nat
text ‹
An argument of a constructor is either a parameter, whose type is one of
the higher inductive types of the signature environment, or a recursive
occurrence of the type being described. Restricting parameters to higher
inductive types is no loss for the usual examples: ordinary inductive types
are themselves instances of the schema. What it excludes is infinitary
constructors, whose arguments are functions into the type being defined.
›
datatype argspec =
Par nat
| Rec
text ‹
An endpoint of a path constructor is a point-constructor term over the
arguments of that path constructor.
›