This guide describes the styling conventions that are applicable to the development of this library.
This file is not comprehensive yet, it contains mistakes and unclear indications, and some topics may have been overlooked: please consider improving it.
- Universal quantifications with dependent variable should appear on the left hand side of the colon, until we reach the first non dependent variables. e.g.
Lemma example x y : x < y -> x >= y = false
- Hypothesis should not be named
H,H',... but have meaningful names. For example, an hypothesisn > 0should be namedn_gt0.
To be defined…
- A line should have no more than 80 characters. What a character is is subject to interpretation. If a line is longer than that, it should be cut semantically. If there is no way to make a semantic cut (e.g. the user provides an explicit term that is too long to fit on one line), then just cut it over several lines to make it readable.
- Operators are surrounded by space, for example
n*mshould be writtenn * m.
We write
move=>andmove:(no space betweenmoveand=>or:)apply/andapply:(no space betweenapplyand/or:)rewrite /definition(there is a space betweenrewriteand an unfold)
-
Lines end with a point
.and only have;inside them. -
Lines that close a goal must start with a terminator (
byorexact). -
When two subgoals are created, the first subgoal is indented by 2 spaces, the second is not. Use
last firstto bring the smallest/less meaningful goal first, and keep the main flow of the proof unindented. -
When more than two subgoals are created, bullets are used
-for the first level,+for the second and*for the third as in:tactic. - tactic. + tactic. * tactic. * tactic. * tactic. + tactic. + tactic. - tactic - tacticIf all the subgoals have the same importance, use bullets for all of them, however, if one goal is more important than the others (i.e. is main flow of the proof). Then you might remove the bullet for this last one and unindent it as in:
tactic. - tactic. (* secondary subgoal 1 *) - tactic. (* secondary subgoal 2 *) tactic. (* third subgoal is the main one *)