Skip to content

feat: add Function.prod and Function.diag#37631

Open
linesthatinterlace wants to merge 12 commits intoleanprover-community:masterfrom
linesthatinterlace:function_prod
Open

feat: add Function.prod and Function.diag#37631
linesthatinterlace wants to merge 12 commits intoleanprover-community:masterfrom
linesthatinterlace:function_prod

Conversation

@linesthatinterlace
Copy link
Copy Markdown
Collaborator

This PR adds Function.prod and Function.diag and develops API for them and Pi.prod.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

PR summary f51efbe0b8

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
There are 6500 files with changed transitive imports taking up over 290232 characters: this is too many to display!
You can run ci-tools/scripts/pr_summary/import_trans_difference.sh all locally to see the whole output.

Declarations diff

+ comp_prod_comp
+ const_prod
+ diag
+ diag_apply
+ diag_eq_iff
+ diag_prod_diag
+ exists_diag_apply_iff
+ fst_diag
+ injective_diag
+ leftInverse_uncurry_prod_prod_fst_comp_snd_comp
+ map_comp_diag
+ map_comp_prod
+ map_diag
+ prodMap
+ prodMap_eq_prod_map
+ prod_comp
+ prod_comp_prod
+ prod_ext
+ rightInverse_uncurry_prod_prod_fst_comp_snd_comp
+ snd_diag
++ eq_prod_iff_fst_comp_snd_comp
++ eq_prod_of_fst_comp_snd_comp
++ exists_fst_comp
++ exists_prod_apply_eq
++ exists_snd_comp
++ fst_comp_prod
++ fst_prod
++ prod_apply
++ prod_const_const
++ prod_eq_iff
++ prod_ext_iff
++ prod_fst_snd_comp
++ snd_comp_prod
++ snd_prod
+-+ prod
-++ prod_fst_snd
-++ prod_snd_fst

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).

@github-actions github-actions bot added the t-logic Logic (model theory, etc) label Apr 4, 2026
@grunweg grunweg changed the title feat: Add Function.prod and Function.diag feat: add Function.prod and Function.diag Apr 4, 2026
Copy link
Copy Markdown
Collaborator

@SnirBroshi SnirBroshi left a comment

Choose a reason for hiding this comment

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

This looks very cool!

variable {α β γ δ : Type*} {ι : Sort*}

/-- The map into a product type built from maps into each component. -/
protected def prod : (ι → α) → (ι → β) → ι → α × β := (· ▽' ·)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Question:
I don't understand why we need both Pi.prod and Function.prod. Can't we have just the general version (Pi.prod)? (Related: #36902)
If the issue is dot notation, then it's worth mentioning that leanprover/lean4#1629 had some progress recently.

/
c - - - a
/
c - - - a
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 change is surely out of scope

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

Labels

t-logic Logic (model theory, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants