Skip to content

[ add/DRY ] Ex falso-type eliminator for irrelevant instances of irreflexive 'equality' #2929

Description

@jamesmckinna

Having turned my focus to making certain relational arguments irrelevant in eg. Data.Fin.Base (#2783 #2790 cf. #2787 ), I observe a frequently-occurring pattern of reasoning, usually at the base case, where an 'irreflexive' argument of type 0 ≢ 0 ends up being eliminated via contradiction refl.

In order to make such arguments valid when such arguments are marked as irrelevant then requires such proofs to be modified, in-place, to use the new contradiction-irr introduced in #2785 .

This is all a bit annoying, esp. from a DRY point of view, when it seems as though we could add once and for all,

  • ¬[x≢x] : ∀ {w} {Whatever : Set w} →.(x ≢ x) → Whatever in Relation.Binary.PropositionalEquality.Core, encapsulating the use of contradiction-irr in a single place
  • (optional) ¬[x≉x] : ∀ {w} {Whatever : Set w} → .(x ≉ x) → Whatever in Relation.Binary.Properties.Setoid by delegation to the above, via reflexive

and hence replace all the existing contradiction refl-like arguments with appeals to ¬[x≢x] instead.

Cons:

Pros:

  • subtle/slight streamlining of the dependency graph wrt import of Relation.Nullary.Negation.Core
  • slight/subtle improvement in the abstraction wrt proofs, esp. being agnostic wrt relevance/irrelevance
  • what else?

Suggestions as to names might also be welcome ;-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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