feat: generalized Kronecker delta definition#1192
Conversation
|
Thank you for this PR, which will now be reviewed. If you are submitting to ./PhyslibAlpha there will be a lighter review process, If you want to bring attention to this PR, please write a message on this |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a Lean definition of the generalized Kronecker delta (as a determinant of a matrix of Kronecker deltas) to the existing KroneckerDelta development.
Changes:
- Introduces a new “Generalized Kronecker delta” section with brief module documentation.
- Defines an integer-valued entry function
δℤfrom the existingkroneckerDelta. - Defines
generalizedKroneckerDeltaasMatrix.det (δℤ (μ i) (ν j)).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Also some build issue here maybe down to a lack of an import? |
Co-authored-by: Joseph Tooby-Smith <72603918+jstoobysmith@users.noreply.github.com>
Co-authored-by: Joseph Tooby-Smith <72603918+jstoobysmith@users.noreply.github.com>
jstoobysmith
left a comment
There was a problem hiding this comment.
I've approved and, assuming this builds, I will merge when ready. Many thanks for this PR - hopefully the first of many :).
|
Actually this is not going to build (just checked the linters). Could you make sure |
Likely still needs the import: but untested locally as of yet. |
|
This now builds without errors, and the remaining |
|
@wdconinc Nice! Weird that that simp argument is now triggering - would you mind fixing it here? |
|
I have put the |
|
This looks good with me. Happy for me to merge @wdconinc? |
|
Yes, fine to merge. I was waiting for CI confirmation before removing the awaiting tag. |
This is my first small definitional PR on the way to proving the gamma matrix trace identities in QFT, part assisted by AI and as part of a general Lean learning trajectory:
Review map:
This PR only changes Physlib/Mathematics/KroneckerDelta.lean (where the 1D Kronecker delta is already), and adds the definition of the generalized Kronecker delta. Due to the sign, this must be over ℤ, not just ℕ.
Due to this being inside Physlib, I'm using a d = 3 default spatial dimensions.Indices can be any finite type with decidable equality.Future work:
I'm hoping to extend this gradually (potentially putting some things in PhyslibAlpha) with additional proofs.
and the associated contraction identities (based on
generalizedKroneckerDelta_contraction)and the associated identities.
The heavy lift is the generalized Kronecker delta contraction identity which relies on Laplace expansion (cofactor expansion) and I couldn't find a lot of pre-existing functionality in mathlib. I'm not happy with that and hope to figure out a more compact proof.
AI disclosure
This particular definition is minor enough and has been modified a few times by me (e.g. to prefer ℤ over ℝ, and to reuse the existing definition), but it originates in an AI session. The pitfalls addressed in the AI instructions in #1187 are relevant (i.e. AI reinventing stuff that's already in mathlib).