Skip to content

Algebra property reexports#2851

Open
Taneb wants to merge 4 commits into
masterfrom
semiring-properties
Open

Algebra property reexports#2851
Taneb wants to merge 4 commits into
masterfrom
semiring-properties

Conversation

@Taneb

@Taneb Taneb commented Oct 29, 2025

Copy link
Copy Markdown
Member
  • Note that a RingWithoutOne is a SemiringWithoutOne
  • Introduce new module Algebra.Properties.SemiringWithoutOne
  • Re-export many algebraic properties (appropriately renamed) into the property files for larger algebraic structures, including all the new semigroup properties for semirings, both for addition and multiplication

@Taneb

Taneb commented Oct 29, 2025

Copy link
Copy Markdown
Member Author

Ah - this is failing, in part because I assumed that what I was calling +-cancelʳ (specialization of Properties.Semigroup.cancelʳ to addition) matches the preexisting +-cancelʳ (addition is right cancellative). There needs to be some rethinking of names here.

@jamesmckinna

jamesmckinna commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator

Ah - this is failing, in part because I assumed that what I was calling +-cancelʳ (specialization of Properties.Semigroup.cancelʳ to addition) matches the preexisting +-cancelʳ (addition is right cancellative). There needs to be some rethinking of names here.

See also #2654 ... I think there this is (yet another) instance of systematic clash of different authors' mental models of what the qualifiers denote... ?

Er, no. It's because we accepted the Algebra.Properties.Monoid.cancel* in #2692 without thinking through the consequences wrt Cancellative operations. Sigh.

@jamesmckinna jamesmckinna left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made (frankly unsatisfactory) suggestions as to how to rename things, otherwise I'd simply approve. This all looks like useful refactoring/filling in the hierarchy, but we do need to do something about these cancel lemmas...

Comment thread src/Algebra/Properties/SemiringWithoutOne.agda
Comment thread src/Algebra/Properties/SemiringWithoutOne.agda
Comment thread src/Algebra/Properties/Semiring.agda
Comment thread src/Algebra/Properties/Semiring.agda
Comment thread src/Algebra/Properties/Ring.agda
Comment thread src/Algebra/Properties/Ring.agda
@jamesmckinna

Copy link
Copy Markdown
Collaborator

Actually, I think it might be easier to simply not export the 'offending' names, on the basis that

  • this should guarantee that testing succeeds (?)
  • that this doesn't commit to 'nonsense' names ahead of any refactoring/renaming in Algebra.Properties.Monoid

Thoughts?

@JacquesCarette JacquesCarette left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, this is good. In practice, clearly there are all sorts of problems. Which require non-trivial thinking, which I can't do right now. But will come back to this when I can.

@jamesmckinna

jamesmckinna commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator

In theory, this is good. In practice, clearly there are all sorts of problems. Which require non-trivial thinking, which I can't do right now. But will come back to this when I can.

Hope you manage to find space/time/brainspace to do this... you have far-reaching insights into how to improve Algebra.* general, and stdlib needs them! #2765 etc.

My current thinking about the cancel* properties is that they be renamed to inverse⇒cancel* (I know you don't like long names, but such 'implicational' forms do, at least, reflect the logical structure), and they certainly could be, locally here, in order to not obstruct progress? See #2885 for specimen usage.

@JacquesCarette

Copy link
Copy Markdown
Collaborator

I'm not too adverse to inverse⇒cancel*. It has a degree of "self documentation" that I like, despite its verbosity.

@jamesmckinna

Copy link
Copy Markdown
Collaborator

@Taneb do you want to try to refactor this (via renaming) for v2.4, or mark it as blocking on a PR to rename the Algebra.Properties.Monoid.cancel* lemmas?

@jamesmckinna

jamesmckinna commented Jan 23, 2026

Copy link
Copy Markdown
Collaborator

@Taneb @JacquesCarette what are the interactions between this PR and #2765 ?
What chance of clearing these from the v2.4 docket sooner rather than later?

One reason to do so is that if we (as already agreed) plan breaking changes for v3.0, we could consider any suitable refactoring/renaming there?

@jamesmckinna jamesmckinna mentioned this pull request Jan 23, 2026
@JacquesCarette

Copy link
Copy Markdown
Collaborator

I'm going to try to refocus some of my coding urges back to stdlib. So there's a hope!

@jamesmckinna

Copy link
Copy Markdown
Collaborator

I think it would be good to try to achieve consensus on names, so that this can go through without too much more pain.

@jamesmckinna

Copy link
Copy Markdown
Collaborator

@JacquesCarette @Taneb what's our path forward on this and #2765 ?

@jamesmckinna

jamesmckinna commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

I fixed the whitespace (at least) in order to force re-checking, as the old failing logs were no longer accessible.

And now... a failure arising from Algebra.Properties.BooleanRing? @Taneb Suggest rebasing and proceeding until a 'real' error occurs? This PR seems in a horribly inconsistent state wrt current master...?

@JacquesCarette

Copy link
Copy Markdown
Collaborator

Hopefully we can make progress on this via asynchronous discussion on here. I do have some brainspace for this. But I will need some help to re-figure out what the issues were!

@jamesmckinna

jamesmckinna commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Hopefully we can make progress on this via asynchronous discussion on here. I do have some brainspace for this. But I will need some help to re-figure out what the issues were!

@JacquesCarette My recall is that:

The issue: we need to find new/better names for the cancel properties introduced in #2692 . I've previously made suggestions, either as shims to permit progress on this PR, or more permanently as back-patches for Algebra.Properties.Monoid. But without some consensus, progress is blocked!

Separately, some remedial work (eg rebasing) is also necessary to get past the bitrot aspects...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants