Zulip Chat Archive

Stream: mathlib4

Topic: Topology of `ENat`


Etienne Marion (Jul 26 2024 at 10:49):

Hello!
I noticed that there is no topology instantiated for ENat. I need the order topology for a project (neighberhoods of infinity are sets which contain all big enough integers), which makes it a compact space (it's the one-point compactification of Nat). However one could prefer to use the discrete topology instead. My questions are:

  1. Is there a drawback defining one of the instance compared to defining none and always use the topology locally?
  2. If not, could I define the instance with the order topology, or should I use the topology locally?

Peter Nelson (Jul 26 2024 at 11:18):

I did this for my matroid repo - see here. I never got round to PRing it and it’s a few months stale, but I would love to see someone pick it up!

Peter Nelson (Jul 26 2024 at 11:20):

(It was produced by cribbing from the equivalent file for ENNReal)

Peter Nelson (Jul 26 2024 at 11:23):

To answer your question, I think the discrete topology is probably not the right choice. The order topology allows arbitrary sums of terms in ENat to behave correctly with tsum.

Etienne Marion (Jul 26 2024 at 11:42):

Thanks for your answer!

Peter Nelson said:

I did this for my matroid repo - see here.

I only need the very basics, so your file has everything (and much more). However I don't think I will be able to deal with such a huge PR I didn't right. Would it be ok for you if I only PR the very basic results? (for now at least)

Patrick Massot (Jul 26 2024 at 11:58):

I am pretty sure @Dagur Asgeirsson must have done that.

Etienne Marion (Jul 26 2024 at 13:34):

In fact I discovered docs#OnePoint, which has everything I want except T2 instance, which I'm adding now. It makes more sense in what I'm doing, although of course it's the same topology for ENat.

Dagur Asgeirsson (Jul 26 2024 at 14:08):

T2 is certainly already there, the file Mathlib.Topology.Category.LightProfinite.Sequence defines the light profinite set N{}\mathbb{N} \cup \{\infty\} as the one point compactification of N\mathbb{N}. docs#LightProfinite.continuous_iff_convergent proves that a function out of it is continuous iff the corresponding sequence converges to the value at \infty.

Etienne Marion (Jul 26 2024 at 14:19):

This is also in Mathlib.Topology.Compactification.OnePoint as a matter of fact. Anyway I meant the T2 instance in the general case of docs#OnePoint.

Dagur Asgeirsson (Jul 26 2024 at 14:20):

It would make sense to move the MetrizableSpace instance to a different file if you are going to use OnePoint \N without mentioning LightProfinite

Etienne Marion (Jul 26 2024 at 16:28):

(deleted)

Rida Hamadani (Jul 31 2024 at 17:50):

Peter Nelson said:

I did this for my matroid repo - see here. I never got round to PRing it and it’s a few months stale, but I would love to see someone pick it up!

@Joachim Breitner The proof of #15344 will become:

lemma iSup_add (ι : Type*) [Nonempty ι] (f : ι  ) (n : ) :
    ( x, f x) + n = ( x, f x + n) :=
  Monotone.map_iSup_of_continuousAt' (continuousAt_id.add continuousAt_const) <|
    monotone_id.add monotone_const

After porting this, so I suggest not going the route in #15344.

Rida Hamadani (Jul 31 2024 at 18:49):

One option is to make #15344 depend on #15380, which is a partial port of Peter's code, just enough to make the proof above work.

Joachim Breitner (Jul 31 2024 at 18:54):

Thanks, that's great!

Joachim Breitner (Aug 18 2024 at 15:18):

Indeed, with  #15380 I don’t even strictly need iSup_add . Thanks! (Is it expected that the continuity tactic won’t solve the first goal?)

Ruben Van de Velde (Aug 18 2024 at 16:48):

Does fun_prop work?

Joachim Breitner (Aug 18 2024 at 19:26):

Indeed, fun_prop can solve

 ContinuousAt (fun x  x + n) ( x, (x).length)

It does not solve

 Monotone fun x  x + n

though, because

`Monotone fun x  x + n` is not a `fun_prop` goal! Maybe you forgot marking `Monotone` with `@[fun_prop]`.

Is there a reason why continuity is monotonicity isn’t a fun_prop goal?

Ruben Van de Velde (Aug 18 2024 at 19:34):

Nobody's implemented it yet

Joachim Breitner (Aug 18 2024 at 19:34):

Good reason, as usual :-)


Last updated: May 02 2025 at 03:31 UTC