Zulip Chat Archive
Stream: new members
Topic: Meaning of open Example (...) syntax
Nilay Patel (Jan 24 2025 at 01:12):
I saw the syntax open Filter (Tendsto) in Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean and wasn't sure what this means. Is it a restricted opening ofFilter which only allows Tendsto through?
I also noticed (I think) that open Filter.Tendsto is also valid syntax, and I'm not sure what the difference is in this case. Any clarification would be very helpful.
Thanks in advance!
Aaron Liu (Jan 24 2025 at 01:43):
From docs#Lean.Parser.Command.open:
open Some.Namespace.Path (def1 def2)only makesSome.Namespace.Path.def1and
Some.Namespace.Path.def2available without the full prefix, soSome.Namespace.Path.def3would
be unaffected.This works even if
def1anddef2areprotected.
Aaron Liu (Jan 24 2025 at 01:45):
open Filter.TendsTo works because you can open any namespace, even ones that don't have anything in them. To check the definitions registered for a namespace, you can #print prefix Namespace (this seems to be very slow).
Nilay Patel (Jan 24 2025 at 17:42):
This is perfect, I didn't see the page from the docs. Much appreciated!
Last updated: May 02 2025 at 03:31 UTC