Skip to content

[Merged by Bors] - feat(ModelTheory): Semilinear sets are closed under intersection, difference and complement - #27414

Closed
staroperator wants to merge 42 commits into
leanprover-community:masterfrom
staroperator:semilinear_nat
Closed

staroperator wants to merge 42 commits into
leanprover-community:masterfrom
staroperator:semilinear_nat

Conversation

@staroperator

@staroperator staroperator commented Jul 24, 2025 •

Copy link
Copy Markdown
Collaborator

Separated from #27100. This PR proves that semilinear sets in any commutative monoid are closed under intersection, set difference and complement (requires finitely generated). We prove these results on ℕ ^ k first (which are private) and then generalize to any monoid.


Open in Gitpod

@github-actions

github-actions Bot commented Jul 24, 2025 •

Copy link
Copy Markdown

PR summary 57ecfb93a1

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.ModelTheory.Arithmetic.Presburger.Semilinear.Basic (new file) 10

Declarations diff

+ to

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 24, 2025
@staroperator staroperator added the t-logic Logic (model theory, etc) label Jul 24, 2025
@staroperator staroperator changed the title feat(ModelTheory): Semilinear sets in ℕ are closed under intersection and complement feat(ModelTheory): Semilinear sets in ℕ ^ k are closed under intersection and complement Aug 5, 2025
@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 11, 2025
@mathlib4-merge-conflict-bot

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 27, 2025
@mathlib4-merge-conflict-bot

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 28, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 17, 2025
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 19, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 19, 2025
@staroperator
staroperator force-pushed the semilinear_nat branch 2 times, most recently from 3edeb9d to 653e1dd Compare September 21, 2025 21:36
@staroperator
staroperator force-pushed the semilinear_nat branch 2 times, most recently from f9edb48 to 6d85ad4 Compare September 22, 2025 14:34
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 22, 2025
@staroperator
staroperator force-pushed the semilinear_nat branch 2 times, most recently from 5da2ed6 to e55f1fc Compare September 23, 2025 23:35
@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2025
@mathlib4-merge-conflict-bot

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2025
@YaelDillies YaelDillies added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 19, 2025
@staroperator staroperator added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Nov 22, 2025
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Nov 22, 2025
@YaelDillies YaelDillies added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 22, 2025
staroperator and others added 2 commits November 22, 2025 13:30

@YaelDillies YaelDillies left a comment

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.

Thanks!

maintainer delegate

Comment on lines +620 to +621
classical
haveI := Fintype.ofFinite ι

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.

We have a slight preferrence for

Suggested change
classical
haveI := Fintype.ofFinite ι
cases nonempty_fintype ι

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't work because I need DecidableEq for One (Matrix ι ι ℕ) from classical. The cases nonempty_fintype ι is the same as haveI := Fintype.ofFinite ι

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

BTW, is there a Zulip discussion? I have a strong preference for Fintype.ofFinite.

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 22, 2025
@staroperator staroperator removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 23, 2025

@jcommelin jcommelin left a comment

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.

Thanks 🎉

bors merge

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Nov 24, 2025
mathlib-bors Bot pushed a commit that referenced this pull request Nov 24, 2025
…ference and complement (#27414)

Separated from #27100. This PR proves that semilinear sets in any commutative monoid are closed under intersection, set difference and complement (requires finitely generated). We prove these results on `ℕ ^ k` first (which are private) and then generalize to any monoid.
@mathlib-bors

mathlib-bors Bot commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(ModelTheory): Semilinear sets are closed under intersection, difference and complement [Merged by Bors] - feat(ModelTheory): Semilinear sets are closed under intersection, difference and complement Nov 24, 2025
@mathlib-bors mathlib-bors Bot closed this Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-logic Logic (model theory, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants