Skip to content

Remove reversible coercions throughout the library #2264

@patrick-nicodemus

Description

@patrick-nicodemus

A record projection marked as :> declares it as a "reversible coercion" in the absence of further annotations: https://rocq-prover.org/doc/V9.0.0/refman/addendum/implicit-coercions.html#reversible-coercions

In a recent PR I changed all record projections from Coercion to :> because the syntax is more concise and I wanted to eliminate the boilerplate. There was only one breakage due to this change: if equiv_fun : Equiv >-> Funclass is declared reversible, then

(** The classifying space functor and the fundamental group functor form an adjunction ([pType] needs to be restricted to the subcategory of 0-connected pointed types). Note that the full adjunction should also be natural in [X], but this was not needed yet. *)
Theorem equiv_bg_pi1_adjoint `{Univalence} (X : pType)
  `{IsConnected 0 X} (G : Group)
  : (Pi 1 X $-> G) <~> (X $-> B G).
Proof.
  rapply natequiv_bg_pi1_adjoint.
Defined.

the rapply spins indefinitely when it tries to solve refine (natequiv_bg_pi1_adjoint _). Replacing it with

Definition equiv_bg_pi1_adjoint `{Univalence} (X : pType)
  `{IsConnected 0 X} (G : Group)
  : (Pi 1 X $-> G) <~> (X $-> B G).
  := natequiv_bg_pi1_adjoint _ _.

solves the problem.

Is this a change we should make? The syntax is more concise but I'm concerned that all these reversible coercions might add complexity to unification. On the other hand there was only one breakage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions