Zulip Chat Archive

Stream: mathlib4

Topic: Next steps for BilinForm


Christopher Hoskin (Mar 04 2024 at 21:26):

I've been working on https://github.com/leanprover-community/mathlib4/issues/10553

With the following PRs merged

I think we'd be quite close to being able to deprecate / remove the BilinForm structure.

Regarding #11032, @Eric Wieser asks: https://github.com/leanprover-community/mathlib4/pull/11032#issuecomment-1970146663

Does anything use the old BilinForm files in this PR after this change? I'd be tempted to update them in place to be about LinearMap.BilinForm, so as to keep the history of the file, like we did with the TensorProduct file.

I think this could work for LinearAlgebra/BilinearForm/DualLattice. I'm less sure what to do about LinearAlgebra/BilinearForm/Properties because several of the concepts in that file not touched by #11032 (e.g. IsRefl, IsAlt, IsSymm) already have equivalents in LinearAlgebra/SesquilinearForm. (Not quite the same as commutativity of the semi-ring is required there, also some results are missing e.g. IsAlt.add, IsAlt.smul, IsAlt.neg and IsAlt.sub.)

Any opinions on how we should proceed?

Thanks.

Christopher

Christopher Hoskin (Mar 10 2024 at 14:14):

This is what I've come up with.

Eric Wieser (Mar 10 2024 at 14:22):

One split that looks tempting; I think we should change docs#BilinForm to require CommSemiring R first, as that will collect together all the typeclass changes from that PR

Eric Wieser (Mar 10 2024 at 14:24):

