agda-stdlib icon indicating copy to clipboard operation
agda-stdlib copied to clipboard

Add properties of the quotient to Data.Nat.Divisibility

Open Taneb opened this issue 3 years ago • 2 comments

I'd like there to be certain properties of the quotient of a proof of divisibility, for example:

foo : ∀ {m n} → (m∣n : m ∣ n) → quotient m∣n ∣ n
bar : ∀ {m n} (m∣n : m ∣ n) → m > 1 → quotient m∣n < n

I can't think of good names for these though

Taneb avatar Feb 10 '22 09:02 Taneb

How about: quotient-| and quotient-<? or else *-divides, *-less-than?

jamesmckinna avatar Feb 10 '22 15:02 jamesmckinna

I like quotient-| and quotient-<, better to include the name of the functions involved.

MatthewDaggitt avatar Feb 11 '22 10:02 MatthewDaggitt

Did we do this?

jamesmckinna avatar Oct 29 '22 18:10 jamesmckinna

Nope. Still open.

MatthewDaggitt avatar Oct 30 '22 02:10 MatthewDaggitt

In the spirit of #1969 you probably also want

baz : ∀ {m n} (m∣n : m ∣ n) → m > 1 → n > m → quotient m∣n > 1

as, say, quotient>1? (the cognate quotient->1 by analogy with the above names, has a bad -> internal symbol clash...)

... and for bar do you also need .{{NonZero n}} as an assumption?

jamesmckinna avatar Oct 25 '23 04:10 jamesmckinna

And as a last thought: with the addition of quotient≢0 : .{{NonZero n}} → NonZero quotient to the _∣_ API, a number of arguments about involving possibly-zero quotients might (hopefully) be automatically simplifiable by the typechecker, eg. eliminating this case from Data.Nat.Primality.euclidsLemma

jamesmckinna avatar Oct 26 '23 07:10 jamesmckinna