Zulip Chat Archive

Stream: new members

Topic: syntax / structure of (most common) proofs?


rzeta0 (Jun 03 2024 at 15:12):

So as a beginner I naturally struggle to understand some of the syntax I'm seeing around the web.

I have tried to find answers but can't find a simple guide that just explains what the syntax of (the most common) proofs.

I am guess it is something like the following - but I can't find an easy to read guide that confirms it:

name can be anything {variable type declarations} (hyopthesis) (hyopthesis) : statement to prove :=
 method eg calc
 statement 1 = statement 2 := by  tactic
 statement 2= statement 3 := by tactic
 ...
 _ = conclusion statement to prove := by tactic

Is this correct?

I've seen "example" used for the name a lot, which makes me thing the name isn't arbitrary.

Ralf Stephan (Jun 03 2024 at 16:42):

That is one of many formats, a calc proof, see doc#calc.html. To get a better overview I'd suggest #tpil.

Kyle Miller (Jun 03 2024 at 18:13):

which makes me thing the name isn't arbitrary

If you use the example ... command then the theorem is checked and thrown away. If you use theorem foo ... then the theorem is checked and you can refer to it in future proofs as foo.

rzeta0 (Jun 03 2024 at 21:11):

Thanks both - looks like I now need to learn about "modes" as that page refers to them - tactic mode, term mode,...

Kevin Buzzard (Jun 03 2024 at 21:17):

by switches Lean from term mode to tactic mode, and exact switches it from tactic mode to term mode.

Ralf Stephan (Jun 04 2024 at 07:23):

Isn't term mode the pure functional language vs. tactics being a language inside that language?


Last updated: May 02 2025 at 03:31 UTC