Skip to content

refactor(Tensors): remove pre-Lorentz Contr/Co reps in favour of ContrMod.rep/CoMod.rep#1336

Merged
jstoobysmith merged 2 commits into
leanprover-community:masterfrom
Robby955:refactor/co-contr-cleanup
Jul 1, 2026
Merged

refactor(Tensors): remove pre-Lorentz Contr/Co reps in favour of ContrMod.rep/CoMod.rep#1336
jstoobysmith merged 2 commits into
leanprover-community:masterfrom
Robby955:refactor/co-contr-cleanup

Conversation

@Robby955

@Robby955 Robby955 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Towards #1048.

Implements what's flagged in RealTensor/Vector/Pre/Basic.lean:

  • removes the vestigial Contr/Co representation aliases and replaces every call site with ContrMod.rep/CoMod.rep directly, since Contr d was Rep.of ContrMod.rep (defeq-preserving throughout).

  • dropped a duplicate TopologicalSpace (Contr d) instance that was a verbatim copy of the existing one on ContrMod d.

  • Contr.toCo/Co.toContr (the intertwining maps) are untouched they were already stated against ContrMod.rep/CoMod.rep, not the aliases, so the names survive independently.

One note: the issue text also mentions replacing with Vector/CoVector. Should those be different, higher-level abstractions (Lorentz.Vector d := Fin 1 ⊕ Fin d → ℝ, a plain function type) from ContrMod.rep/CoMod.rep (Representation objects), or is it meant to be an equivalence or a renaming of the same thing? Migrating the Pre/ machinery onto that carrier could be a separate, larger refactor after this. This PR follows what's already flagged in the file, but for now it is the narrower scope not a full closure yet.

…rMod.rep/CoMod.rep

Inline the vestigial `Contr`/`Co` Rep objects (which were just `Rep.of ContrMod.rep`/`Rep.of CoMod.rep`) per the maintainer TODO in RealTensor/Vector/Pre/Basic.lean. Group actions `(Contr d).ρ`/`(Co d).ρ` become `ContrMod.rep`/`CoMod.rep`; monoidal carriers `(X ⊗ Y).V` become module tensors `XMod d ⊗[ℝ] YMod d`; coerced type positions become `ContrMod d`/`CoMod d`. Deletes the dead defs, the TODO, and the duplicate `TopologicalSpace (Contr d)` instance (`ContrMod d` already carries it). All replacements are defeq-preserving; build unchanged at 9113 jobs.
@github-actions

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.

@jstoobysmith jstoobysmith left a comment

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.

Great! Approved! Many thanks

@jstoobysmith jstoobysmith added the ready-to-merge This PR is approved and will be merged shortly label Jul 1, 2026
@Robby955 Robby955 marked this pull request as ready for review July 1, 2026 04:34
@jstoobysmith jstoobysmith merged commit ec66283 into leanprover-community:master Jul 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR is approved and will be merged shortly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants