Runming Li, Harrison Grodin, Robert Harper
8 min
Logical relations are a cornerstone of programming language semantics, typically used to establish canonicity, normalization, and parametricity. In operational settings, these relations require a closure under expansion property, where one must move computability evidence backward along reduction steps. In categorical settings, logical relations are often formalized via gluing, which treats computability as proof-relevant evidence within a type theory.
This paper asks whether these two perspectives—operational directed reduction and categorical proof-relevant gluing—can coexist. The authors address this by working within simplicial homotopy type theory, which features a primitive directed interval. They replace judgmental equality with directed inequality types, modeling reductions as directed constructors within a quotient inductive-inductive type (QIIT).
The central contribution is the observation that contravariant families in simplicial type theory possess exactly the structure needed for proof-relevant closure under expansion. A contravariant family is equipped with a backward transport operation along inequalities, which satisfies functoriality and a universal property. By equipping every computability predicate in the gluing model with this contravariant structure, the authors successfully internalize the required backward transport of computability witnesses along reductions.
To prove canonicity for a Boolean type, the authors construct a unary logical relations model. They show that closed Boolean terms reduce to canonical values (true or false) by interpreting computability predicates as contravariant. The framework is then extended to dependent type theory and universes by employing the flat modality, which discretizes the space of predicates and reconciles the needs of type conversion with the directed structure of reductions. Finally, they adapt the method to binary logical relations to support parametricity, separating homogeneous reductions from heterogeneous parametricity witnesses.
Alex: No. Their syntax mixes ordinary constructors, equality constructors, and directed constructors. A directed constructor specifies a reduction, such as projecting the first component of a pair. The equations governing substitution remain equalities, so the change is selective.
Sam: Let’s use that pair example. Where does the proof actually need something new?
Alex: Suppose each component of a pair already has evidence that it behaves well. The logical relation says a pair behaves well when both its projections behave well. But evidence for the first component is not yet evidence for the expression that projects it.
Sam: The projection reduces to that component. So the proof needs to carry evidence against the direction of execution.
Alex: That is closure under expansion. If an expression reduces to a well-behaved result, the original expression must also count as well-behaved. For Booleans, the argument is simple: join the initial reduction to the result’s reduction to true or false.
Sam: If that backward move is already standard, what is the new contribution?
Alex: With proof-relevant evidence, a backward map alone is insufficient. Doing nothing must leave evidence unchanged. Transporting across successive reductions must agree with transporting across their composite. The model must also validate directed reductions between terms carrying evidence.
Sam: So the issue is not finding any witness. It is making the witnesses fit the computation consistently.
Alex: The authors’ central observation is that a contravariant family supplies exactly this structure. In plain terms, it is a family of evidence types with coherent backward transport along directed arrows. Simplicial type theory already provides results about these families.
Sam: What does that buy them beyond the consistency laws?
Alex: There is also a universal property: a suitably unique way to lift a reduction backward from its endpoint evidence. That property supplies the comparison between witnesses needed to interpret directed constructors. It closes a gap that merely choosing backward maps would leave.
Sam: For the pair, then, evidence for the component travels backward to evidence for the projection expression.
Alex: And the universal property validates the corresponding reduction in the combined syntax-and-evidence model. Products and functions preserve the required contravariance through established closure results. The authors can assemble the proof compositionally, rather than inventing each expansion argument separately.
Sam: How does assembling that model deliver the promised result about Booleans?
Alex: The Boolean evidence contains a choice of true or false, together with a directed reduction to it. The syntax has an induction principle that maps every well-typed term into the evidence-enriched model. For a closed Boolean, its attached evidence is therefore the desired reduction.
Sam: This is a proof paper, so the evidence is the construction, not a benchmark. How much of it was checked by a proof assistant?
Alex: The non-dependent fragment is mechanized in Cubical Agda, covering products, functions, and Booleans. That includes the directed syntax, contravariance, and the model yielding Boolean canonicity—the claim we just described. The mechanization postulates a directed interval and its axioms.
Sam: That establishes a definite scope. What happens when types can depend on values, or when the language includes a universe of type codes?
Alex: Those extensions are developed in the paper, but not covered by the reported mechanization. They introduce another obstacle: converting between types requires symmetric equality, not merely a directed reduction. The authors make syntactic types discrete, so their directed comparisons correspond to equalities, while terms retain directed computation.
Sam: Does that also solve the problem of storing predicates inside the universe?
Alex: It solves only part of it. The space of predicates needs discreteness too. The authors use a flat modality, a construction that removes directed structure while retaining the groupoid core. Storing predicate codes this way supplies discreteness without changing the predicates seen by terms.
Sam: The paper also discusses comparing different implementations. How does the same idea extend there?
Alex: Binary logical relations attach evidence relating a left implementation to a right implementation. The construction separates reductions within either implementation from the relation between them. In the queue example, the implementations use a single list and a pair of lists.
Sam: What replaces the usual assertion that those lists describe the same queue?
Alex: The directed relation says both representations reduce to a common canonical list. Evidence of that relationship can travel backward along reductions on either side. That illustrates how the framework supports representation-independence arguments.
Sam: Before we treat these arrows as ordinary execution, is that connection itself established?
Alex: Not fully. The theorem concerns the internally constructed directed syntax. Identifying it with the conventional, externally defined reduction structure is left for future work. My reading is that the checked fragment strongly supports the internal construction, but does not settle that external comparison.
Sam: Given that boundary, who should read the full document, and where should they begin?
Alex: Researchers in logical relations and language semantics should start with Section 3.2, where products expose the need for contravariance. For dependent types and universes, read Section 4. For formalization, Section 6.2 explains the transport difficulties and the checked scope.
Sam: And what should someone outside that audience remember?
Alex: Computation moves forward; evidence that a program behaves well must be able to travel backward.
Sam: Thanks for listening.