Skip to content

Add several is_known methods for characteristic and is_perfect#2270

Merged
lgoettgens merged 3 commits into
masterfrom
mh/is_known
Jan 8, 2026
Merged

Add several is_known methods for characteristic and is_perfect#2270
lgoettgens merged 3 commits into
masterfrom
mh/is_known

Conversation

@fingolfin
Copy link
Copy Markdown
Member

@fingolfin fingolfin commented Jan 2, 2026

  • Merge characteristic docstrings (moved to Merge characteristic docstrings #2271)
  • Implement is_known(characteristic, ::NCRing)
  • Implement is_known(is_perfect, ::Field)
  • Implement is_known(is_finite, ::NCRing)
  • Remove incorrect characteristic(R::ResidueField) method

Extracted from PR #1996

Comment thread src/ResidueField.jl Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 2, 2026

Codecov Report

❌ Patch coverage is 39.21569% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.22%. Comparing base (bcc2923) to head (74b7ac6).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/Rings.jl 40.00% 3 Missing ⚠️
src/NCPoly.jl 0.00% 2 Missing ⚠️
src/generic/SparsePoly.jl 0.00% 2 Missing ⚠️
src/AbsMSeries.jl 50.00% 1 Missing ⚠️
src/Fraction.jl 50.00% 1 Missing ⚠️
src/FreeAssociativeAlgebra.jl 0.00% 1 Missing ⚠️
src/LaurentPoly.jl 0.00% 1 Missing ⚠️
src/MatRing.jl 50.00% 1 Missing ⚠️
src/NumFields.jl 0.00% 1 Missing ⚠️
src/Poly.jl 50.00% 1 Missing ⚠️
... and 17 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2270      +/-   ##
==========================================
- Coverage   88.30%   88.22%   -0.08%     
==========================================
  Files         126      126              
  Lines       31784    31798      +14     
==========================================
- Hits        28068    28055      -13     
- Misses       3716     3743      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lgoettgens
Copy link
Copy Markdown
Member

Since a large chunk of this is #2271, I am waiting for a rebase before looking at the changes here

@lgoettgens
Copy link
Copy Markdown
Member

I just rebased this on top of current master to exclude everything from #2271

Comment thread src/FreeAssociativeAlgebra.jl Outdated
is_known(::typeof(characteristic), R::FreeAssociativeAlgebra) = is_known(characteristic, base_ring(R))

is_finite(R::FreeAssociativeAlgebra) = is_trivial(base_ring(R)) || (nvars(R) == 0 && is_finite(base_ring(R)))
is_known(::typeof(is_finite), R::FreeAssociativeAlgebra) = is_known(is_trivial, base_ring(R)) || (nvars(R) == 0 && is_known(is_finite, base_ring(R)))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This (as well as all other isknown(::typeof(is_finite), ...) methods in this PR) are wrong.
If we know that the base ring is not trivial, we know nothing about the FreeAssAlgebra, but this is_known would return true.

Suggested change
is_known(::typeof(is_finite), R::FreeAssociativeAlgebra) = is_known(is_trivial, base_ring(R)) || (nvars(R) == 0 && is_known(is_finite, base_ring(R)))
is_known(::typeof(is_finite), R::FreeAssociativeAlgebra) = (is_known(is_trivial, base_ring(R)) && is_trivial(base_ring(R))) || (nvars(R) == 0 && is_known(is_finite, base_ring(R)) && is_finite(base_ring(R))) || (is_known(is_trivial, base_ring(R)) && !is_trivial(base_ring(R)) && (nvars(R) > 0 || (is_known(is_finite, base_ring(R)) && !is_finite(base_ring(R)))))

(no guarantee of correctness, but I think this is more or less what one needs to do)

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.

You are of course right, argh! This is why I really prefer to have someone review my PRs. Thank you, very embarrassing.

Anyway, I have now removed the is_finite part of this PR, and will resubmit it separately, but it shouldn't hold up the other changes.

To fix things, I am contemplating introducing internal helpers is_known_to_be_trivial, is_known_to_be_nontrivial, is_known_to_be_finite, is_known_to_be_infinite or so (or maybe... is_known_to_be(is_finite, R), is_known_to_be(!is_finite, R), ... ????)

@lgoettgens lgoettgens merged commit af5e9c0 into master Jan 8, 2026
21 of 23 checks passed
@lgoettgens lgoettgens deleted the mh/is_known branch January 8, 2026 15:42
@lgoettgens lgoettgens added enhancement New feature or request release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Jan 9, 2026
@lgoettgens lgoettgens changed the title Add several is_known methods Add several is_known methods for characteristic and is_perfect Jan 9, 2026
fingolfin referenced this pull request Jan 9, 2026
Co-authored-by: Lars Göttgens <lars.goettgens@rwth-aachen.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants