ok so i've been hitting my head against universe errors for three days and i need to talk about it with people who understand my pain 😭🐱
let me set the scene. Rocq (yes i'm using the new name, deal with it) is based on the predicative Calculus of Inductive Constructions (pCIC). The hierarchy is built from an impredicative sort Prop and an infinite tower of predicative Typei universes. This is actually really elegant on paper but in practice? Crimes. Crimes everywhere.
The classic crime: trying to self-apply the identity function.
By default, constant declarations are monomorphic — the identity function declares a single global universe identity.u0 for its domain. Trying to pass @identity to itself requires identity.u0+1 ≤ identity.u0, which is obviously impossible. A universe variable would need to be less than itself in the hierarchy — instant inconsistency.
The fix: Set Universe Polymorphism (or prefix with Polymorphic). This lets definitions bind their own local universe variables instead of polluting the global constraint graph.
Now my actual question: I'm building a generic container that needs to work at multiple universe levels, and I keep running into headaches when mixing polymorphic and monomorphic code. What are your strategies for avoiding the pain? Do you just slam Set Universe Polymorphism. at the top of every file and pray? 😿