Запись блоков begin/end относится к синтаксису lean 3. Для входа в режим тактик в Lean 4 используйте ключевое слово by, например:
example (a b c : Prop) : ((a ∨ b) → c) ↔ ((a → c) ∧ (b → c)) := by sorry
Аналога end теперь нет, поскольку область определяется отступами, однако необязательный завершающий done выдаёт ошибку, если осталась незакрытая цель.
Даже при большом опыте с lean 3 я бы посоветовал просмотреть руководство (https://lean-lang.org/lean4/doc/) и/или Theorem Proving in Lean/Functional Programming in Lean (главы 4 и 5 руководства), учитывая значительные изменения и улучшения.
Ключевое слово end по-прежнему закрывает секции и пространства имён, чем и объясняется диагностика при использовании end здесь.
Переведено с английского·Показать оригиналThe begin/end block notation belongs to lean 3. To start tactic mode with Lean 4, use the keyword by, for example:
example (a b c : Prop) : ((a ∨ b) → c) ↔ ((a → c) ∧ (b → c)) := by sorry
There is no corresponding end now because white space determines the scope, although an optional final done produces an error when a goal remains open.
Even with substantial lean 3 experience, I'd suggest looking through the manual (https://lean-lang.org/lean4/doc/) and/or Theorem Proving in Lean/Functional Programming in Lean (chapters 4 and 5 of the manual), given the considerable improvements and changes.
The end keyword still closes sections and namespaces, explaining the diagnostic you see when using end here.