feat: add Function.{prod,diag,fstComp,sndComp,prodMap}#37631
feat: add Function.{prod,diag,fstComp,sndComp,prodMap}#37631linesthatinterlace wants to merge 31 commits into
Function.{prod,diag,fstComp,sndComp,prodMap}#37631Conversation
PR summary 1b6244ba2a
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Algebra.Notation.Pi.Defs | 71 | 69 | -2 (-2.82%) |
Import changes for all files
| Files | Import difference |
|---|---|
| ../mathlib-ci/scripts/pr_summary/import_trans_difference.sh all | |
| There are 7097 files with changed transitive imports taking up over 317497 characters: this is too many to display! | |
You can run this locally from your mathlib4 directory: |
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
Declarations diff
+ comp_prod_comp
+ const_dcomp
+ const_of_prod
+ const_prod_const
+ dcomp_apply
+ dcomp_assoc
+ dcomp_const
+ dcomp_def
+ dcomp_eq_comp
+ dcomp_id
+ dcomp_prod_dcomp
+ diag
+ diag_apply
+ diag_comp
+ eq_diag_fst_of_fst_eq_snd
+ eq_diag_snd_of_fst_eq_snd
+ eq_prod_iff
+ fstComp
+ fstComp_apply
+ fstComp_diag
+ fstComp_mk
+ fstComp_mk_flip
+ fstComp_prod
+ fstComp_prod_sndComp
+ fstComp_sndComp_ext
+ fstComp_sndComp_ext_iff
+ fst_comp
+ fst_dcomp
+ fst_diag_eq_snd_diag
+ fst_prod_snd
+ id_dcomp
+ id_prod_id
+ injective_diag
+ leftInverse_uncurry_prod_fstComp_prod_sndComp
+ left_eq_of_prod_eq
+ map_comp_diag
+ map_comp_prod
+ prodMap
+ prodMap_apply
+ prodMap_comp
+ prodMap_eq_prod_map
+ prodMap_id
+ prod_comp
+ prod_dcomp
+ prod_def
+ prod_eq_iff
+ prod_inj
+ rightInverse_uncurry_prod_fstComp_prod_sndComp
+ right_eq_of_prod_eq
+ sndComp
+ sndComp_apply
+ sndComp_diag
+ sndComp_mk
+ sndComp_mk_flip
+ sndComp_prod
+ snd_comp
+ snd_dcomp
+ snd_prod_fst
+ swap_comp_diag
+ swap_comp_prod
+ swap_dcomp_prod
+ uncurry_prod_injective
+ uncurry_prod_surjective
+-- prod_fst_snd
-+- prod_snd_fst
You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.
No changes to strong technical debt.
No changes to weak technical debt.
Function.prod and Function.diagFunction.prod and Function.diag
SnirBroshi
left a comment
There was a problem hiding this comment.
This looks very cool!
|
On reflection I have now removed |
- Fix sndComp_apply and sndComp_diag copy-paste bugs (rfl proved trivial restatements of the fstComp versions) - Fix typo in prod docstring; rewrite file-level docstring - Drop redundant prod_dcomp_prod and prod_comp_prod (trivial specializations of prod_dcomp / prod_comp) - Add id_dcomp, dcomp_id, dcomp_assoc - Add const_dcomp, dcomp_const - Add prodMap_id - Tighten prodMap docstring
Function.prod and Function.diagFunction.{prod,diag,fstComp,sndComp,prodMap}
|
The large import thing here seems to just be importing Alias. |
|
This PR does way too many unrelated things in one PR, and I object to some of these. Moreover, many of these changes add new things to very basic files, without any discussion/received support via Zulip. Please discuss these changes (new definitions, new notation) on Zulip first, and implement if there is some support. Also link to these Zulip discussions in the top comment.
I think the best way forward is to close this PR, and make separate PRs for the pieces (after general Zulip approval). |
|
My intention was not to have this merged without Zulip discussion, but I wanted to get it to a state where I felt that it was ready for discussion. I suppose I should have marked this WIP to make that clear, but I wasn't sure if that label was still used. I'll start a thread there soon. The original motivation was that I keep wanting a compact notation for |
843809f to
3da5cd3
Compare
|
Yes, the |
|
Ah, I think fundamentally I thought that PRs were considered WIP until active review was sought. I'll make sure my other ones reflect that. |
That used to be the case (and many new contributors' PRs were sitting not-on-the-queue because of the opposite misunderstanding). In July 2024, the default was changed. |
|
This PR/issue depends on:
|
Adds
Mathlib/Logic/Function/Init.lean, centralising a cluster of general-purpose function operations in theFunctionnamespace:Function.dcomp(notation∘') — dependent composition, moved here fromMathlib/Logic/Function/Defs.lean.Function.prod(notation⋏) — pointwise pair of two (possibly dependent) functions,(f ▽ g) i = (f i, g i).Function.fstComp/Function.sndComp— the two components of a function valued in a product; inverse toFunction.prod.Function.diag(notation△) — the diagonala ↦ (a, a).Function.prodMap— dot-notation alias forProd.map; collapses toProd.mapundersimpso existing API applies unchanged.Pi.prodis removed in favour ofFunction.prod(which is itself the dependent version); a deprecated alias is provided.The file depends only on
Mathlib.Init(andBatteries.Tactic.Aliasfor the deprecated alias) so it can be upstreamed to Batteries / core without pulling mathlib dependencies.Pi.prodtoFunction.prod#38963