analysis icon indicating copy to clipboard operation
analysis copied to clipboard

Instances for dependent function types

Open Tragicus opened this issue 1 year ago • 3 comments

Motivation for this change

Generalizes the instances on function types to dependent function types. The same generalization is happening in mathcomp (see https://github.com/math-comp/math-comp/pull/1256) and it needs to be done here first for backwards compatibility. EDIT: WIP because we are waiting for unification features in Coq that make unifying dependent functions work.

Checklist
  • [ ] added corresponding entries in CHANGELOG_UNRELEASED.md
  • [ ] added corresponding documentation in the headers

Reference: How to document

Reminder to reviewers

Tragicus avatar Nov 05 '24 15:11 Tragicus

I observe that this PS shares similarities with PR https://github.com/math-comp/analysis/pull/1379 while the latter is marked as draft. Maybe you intended this one as well to be a draft?

affeldt-aist avatar Nov 06 '24 14:11 affeldt-aist

What is the justification for the mandatory addition of constants for the application of blah_cst lemmas? Do we know where the problem comes from?

cst is not dependent (and can not be), so I can not define the operations on dependent functions using it. Then, when Rocq tries to unify cst ?c with 1 : U -> V, it reduces the problem to fun=> ?c = fun t : U => GRing.one ((fun=> V) t) and then to ?c = GRing.one ((fun=> V) t). This fails because ?c can not use t in its instantiation. I believe I have a solution for that, but it needs to be integrated into Coq, so it will take some time, and the impact looks minor according to the CI.

Tragicus avatar Nov 06 '24 15:11 Tragicus

I extracted this from the other PR and extended it when I realized I needed to generalize things here first. It is ready for review.

Tragicus avatar Nov 06 '24 15:11 Tragicus