Skip to content

Conversation

@pirapira
Copy link

@pirapira pirapira commented Dec 10, 2025

This PR enables grind to notice _ mod n is identity if n is bigger than the argument.

This PR was developed a part of Italean2025 project work. I want to add grind annotations on ZMod.val. First I want this annotation on %.

@pirapira pirapira changed the title need help: Add grind_pattern on Nat.mod_eq_of_lt feat: Add grind_pattern on Nat.mod_eq_of_lt Dec 10, 2025
@pirapira pirapira changed the title feat: Add grind_pattern on Nat.mod_eq_of_lt feat: grind_pattern mod_eq_of_lt Dec 10, 2025
@pirapira pirapira marked this pull request as ready for review December 10, 2025 14:29
@pirapira pirapira requested a review from kim-em as a code owner December 10, 2025 14:29
@pirapira pirapira marked this pull request as draft December 10, 2025 15:27
@pirapira pirapira marked this pull request as ready for review December 10, 2025 15:42
@pirapira pirapira marked this pull request as draft December 10, 2025 15:52
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Dec 10, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Dec 10, 2025

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 088f8b0b9cda2195c2ef10a436573c20f776ea29 --onto 19e1fe55f33a8aadc4243da32828b70a4b4677cc. You can force Mathlib CI using the force-mathlib-ci label. (2025-12-10 17:04:07)
  • ✅ Mathlib branch lean-pr-testing-11584 has successfully built against this PR. (2025-12-10 20:28:51) View Log
  • 🟡 Mathlib branch lean-pr-testing-11584 build this PR didn't complete normally. (2025-12-11 07:52:02) View Log
  • ✅ Mathlib branch lean-pr-testing-11584 has successfully built against this PR. (2025-12-11 08:56:10) View Log
  • ✅ Mathlib branch lean-pr-testing-11584 has successfully built against this PR. (2025-12-12 10:23:03) View Log

@leanprover-bot
Copy link
Collaborator

leanprover-bot commented Dec 10, 2025

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 088f8b0b9cda2195c2ef10a436573c20f776ea29 --onto 19e1fe55f33a8aadc4243da32828b70a4b4677cc. You can force reference manual CI using the force-manual-ci label. (2025-12-10 17:04:09)
  • ✅ Reference manual branch lean-pr-testing-11584 has successfully built against this PR. (2025-12-10 19:31:13) View Log
  • 🟡 Reference manual branch lean-pr-testing-11584 build against this PR didn't complete normally. (2025-12-10 19:32:16) View Log
  • ✅ Reference manual branch lean-pr-testing-11584 has successfully built against this PR. (2025-12-11 06:58:57) View Log
  • 🟡 Reference manual branch lean-pr-testing-11584 build against this PR didn't complete normally. (2025-12-11 06:59:56) View Log
  • ✅ Reference manual branch lean-pr-testing-11584 has successfully built against this PR. (2025-12-11 07:54:54) View Log
  • 🟡 Reference manual branch lean-pr-testing-11584 build against this PR didn't complete normally. (2025-12-11 07:56:25) View Log
  • ✅ Reference manual branch lean-pr-testing-11584 has successfully built against this PR. (2025-12-12 09:25:35) View Log
  • 🟡 Reference manual branch lean-pr-testing-11584 build against this PR didn't complete normally. (2025-12-12 09:26:17) View Log

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 10, 2025
@github-actions github-actions bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Dec 10, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Dec 10, 2025
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Dec 10, 2025
@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Dec 10, 2025
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Dec 10, 2025
@kim-em
Copy link
Collaborator

kim-em commented Dec 11, 2025

Tests should go in tests/lean/run/. No need for this test.

I wonder if adding isNotValue b to the guard conditions makes sense. There's no point have this theorem fire because grind sees 1 % 1024. (Not sure about this, isNotValue is brand new and we haven't really explored it yet.)

@kim-em kim-em added the awaiting-author Waiting for PR author to address issues label Dec 11, 2025
@pirapira
Copy link
Author

pirapira commented Dec 11, 2025

I removed the test.

I think I came up with a reasonable way to avoid 2 % 1024 while supporting a % 1024 and 2 % b.

@pirapira pirapira marked this pull request as ready for review December 11, 2025 06:19
@pirapira pirapira marked this pull request as draft December 11, 2025 06:42
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 11, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Dec 11, 2025
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Dec 11, 2025
@pirapira

This comment was marked as outdated.

@pirapira pirapira marked this pull request as ready for review December 11, 2025 06:53
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 11, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Dec 11, 2025
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Dec 11, 2025
@pirapira
Copy link
Author

changelog-library

@github-actions github-actions bot added the changelog-library Library label Dec 12, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 12, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Dec 12, 2025
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Dec 12, 2025
@pirapira

This comment was marked as off-topic.

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

Labels

awaiting-author Waiting for PR author to address issues builds-manual CI has verified that the Lean Language Reference builds against this PR builds-mathlib CI has verified that Mathlib builds against this PR changelog-library Library mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants