Skip to content

refactor: Weyl fermions - #1360

Merged
jstoobysmith merged 6 commits into
leanprover-community:masterfrom
jstoobysmith:WeylFermionRefactor
Jul 9, 2026
Merged

refactor: Weyl fermions#1360
jstoobysmith merged 6 commits into
leanprover-community:masterfrom
jstoobysmith:WeylFermionRefactor

Conversation

@jstoobysmith

Copy link
Copy Markdown
Member

Refactoring Weyl fermions. All of the changes with content take place in ../Weyl/Basic.lean (and one or two changes in ../Weyl/Module.lean). Everything downstream of that is just fixing what broke.

Idea here is to improve the naming around Weyl fermions, and to improve the structure of the API.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for this PR, which will now be reviewed. If submitting to ./Physlib or ./QuantumInfo, please see our review guidelines if you are not familiar with the process. You should expect a back and forth with a reviewer before your PR is merged. See also that link for how to add appropriate labels to your PR. The PR will also go through a number of automated checks. You can learn more about these here, including how to run them locally.

If you are submitting to ./PhyslibAlpha there will be a lighter review process, though your PR must still pass the automated checks.

If you want to bring attention to this PR, please write a message on this thread of the Lean Zulip.

Important: If a reviewer adds an awaiting-author label to your PR, once you have addressed the review comments, please remove that label by adding a comment with -awaiting-author. This helps us keep track of reviews.

@nateabr nateabr left a comment

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.

Hi I went through this, very very minor comments but apart from that looks great.

- fromPairT (DualRightHandedWeyl.basis 1 ⊗ₜ[ℂ] DualRightHandedWeyl.basis 0) := by
rw [dualRightMetric_eq_fromPairT, dualRightMetricVal_expand_tmul]
simp

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.

A little unsure about this but the names for the lemma's you've provided above, wont having the declaration as you've written with a dot (eg. dualRightMetric_eq_DualRightHandedWeyl.basis ) automatically register the prefix as namespace within this environment?

Was this your intention? Might be better to use an underscore if not?

∑ i, fromPairT (RightHandedWeyl.basis i ⊗ₜ[ℂ] DualRightHandedWeyl.basis i) := by
rw [rightDualRightUnit_eq_fromPairT, rightDualRightUnitVal_expand_tmul]
rfl

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.

Same issue as my prior comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ugh - good spot! yes this was unintentional, and was down to over use of ctrl-f.

(Btw would help if you could put a awaiting-author label on these PRs after you sent a message, I get too many notifications from GitHub that it is hard to spot the important ones)

@jstoobysmith

Copy link
Copy Markdown
Member Author

awaiting-author

@github-actions github-actions Bot added the awaiting-author A reviewer has asked the author a question or requested changes label Jul 8, 2026
@jstoobysmith

Copy link
Copy Markdown
Member Author

-awaiting-author

@nateabr Fixed these naming errors I believe

@github-actions github-actions Bot removed the awaiting-author A reviewer has asked the author a question or requested changes label Jul 8, 2026
@nateabr

nateabr commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Amazing, I was not able to see any other issues with this, will tag it for another maintainer to have another look :)

@nateabr

nateabr commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

sorryy, the linters failed :(

awaiting-author

@github-actions github-actions Bot added the awaiting-author A reviewer has asked the author a question or requested changes label Jul 9, 2026
@jstoobysmith

Copy link
Copy Markdown
Member Author

-awaiting-author

@nateabr hopefully fixed, merged with master and then fixed errors.

@github-actions github-actions Bot removed the awaiting-author A reviewer has asked the author a question or requested changes label Jul 9, 2026
@jstoobysmith
jstoobysmith requested a review from zhikaip July 9, 2026 07:11

@zhikaip zhikaip left a comment

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.

My concern would be same as @nateabr 's , having LeftHandedWeyl be it's own namespace might led to confusion (I.e. if someone just opens LeftHandedWeyl and RightHandedWeyl and the dual ones then everything just becomes basis)

But if this allows simplification elsewhere and you think it's a good compromise maybe it's worth it, just making sure you've thought this through.

@jstoobysmith

Copy link
Copy Markdown
Member Author

Yeah, I agree this is something that needs to be considered. Though, I think this is a better compromise than having names like leftBasis etc. which I think just get confusing.

@jstoobysmith
jstoobysmith merged commit 871ea98 into leanprover-community:master Jul 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants