Zulip Chat Archive

Stream: mathlib4

Topic: Splitting Topology/Homeomorph


Michael Rothgang (Mar 06 2025 at 13:26):

In #22137, I would like to use IsInducing (Sum.swap X Y) inside Topology/Constructions.lean, to deduplicate a proof.
However, the easiest way to prove this statement is to use Homeomorph.sumComm, which is defined further downstream in Homeomorph.lean.
Hence, from this PR's point of view, it would be nice to split Homeomorph.lean, for instance

  • splitting out a file just for the basic definitions (which should have less imports than Topology/Constructions.lean, hence can be imported there)
  • defining the homeomorphisms between various constructions in that file, including mine

I know @Yaël Dillies has been unhappy about Homeomorph.lean for a long time. Does that seem like a useful step?

To be clear: in my PR, the duplication is perhaps 5 lines (so not worth boiling the ocean for) --- on the other hand, the argument I was going at seems like a fairly natural one, so I wouldn't be surprised if others would try the same.

Yaël Dillies (Mar 06 2025 at 13:27):

Yes, that's exactly what I would like to see happen :smile:

Michael Rothgang (Mar 07 2025 at 09:27):

#22681 is the first step of this (and should be ready for review - perhaps one or two fixes will be needed, but nothing essential).

Michael Rothgang (Mar 07 2025 at 09:28):

#22682 builds on this, and collects all material about sum, products and their distributivity in one file. That one still needs a bit of clean-up of the module doc-strings.

Anne Baanen (Mar 07 2025 at 09:45):

(I recall a previous discussion on this topic having some pushback against splitting Homeomorph.lean since it was convenient to have all the properties preserved by homeomorphisms available without thinking about imports. But I can't find evidence of that discussion. In any case from my outsider perspective I would be glad to see this knot in our import tangle worked out.)

Michael Rothgang (Mar 07 2025 at 11:09):

Sure, that is a point I can understand. I'm not sure if this is currently followed, though: does that file really contain all properties preserved homeomorphisms?

Michael Rothgang (Mar 07 2025 at 11:09):

In any case, this does not speak against #22681: importing Homeomorph.Lemmas after that PR still gets you everything you had before (so no real harm done), but downstream files have a choice now (a win in my book).

Kim Morrison (Mar 10 2025 at 23:59):

@Michael Rothgang, there's a merge conflict on #22681 at present.

Aaron Liu (Mar 11 2025 at 00:09):

fixed it

Michael Rothgang (Mar 11 2025 at 11:46):

The next PR in that sequence is #22827 (CI is still running, but will hopefully pass now)


Last updated: May 02 2025 at 03:31 UTC