Sitelet https://github.com/math-comp/math-comp/pull/1642
Skip to content

Add algebraic_hierarchy.v and numeric_hierarchy.v, and deprecate ssralg.v and ssrnum.v - #1642

Open
pi8027 wants to merge 1 commit into
masterfrom
uniformise-reexport-files
Open

pi8027 wants to merge 1 commit into
masterfrom
uniformise-reexport-files

Conversation

@pi8027

@pi8027 pi8027 commented Aug 26, 2026 •

Copy link
Copy Markdown
Member
Motivation for this change

This is the remaining work from #1582.

Closes #1505

Closes #1557

The difference between ssralg.v and algebraic_hierarchy.v:

  • [added] the latter reexports countalg.v, finalg.v, and ring_quotient.v (because this PR moves them to algebraic_hierarchy/)
  • [removed] the latter does not reexport nmodule.v (because it belongs to the boot package)
  • [removed] the latter does not contain the deprecated definitions from ssralg.v

The difference between ssrnum.v and numeric_hierarchy.v:

Dependency
Overlay
Minimal TODO list
  • added changelog entries with doc/changelog/make-entry.sh
  • added corresponding documentation in the headers
  • tried to abide by the contribution guide
  • this PR contains an optimum number of meaningful commits

See this Checklist for details.

Automatic note to reviewers

Read this Checklist.

@pi8027
pi8027 requested a review from proux01 August 26, 2026 16:20
(* Ring-like structures *)
(* *)
(* This file re-exports the contents of rings_modules_and_algebras.v, *)
(* divalg.v, decfield.v, countalg.v, finalg.v, and ring_quotient.v: *)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

according to the above:

Suggested change
(* divalg.v, decfield.v, countalg.v, finalg.v, and ring_quotient.v: *)
(* divalg.v, decfield.v, countalg.v and finalg.v: *)

but maybe it would be easier to say "the content of the algebraic_hierarchy directory". I observed that these header comments tend to become easily inaccurate with time.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

IMO, the idea is rather to use the header doc of algebra_hierarchy.v as the general description of the files in the directory (like order.v).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(In addition, maybe we could have one line README.md in each directory saying something like "look at [order.v]")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

And indeed, I forgot to export ring_quotient here. Fixed.

Comment thread algebra/algebraic_hierarchy/ssralg.v Outdated
@proux01

proux01 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor
* [added] the latter reexports `countalg.v`, `finalg.v`, and `ring_quotient.v` (because this PR moves them to `algebraic_hierarchy/`)

Do we really want to do that? These are maybe not of such general use but adding them could make the Require command significantly slower (haven't benchmarked though).

* [removed] the latter does not contain the deprecated definitions from `ssralg.v`

Still not a big fan of this mixing between file renaming and deprecations removal (it just makes the renaming harder for users). However, see my comments for mitigation recommendations.

@pi8027

pi8027 commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

[added] the latter reexports countalg.v, finalg.v, and ring_quotient.v (because this PR moves them to algebraic_hierarchy/)

Do we really want to do that? These are maybe not of such general use but adding them could make the Require command significantly slower (haven't benchmarked though).

I suggest discussing this point in a meeting. Perhaps the general recommendation for users should be to import only what they need (most of the time only rings_modules_and_algebras and divalg I guess).

@pi8027

pi8027 commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

By the way, I don't think it's very useful to review this PR in detail before merging #1560.

@proux01

proux01 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

I was just reacting to

pi8027 requested a review from proux01 20 hours ago

above (but maybe these are automatic, I never really mastered them).

@pi8027
pi8027 force-pushed the uniformise-reexport-files branch 3 times, most recently from 7b721cf to 870daf7 Compare August 27, 2026 15:50
Comment thread algebra/ring_tactic.v Outdated
From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq nmodule.
From mathcomp Require Import preorder.
From mathcomp Require Export ssralg.
From mathcomp Require Import rings_modules_and_algebras divalg.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@proux01 Do you know why ssralg was exported here and also in field_tactic.v? (It looks like we need to turn them into Import to fix some breakages in CI.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Or we need to export decfield here, even though it is not needed here. Otherwise Import GRing.Theory doesn't import the right GRing.Theory module.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, now I see that not exporting ssralg here breaks hmap_ops.v in the graph-theory library because it imports ring_tactic but not rings_modules_and_algebras, and it cannot find the semiring instance on nat. I think the right fix is to explicitly import rings_modules_and_algebras there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree, graph-theory should be fixed (overlay to merge before the current PR).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I decided to revert the change and suppress the warning since I'm not going to write the overlay.

Comment thread field/falgebra.v
@pi8027
pi8027 force-pushed the uniformise-reexport-files branch from 870daf7 to dda0abf Compare August 28, 2026 11:27
@pi8027
pi8027 force-pushed the uniformise-reexport-files branch 2 times, most recently from b3062fa to 9f04928 Compare September 15, 2026 12:10
@pi8027
pi8027 force-pushed the uniformise-reexport-files branch from 9f04928 to 22b3107 Compare September 24, 2026 13:40
@pi8027

pi8027 commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

CI green. This PR is ready.

@pi8027 pi8027 linked an issue Sep 30, 2026 that may be closed by this pull request
@pi8027
pi8027 requested a review from CohenCyril October 2, 2026 09:22

This branch has not been deployed

No deployments
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.

naming in algebra Uniformize the name of the re-exportation files

2 participants