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

AlmostCancellative in Nat.Properties ? #1562

Open
mechvel opened this issue Jul 26, 2021 · 3 comments
Open

AlmostCancellative in Nat.Properties ? #1562

mechvel opened this issue Jul 26, 2021 · 3 comments
Milestone

Comments

@mechvel
Copy link
Contributor

mechvel commented Jul 26, 2021

lib-1.7 has a general notion AlmostLeft(Right)Cancellative,
and it is used in *-cancelˡ-nonZero in IsCancellativeCommutativeSemiring.

On the other hand Nat.Properties has the definitions of kind.

*-cancelʳ-≡ :  ∀ m n {o} → m * suc o ≡ n * suc o → m ≡ n  

It has sense to add there *-cancelˡ-nonZero, *-cancelʳ-nonZero
having types AlmostLeft(Right)Cancellative,
and to add the instances of CancellativeCommutativeSemiring for Nat and Integer.
?

@Taneb
Copy link
Member

Taneb commented Jul 26, 2021

I think this is a good idea. It should probably also be done for Integers and Rationals, if it hasn't already.

@mechvel
Copy link
Contributor Author

mechvel commented Jul 26, 2021

The matter is also in that *-cancel...nonZero does rely on suc.
Many domains have not any sensible suc.

@jamesmckinna
Copy link
Contributor

jamesmckinna commented Sep 25, 2023

I think a useful reconciliation of this proposal with the instances arising for the concrete numerical types might be to systematically add
NonZero num <-> num ≢ 0# lemmas to their Properties, and work outwards from there? Eg towards also fixing #1436...? ... and #1175

... UPDATED or proceed as @JacquesCarette suggested on #1436 by generalising Almost... properties. Then there's a second problem: instances vs. implicit arguments.

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

No branches or pull requests

4 participants