Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnose bad coercion #39

Open
wants to merge 2 commits into
base: ps/branch/remove_workaround_for_coq_coq_8994
Choose a base branch
from

Conversation

gio256
Copy link

@gio256 gio256 commented Feb 19, 2024

Related to #1807.

So far I've been able to remove all the primed fields except cate_fun'. Declaring the method of the typeclass directly as the corecion CatEquiv >-> Hom makes at least one proof in Homotopy/ExactSequence.v hang.

Steps to reproduce:

  • search and replace cate_fun' to cate_fun in the HasEquivs class declaration in WildCat/Equiv.v.
  • Comment out the definition of cate_fun in WildCat/Equiv.v.
  • Check the proof marked @todo in Homotopy/ExactSequence.v

I'm not sure what the problem is yet, but it might just be that using a typeclass method as a coercion doesn't work well enough to bother with. I'll see if I can't minimize a bug or find a fix still, though.

@gio256
Copy link
Author

gio256 commented Feb 19, 2024

Also still primed are cate_inv', cate_issect', and cate_isretr', but these are more of a design decision I think.

Currently cate_inv' builds only the inverse map b $-> a while cate_inv builds the equivalence b $<~> a. So in contrast to the other redefined fields of HasEquivs, one could reasonably want to use both the primed and unprimed version of all three of these fields, and it's just a question of which version should have a prime on it.

@@ -472,6 +473,7 @@ Proof.
(pequiv_pfiber _ _ (square_pequiv_pfiber _ _ (square_pfib_pequiv_cxfib i f))))^-1*)
(((pfiber2_loops f) o*E (pequiv_pfiber _ _ (square_pfib_pequiv_cxfib i f)))^-1*)
_ (pfib i)).
(** @todo: this proof hangs on Defined when the method cate_fun is directly declared as a coercion CatEquiv >-> Hom *)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely because typeclass resolution is hanging. You can try to see what it is doing with Set Typeclasses Depth 3 and Set Typeclasses Debug. Alternatively, you can use nrefine which is short for notypeclasses refine, this will leave the goals that are typeclasses out. We probably don't need many typeclasses for the goal to be well-typed here anyway. Once you've used nrefine or snrefine for the simple variant which doesn't hide goals that can be inferred, you can resolve the typeclass proofs with 1: exact _..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants