Skip to content

Conversation

@linesthatinterlace
Copy link
Contributor

@linesthatinterlace linesthatinterlace commented Oct 24, 2025

This PR adds Std.Tricho r, a typeclass for relations which identifies them as trichotomous. This is preferred to Std.Antisymm (¬ r · ·) in all cases (which it is equivalent to).

@linesthatinterlace linesthatinterlace marked this pull request as draft October 24, 2025 16:11
@linesthatinterlace
Copy link
Contributor Author

@linesthatinterlace linesthatinterlace changed the title feat: Add Std.Tricho feat: Add Std.Tricho Oct 24, 2025
@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 Oct 24, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Oct 24, 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 e71d0abc7ddb2c9da37e91b88fd2be2a903601c7 --onto efbbb0b230ce95653d25b59c83fd24a51a8bf363. You can force Mathlib CI using the force-mathlib-ci label. (2025-10-24 16:55:35)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase e71d0abc7ddb2c9da37e91b88fd2be2a903601c7 --onto 97d63db52cd2fc3353f8a75f48209de0011f1bd3. You can force Mathlib CI using the force-mathlib-ci label. (2025-10-27 11:10:38)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase e71d0abc7ddb2c9da37e91b88fd2be2a903601c7 --onto 106b0fa661d96fd1fa6ff96e2ee5f55f23f307f2. You can force Mathlib CI using the force-mathlib-ci label. (2025-10-30 14:48:12)
  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2025-11-04 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2025-11-04 12:13:09)

@leanprover-bot
Copy link
Collaborator

leanprover-bot commented Oct 24, 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 e71d0abc7ddb2c9da37e91b88fd2be2a903601c7 --onto d3dda9f6d4428a906c096067ecb75e432afc4615. You can force reference manual CI using the force-manual-ci label. (2025-10-24 16:55:36)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-11-04 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2025-11-04 12:13:10)

@datokrat
Copy link
Contributor

!bench

@leanprover-radar
Copy link

leanprover-radar commented Oct 25, 2025

Benchmark results for 6cc5bd3 against e71d0ab are in! @datokrat

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 6cc5bd3.
There were significant changes against commit e71d0ab:

  Benchmark              Metric                    Change
  ================================================================
- iterators (compiled)   wall-clock                  5.6% (39.7 σ)
- stdlib                 grind dsimp                 5.3% (25.5 σ)
- stdlib                 process pre-definitions     1.3% (24.3 σ)
- stdlib                 task-clock                  1.0% (40.2 σ)

@linesthatinterlace linesthatinterlace marked this pull request as ready for review October 25, 2025 17:14
@linesthatinterlace
Copy link
Contributor Author

I will address your comments when I can (I have some work things which may take a little time). Bit worried about the performance hit here but maybe restoring those instances will fix that.

@kim-em kim-em added the awaiting-author Waiting for PR author to address issues label Oct 25, 2025
@datokrat
Copy link
Contributor

datokrat commented Oct 27, 2025

Yes, I find it quite amazing how hard it can be to predict the performance impact of small changes to the typeclass hierarchy. In this case, I'm especially confused by the iterators (compiled) entry: This benchmark does not do any instance synthesis at all. It just runs a compiled program.

Radar (our new speedcenter that is still under development) luckily confirms that at least the specific iterators (compiled) slowdown was a fluke: https://radar.lean-lang.org/repos/lean4/commits/6cc5bd3f9efa1c0f09209fa36923c8b2cac17d7c?parent=e71d0abc7ddb2c9da37e91b88fd2be2a903601c7&s=iterators+

@datokrat
Copy link
Contributor

Note: I slightly edited the PR description to match our changelog convention (removing the -- at the top and removing the newline before the second sentence so that "This is preferred to..." is still visible in the changelog. I did not change anything about the wording.

@datokrat datokrat added the changelog-library Library label Oct 27, 2025
@linesthatinterlace
Copy link
Contributor Author

Other than that one question about restoring instances (where I am concerned that taking a divergent approach with Total/Asymm and Antisymm/Trichotomous could lead to confusion down the line) I have acted on your comments, so (accepting that we still have that one question to resolve) I am going to pass this back.

@linesthatinterlace linesthatinterlace changed the title feat: Add Std.Tricho feat: Add Std.Trichotomous Oct 27, 2025
@linesthatinterlace
Copy link
Contributor Author

Right - apologies for the delay. This is ready for review again I believe.

@datokrat
Copy link
Contributor

Right - apologies for the delay. This is ready for review again I believe.

No problem at all (and my review was also a bit delayed).

@linesthatinterlace
Copy link
Contributor Author

Right, should be all done.

@linesthatinterlace linesthatinterlace changed the title feat: Add Std.Trichotomous feat: This PR adds Std.Trichotomous Nov 5, 2025
@linesthatinterlace linesthatinterlace changed the title feat: This PR adds Std.Trichotomous feat: Add Std.Trichotomous Nov 5, 2025
@linesthatinterlace linesthatinterlace changed the title feat: Add Std.Trichotomous feat: add Std.Trichotomous Nov 5, 2025
@linesthatinterlace
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added awaiting-review Waiting for someone to review the PR and removed awaiting-author Waiting for PR author to address issues labels Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review Waiting for someone to review the PR changelog-library Library 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.

6 participants