Zulip Chat Archive

Stream: new members

Topic: How to write symbols in VS code for a lean file?


Quantum_fluctuations (Mar 27 2023 at 11:01):

I am sorry if this is very dumb question. But how do I type different mathematical symbols like "for all" symbol or "greater than or equal to" symbol in a VS code file for LEAN?

Jeremy Tan (Mar 27 2023 at 11:02):

Special characters can be entered by typing \ followed by their ASCII equivalent

Jeremy Tan (Mar 27 2023 at 11:03):

so the forall symbol is \forall, for example

Jeremy Tan (Mar 27 2023 at 11:04):

and the greater-than-or-equal-to sign is \>= (once you type the last character it automatically shows up)

Kevin Buzzard (Mar 27 2023 at 11:24):

greater-than-or-equal-to tends to avoided in mathlib by the way, because allowing its use doubles the number of inequality lemmas we have. \le (like in LaTeX) generates unicode <=.

A way of answering this question yourself is by finding some lean code which already exists with the symbol in, and hovering over the symbol you want to know the shortcut for.

Filippo A. E. Nuccio (Mar 27 2023 at 17:03):

Just to make Kevin's answer explicit, here are two snippets showing you how to sort out the way to write the "bot" symbol or the "Principal filter" in case you find them in some file:
princ.png bot.png

MohanadAhmed (Mar 27 2023 at 19:29):

You might find this list of unicode characters useful https://docs.julialang.org/en/v1/manual/unicode-input/. I find it very useful

MohanadAhmed (Mar 27 2023 at 19:31):

although the list is for julia REPL, all the ones I have tried in VS code so far have worked

Patrick Massot (Mar 27 2023 at 19:35):

There is no need to guess anything from an unrelated language, you can read https://github.com/leanprover/vscode-lean/blob/master/src/abbreviation/abbreviations.json


Last updated: Dec 20 2023 at 11:08 UTC