(ah, which we have already as branch#bilinear-form-commutative)

Christopher Hoskin (Mar 10 2024 at 16:56):

@Eric Wieser I've opened https://github.com/leanprover-community/mathlib4/pull/11280

Moritz Doll (Mar 18 2024 at 04:07):

@Eric Wieser @Christopher Hoskin , what are your thoughts on marking everything in the BilinForm folder as deprecated with links to new version. I think we are at a point now where we really don't want to have any new usage of BilinForm and also want to see that all theorems have a counterpart in the new structure.

Christopher Hoskin (Mar 18 2024 at 05:28):

Moritz Doll said:

want to see that all theorems have a counterpart in the new structure.

If https://github.com/leanprover-community/mathlib4/pull/11280 gets approved/merged, then I was thinking that the next step would be to open PRs like https://github.com/leanprover-community/mathlib4/pull/9485 and then see what was left.

@Moritz Doll What is your view of the approach in https://github.com/leanprover-community/mathlib4/pull/11280 ?

Moritz Doll (Mar 18 2024 at 09:55):

I think it is good, I didn't have the time to have a proper look at it, but this is definitively the thing to do

Frédéric Marbach (Apr 08 2024 at 16:04):

Hi. For a project described here (prove that all derivations of a finite dimensional semisimple Lie algebra are inner), I need the lemma restrict_nondegenerate_of_isCompl_orthogonal, which, up to my understanding, was only stated using the old definition of bilinear forms. I pushed #12015 to transfer this statement to the new definition of bilinear forms. I had to put it in a separate file to avoid a dependency cycle. Could any of you take a look or share thoughts about this? Thanks

Christopher Hoskin (Apr 08 2024 at 17:46):

@Frédéric Marbach In the short term, I think the next step is to merge https://github.com/leanprover-community/mathlib4/pull/11278 which will keep all of the existing _root_. BilinForm results but built on top of LinearMap.BilinForm. There'll then be some clean up and consolidation to do.

Frédéric Marbach (Apr 08 2024 at 19:30):

Oh, indeed it looks great and we wouldn't need my modifications. Do you know why #11278 is not merged yet? Is there anything in the way?

Kevin Buzzard (Apr 08 2024 at 19:35):

Probably just because it changes a lot of files, and is several hundred lines long.

Christopher Hoskin (Apr 08 2024 at 19:36):

Possibly @Eric Wieser has been taking a well deserved Easter break - or has been otherwise occupied.

Kevin Buzzard (Apr 08 2024 at 19:49):

Given the 200+ page PhD thesis that landed in my inbox recently, I know he's been very occupied :-)

Oliver Nash (Apr 08 2024 at 20:24):

Rumour has it, he also has a day job.

Frédéric Marbach (Apr 09 2024 at 08:08):

Thanks for preparing this PR and merging!

It seems that there are two definitions of the restriction of a bilinear form to a subspace:

I am running into an issue because two lemmas I need use respectively each of these.

I can prepare a commit to delete one of these definitions and align everything on the remaining one. Which one do you want to keep? Both are used in a small number of places (~5 references each). I would probably lean towards keeping BilinForm.restrict because writing B.restrict W feels more natural to me than W.restrict B, but I don't have much experience!

Eric Wieser (Apr 09 2024 at 08:11):

It looks like the docs have not yet rebuilt with the latest change

Frédéric Marbach (Apr 09 2024 at 08:15):

Well, I linked the docs but both are still in the source code too on the master branch.

Eric Wieser (Apr 09 2024 at 08:42):

Well, thanks for making me notice; the docs builds stop every 60 days, and the last such stop was three days ago! I've set them going again for the next two months :)

Eric Wieser (Apr 09 2024 at 08:43):

And actually, we have three of these definitions, not two!

Eric Wieser (Apr 09 2024 at 08:43):

docs#LinearMap.domRestrict₁₂ is the other one

Frédéric Marbach (Apr 09 2024 at 09:30):

Yes. But this last one is for general bi-semi-linear maps M → N → P, while the previous two were really specific to bilinear forms M → M → R.

I am ready to implement whatever option you think is best concerning these 2/3 definitions.

In the same way that BilinForm is defined as an abbreviation, could we keep one abbreviation for the restriction of a bilinear form to a subspace? B.restrict W feels better to me than B.domRestrict₁₂ W W.

Eric Wieser (Apr 09 2024 at 18:26):

Submodule.restrictBilinear should definitely go, we can think about the other two later

Eric Wieser (Apr 09 2024 at 18:26):

Changing the BilinForm one to an abbrev sounds good to me

Frédéric Marbach (Apr 10 2024 at 12:57):

It is here: #12045. I ran into some unexpected weird problems with flip (for which I have no explanation). I think I found an OK solution after a lot of fiddling. The try-and-test was quite painful because of long compile times (probably messing with files quite low in the hierarchy).

Christopher Hoskin (Apr 12 2024 at 19:28):

I've opened a PR to deprecate a some of the definitions and results which are essentially just the identity following the migration: https://github.com/leanprover-community/mathlib4/pull/12078

Christopher Hoskin (Apr 13 2024 at 22:53):

More deprecations: https://github.com/leanprover-community/mathlib4/pull/12112

What is the rule / convention for how long a result remains in Mathlib before being removed after deprecation?

Frédéric Marbach (Apr 14 2024 at 09:15):

I would indeed very much like to read a page about how the mathlib community approaches versioning/deprecation with respect to third parties.

Christopher Hoskin said:

What is the rule / convention for how long a result remains in Mathlib before being removed after deprecation?

Eric Wieser (Apr 14 2024 at 09:32):

I don't think we really have a policy yet

Yaël Dillies (Apr 14 2024 at 09:59):

I have been removing deprecated lemmas that were on my way for other things. Those were deprecated since they were ported over a year ago.

Michael Rothgang (Apr 14 2024 at 10:12):

Eric Wieser said:

I don't think we really have a policy yet

@Frédéric Marbach think this would be a good conversation to start. My wild guess/impression is that one year is presumably uncontroversial, and something between three and six months could be a likely outcome.

Kim Morrison (Apr 15 2024 at 02:58):

I'd prefer we land in the 3-6 months range. It would be helpful if there's a consistent method for including a date in the deprecated attribute.

Damiano Testa (Apr 15 2024 at 05:19):

Btw, #10864 is a wrapper around @[deprecate] alias that makes the date part of the syntax. If you think that it may be useful, feel free to suggest modifications!

Christopher Hoskin (Apr 30 2024 at 10:03):

I'm inclined to close without merging this PR unless anyone thinks it's still useful?

Michael Rothgang (Apr 30 2024 at 13:41):

Damiano Testa said:

Btw, #10864 is a wrapper around @[deprecate] alias that makes the date part of the syntax. If you think that it may be useful, feel free to suggest modifications!

Since @deprecate in Lean 4.8 allows including a date (in the since field), I think it's easier to just standardise on that.


Last updated: May 02 2025 at 03:31 UTC