Skip to content

How about making _|_ a record instead of a datatype? #192

@gallais

Description

@gallais

The notion of divisibility is defined using a datatype which makes it
impossible to pattern match against a proof that m | n in a let-binding.

I suggest using the following record-based definition instead:

record _∣_ (m n : ℕ) : Set where
  constructor divides
  field quotient :equality : n ≡ quotient * m

However this will break some proofs: for some reasons m and n were not
declared as parameters of _|_ but rather as indices. This means that the
divides constructor was carrying them as implicit arguments and this is used
in the standard library (see e.g. ∣-antisym).

Any opposition to the breaking change?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions