Skip to content

Support level polymorphism #143

@Vtec234

Description

@Vtec234

The surface syntax of SynthLean does not currently support universe polymorphism, forcing us to use hacks such as three different sorry axioms, and in general exponentially many definitions. This is a serious usability issue. I think we can fix this without changing the deeply embedded syntax, by compiling def name.{u} into a function def name : (u : Nat) → CheckedDef ..; in other words, replace internal universe polymorphism with an external definition schema. However, this is currently a little tricky: we require that the maximum universe appearing within any subterm of a well-formed term be bounded by univMax. Given an arbitrary u, there is no reason why that should hold. The schema should really then be def name : (u : Nat) → Constraints u → CheckedDef .. where Constraints u is a set of linear constraints on u that guarantee the output is well-formed. This sounds annoying to implement and use (c.f. Rocq) and I'd rather maybe just get rid of the global univMax : Nat, replacing it by an operation univMax : Expr → Nat that produces the maximal universe appearing in a given expression.

Metadata

Metadata

Assignees

Labels

C-metaComponent: user-facing notation, typechecker, tacticsI-highImpact: high

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions