You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report. The lemma command is a feature of mathlib (or batteries) and simply does not exist in lean. Maybe it would be desirable to have a better error message when a command name is unknown or misspelled, or have stricter indentation rules that make this fail more clearly, but for now I'd say it works as advertised.
Note that batteries has a lemma command which is implemented specifically so that it can tell you that it is not lean syntax and suggests theorem instead. I would like such support to be upstreamed, where it can be more useful.
Lean provides ways of adding new objects to the environment. The following provide straightforward ways of declaring
new objects:
constant c : α : declares a constant named c of type α, where c is a declaration name.
axiom c : α : alternative syntax for constant
def c : α := t : defines c to denote t, which should have type α.
theorem c : p := t : similar to def, but intended to be used when p is a proposition.
lemma c : p := t : alternative syntax for theorem
Here it is never mentioned that lemma is only available when using additional libraries. Of course I should have read version 4 instead of version 3.
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
The following minimal example does not work:
whereas
works fine.
Expected behavior: Both programs should work fine.
Actual behavior: the
theorem
version works, thelemma
version does not.Versions
4.12.0-nightly-2024-10-22
live.lean-lang.org
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: