Zulip Chat Archive

Stream: condensed mathematics

Topic: fintype_functor


Kevin Buzzard (Apr 30 2022 at 14:55):

I see things like (fintype_functor «r» ⋙ to_CHFPNG₁ «r») ⋙ enlarging_functor which look quite intimidating to me at first. Here is a renaming proposal.

Should

@[simps] def laurent_measures.fintype_functor (r' : nnreal) : Fintype.{u}  ProFiltPseuNormGrpWithTinv₁.{u} r' :=
{ obj := λ S, laurent_measures r' S, λ F, F∥₊, le_rfl⟩⟩, ...

be called something like Fintype.LaurentMeasure? This functor actually does something. The other functors are forgetful functors; they could live in a forgetful namespace which we don't open if we want to be guided about where the meat is. Would something like that be a welcome refactor? Doing stuff like this helps me learn the code base.

Kevin Buzzard (Apr 30 2022 at 15:09):

Oh the namespace is not quite the right idea. How about an annotation on the functor names? I'll try an experiment on a branch.

Adam Topaz (Apr 30 2022 at 15:12):

What about Fintype_to_PFPNGT₁?

Adam Topaz (Apr 30 2022 at 15:13):

And the forgetful functors could be called PFPNGT₁_to_CHFPNG₁ resp. CHFPNG₁_to_CHFPNG

Adam Topaz (Apr 30 2022 at 15:14):

I also think we don't use dot notation enough... In this case, we could define Fintype.to_PFPNGT₁ to get the object associated to a T : Fintype, so that

def Fintype_to_PFPNGT₁ :=
{ obj := Fintype.to_PFPNGT₁,
  map := ... }

Johan Commelin (Apr 30 2022 at 15:20):

Adam Topaz said:

What about Fintype_to_PFPNGT₁?

But the name should mention "laurent" somewhere. Because there's also one for "real measures", and one for "free_pfpng". Etc... And they are genuinely different functors.

Adam Topaz (Apr 30 2022 at 15:20):

Oh yeah good point

Adam Topaz (Apr 30 2022 at 15:21):

So change Fintype.to_PFPNGT₁ to Fintype.LaurentMeasure and Fintype_to_PFPNGT₁ to Fintype_LaurentMeasures

Adam Topaz (Apr 30 2022 at 15:21):

(Note the s)

Adam Topaz (Apr 30 2022 at 15:22):

And of course _root_.LaurentMeasures := Profinite.extend Fintype_LaurentMeasures

Adam Topaz (Apr 30 2022 at 15:23):

I don't know if any of these name changes make sense. The names are a complete mess, I agree, but I'm kind of used to them at this point...

Kevin Buzzard (Apr 30 2022 at 21:35):

@Adam Topaz @Johan Commelin I've just got the functor-refactor branch compiling. What do you think? The little el means that this is a forgetful functor. I wanted a little ge for "greater or equal", because forgetful functors lose information, but there didn't seem to be a unicode g subscript. Probably it will rot quickly but I think I know what I'm doing now. There is more to come -- I'm about to start on the enlarging_functors but that's the last thing.

Kevin Buzzard (Apr 30 2022 at 21:36):

@Filippo A. E. Nuccio this affects you too if you have diverged too much from master

Kevin Buzzard (Apr 30 2022 at 21:37):

Here's the diff.

Filippo A. E. Nuccio (Apr 30 2022 at 21:37):

@Kevin Buzzard Thanks, I have now pulled and everything is back on track again. I was shocked that something clearly looking defeq to me was not, but now I am confident again that I am understanding at least something of Type theory... :sweat_smile:

Kevin Buzzard (Apr 30 2022 at 21:38):

I am proposing changing a bunch of the functor names so they're easier for humans to understand.

Filippo A. E. Nuccio (Apr 30 2022 at 21:39):

It certainly seems a very good idea.

Kevin Buzzard (Apr 30 2022 at 21:41):

Bleurgh it might not compile and I have to go and do real life for a bit. Will be back later, hoping for an all nighter

Filippo A. E. Nuccio (Apr 30 2022 at 21:42):

Oh, wow, brave you! I am getting old, I can't go for an all nighter tonight, I am almost collapsing after 10 hours of Lean (minus a dinner)...

Kevin Buzzard (May 01 2022 at 01:07):

OK so the functor-refactor branch is compiling and will rot fast. Should I merge it?

Johan Commelin (May 01 2022 at 05:30):

@Kevin Buzzard LGTM!

Kevin Buzzard (May 01 2022 at 15:23):

OK so I pushed a bunch of changes to master including the functor name refactor. Enough stuff compiles for me to be cautiously optimistic that I didn't break the build; I'll check now and fix anything up which is broken, quickly.

Adam Topaz (May 01 2022 at 17:19):

Thanks Kevin! The names are indeed much more sensible now.
One question: How useful do you think the subscripts el actually are? It seems to me that it's only used in situations where the fact that the functor in question is forgetting something can be deduced from the name of the functor itself. E.g. I think CHFPNG₁_to_CHFPNG is clear enough that it's just the forgetful functor.

Adam Topaz (May 01 2022 at 17:20):

My main objection is that it takes a total of 6 key presses to write a subscript el.

Adam Topaz (May 01 2022 at 17:29):

Well, maybe I should just finally figure out how to make custom snippets in vscode. Is there some package for vscode that's similar to emacs yasnippet?

Kevin Buzzard (May 01 2022 at 17:37):

I wanted to make a random annotation to indicate "this is a forgetful functor" because it helped me understand the code base. I'm quite happy for it to be removed.

Adam Topaz (May 01 2022 at 17:40):

No, I agree that such an annotation is good in principle, but i find typing those two subscripts to be cumbersome.

Yaël Dillies (May 01 2022 at 17:50):

You can also add \el as an abbreviation to the extensions. See vscode-lean#298

Yaël Dillies (May 01 2022 at 17:51):

@Bryan Gin-ge Chen, can you make the linkifier point to the correct repo when it's on leanprover rather than leanprover-community?

Bryan Gin-ge Chen (May 01 2022 at 18:04):

It'd be tough I think. You can do leanprover/vscode-lean#298 though.

Adam Topaz (May 01 2022 at 18:06):

There must be a way to do this locally as opposed to changing the vscode-lean package for everyone. Besides, a good snippet package would be useful for other reasons as well.

Adam Topaz (May 01 2022 at 18:09):

Looks like vscode has snippets built in

https://code.visualstudio.com/docs/editor/userdefinedsnippets

Adam Topaz (May 02 2022 at 15:02):

@Filippo A. E. Nuccio I think one needs to assume that 0 < r for is_open_U (in which case, I have a proof) Oops! I had the inequality backwards. Ignore me.

Filippo A. E. Nuccio (May 02 2022 at 16:17):

No problem! At any rate, I am advancing well with the proof (and having quite some fun opposing and unopposing categories :smile: ), so I hope to push it soon.

Adam Topaz (May 02 2022 at 16:24):

@Filippo A. E. Nuccio I think 0 < r may actually be needed?

Adam Topaz (May 02 2022 at 16:24):

Maybe I'm missing something.

Filippo A. E. Nuccio (May 02 2022 at 16:25):

Well, at any rate we have it in the setting where I am working (because the parameter p defines r and we have lemma r_pos. Or are you speaking of something else?

Adam Topaz (May 02 2022 at 16:28):

Oh ok, I thought r was just some random element of R0\mathbb{R}_{\ge 0}.

Filippo A. E. Nuccio (May 02 2022 at 16:29):

No, we have

local notation `r` := @r p

where def r : ℝ≥0 := 2⁻¹ ^ (p : ℝ).

Adam Topaz (May 02 2022 at 16:29):

Yeah I see it now.

Adam Topaz (May 02 2022 at 17:00):

Here's the proof I came up with (modulo one small sorry, which uses that 0 < r < 1):

Filippo A. E. Nuccio (May 02 2022 at 17:00):

Oh thanks!

Filippo A. E. Nuccio (May 02 2022 at 17:01):

I think I will finish mine and then compare it with yours!

Adam Topaz (May 02 2022 at 17:01):

I can push it if you want.

Filippo A. E. Nuccio (May 02 2022 at 17:03):

OK, go ahead.

Filippo A. E. Nuccio (May 02 2022 at 17:19):

@Adam Topaz Are you taking care of the remaining sorry or should I?

Adam Topaz (May 02 2022 at 17:19):

Please go ahead!


Last updated: Dec 20 2023 at 11:08 UTC