Skip to content

[Merged by Bors] - feat: Bird–Wadler duality theorems#35713

Closed
Parcly-Taxel wants to merge 16 commits intoleanprover-community:masterfrom
Parcly-Taxel:birdwadler
Closed

[Merged by Bors] - feat: Bird–Wadler duality theorems#35713
Parcly-Taxel wants to merge 16 commits intoleanprover-community:masterfrom
Parcly-Taxel:birdwadler

Conversation

@Parcly-Taxel
Copy link
Copy Markdown
Collaborator

@Parcly-Taxel Parcly-Taxel commented Feb 24, 2026

Forms of these three theorems already exist in mathlib and the Lean standard library, but they are scattered about. Bring them together in one file, deprecating the ad hoc names for the first and second theorems.

@Parcly-Taxel Parcly-Taxel requested a review from TwoFX February 24, 2026 10:37
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 24, 2026

PR summary 7d9358ee9d

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Data.List.Fold (new file) 54

Declarations diff

+ foldl_cons_eq_apply_foldl
+ foldl_cons_nil
+ foldl_eq_foldr_of_commute
+ foldl_flip_eq_foldr
+ foldr_cons_eq_foldr_apply
+ foldr_flip_eq_foldl

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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).

@Parcly-Taxel Parcly-Taxel added the t-data Data (lists, quotients, numbers, etc) label Feb 27, 2026
Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

I like that this gives us a consistent set of theorems about foldl/foldr. The name for this file is not completely obvious to me: I don't associate foldl_eq_foldr with "Bird-Wadler duality", and the phrase "Bird-Wadler duality" doesn't give me any search results. Maybe Data/List/Fold.lean would be a good name? (This doesn't really apply to the module doc since it has a good explanation of why we use this name.)

@Vierkantor Vierkantor added the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 17, 2026
@Parcly-Taxel Parcly-Taxel removed the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 21, 2026
@Vierkantor Vierkantor added the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 26, 2026
@Parcly-Taxel Parcly-Taxel removed the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 2, 2026
@Parcly-Taxel Parcly-Taxel requested a review from Vierkantor April 2, 2026 01:25
Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes!

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Apr 2, 2026

✌️ Parcly-Taxel can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mathlib-triage mathlib-triage bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Apr 2, 2026
Parcly-Taxel and others added 2 commits April 2, 2026 22:15
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@Parcly-Taxel
Copy link
Copy Markdown
Collaborator Author

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Apr 2, 2026
Forms of these three theorems already exist in mathlib and the Lean standard library, but they are scattered about. Bring them together in one file, deprecating the _ad hoc_ names for the first and second theorems.

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Apr 2, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Bird–Wadler duality theorems [Merged by Bors] - feat: Bird–Wadler duality theorems Apr 2, 2026
@mathlib-bors mathlib-bors bot closed this Apr 2, 2026
@Parcly-Taxel Parcly-Taxel deleted the birdwadler branch April 2, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants