Strengthening by unification › Maybe we already solved this problem… [01KV]
I think there may be a simpler way to deal with strengthening that takes advantage of all the hard work I put into implementing higher-order nested pattern unification in Project Pterodactyl. Suppose we have a term in context x : A, y : B |- t : T and we want to see if this term can be strengthened into the context x:A. Of course, for this to make any sense, we need to see if the type T can be strengthened away from y : B.
To that end, create a global metavariable ?S : (x : A) -> Type. Now attempt to unify ?S x == T in the current context. If there is a solution, then that solution is the strengthening of T away from y. Once we have done this, we may then create a global metavariable ?s : (x : A) -> ?S x and unify ?s x == t. (Of course, if the first unification resulted in any postponements, we must block or insert a coercion.)
Because higher-order nested pattern unification natively respects \eta -equivalence and definitional singletons, it seems to me that it is the ideal solution to the strengthening problem.