This applies to Context, Implicit Types, and definitions.
**TODO**: Prefer `(a : B)` to `a : B`
-**Put a space on both sides of the colon.**
Good: `(a : B)`<br>
Bad: `(a:B)`, `(a: B)`
-**Prefer `(a : B)` to `a : B`.** (TODO)
This applies to Context, Implicit Types, and definitions
### Patterns
#### Disjunctions & branches
Always mark the disjuncts when destructuring a disjunctive pattern, even if you don't bind anything, to indicate that the proof branches
-**Always mark the disjuncts when destructuring a disjunctive pattern, even if you don't bind anything, to indicate that the proof branches.**
**Good:**
```coq
Lemmafoo:∀b:bool,b=true∨b=false.
Proof.
intros[|].
...
```
Good:
```coq
Lemmafoo:∀b:bool,b=true∨b=false.
Proof.
intros[|].
...
```
**Bad:**
```coq
Lemmafoo:∀b:bool,b=true∨b=false.
Proof.
intros[].
...
```
Bad:
```coq
Lemmafoo:∀b:bool,b=true∨b=false.
Proof.
intros[].
...
```
#### Uncategorized
**TODO:**Use `"[H1 H2]"` when possible otherwise do `"(H1 & H2 & H3)"`
-**Use `"[H1 H2]"` when possible otherwise do `"(H1 & H2 & H3)"`.** (TODO)
### Unicode
Always use Unicode variants of forall, exists, ->, <=,>=
-**Always use Unicode variants of forall, exists, ->, <=, >=.**
**Good:**`∀ ∃ → ≤ ≥`
**Bad:**`forall exists -> <= >=`
Good: `∀ ∃ → ≤ ≥`<br>
Bad: `forall exists -> <= >=`
### Equivalent vernacular commands
Use `Context`, never `Variable`
-**Use `Context`, never `Variable`.**
**TODO:**Use `Implicit Types`, never `Implicit Type`
-**Use `Implicit Types`, never `Implicit Type`.** (TODO)
Use `Lemma`, not `Theorem` (or the other variants: `Fact`, `Corollary`,
`Remark`)
-**Use `Lemma`, not `Theorem` (or the other variants: `Fact`, `Corollary`, `Remark`)**.
**TODO:**Always add `Global` or `Local` to `Hint`, `Arguments`, and `Instance`.
-**Always add `Global` or `Local` to `Hint`, `Arguments`, and `Instance`.** (TODO)
### `Require`
Never put `Require` in the middle of a file. All `Require` must be at the top.
-**Never put `Require` in the middle of a file.** All `Require` must be at the top.
If you only want to *import* a certain module in some specific place (for instance, in a `Section` or other `Module`), you can do something like:
```coq
FromlibRequirecomponent.
(* ... *)
Importcomponent.
```
```coq
FromlibRequirecomponent.
(* ... *)
Importcomponent.
```
### Ltac
We prefer `first [ t1 | fail 1 "..." ]` to `t1 || fail "..."` because the latter will fail if `t1` doesn't make progress. See https://gitlab.mpi-sws.org/iris/iris/-/issues/216. Note that `first [ t1 | fail "..."]` is simply incorrect; the failure message will never show up and will be replaced with a generic failure.
-**Prefer `first [ t1 | fail 1 "..." ]` to `t1 || fail "..."`.** This is better because the latter will fail if `t1` doesn't make progress. See https://gitlab.mpi-sws.org/iris/iris/-/issues/216. Note that `first [ t1 | fail "..."]` is simply incorrect; the failure message will never show up and will be replaced with a generic failure.
### Coqdoc comments
Module-level comments (covering the entire file) go at the top of the file, before the `Require`.
-**Module-level comments (covering the entire file) go at the top of the file, before the `Require`.**
### Uncategorized
Indent the body of a match by one space:
**Good:**
```coq
matchfoowith
|Somex=>
longlinehereusing
```
*RJ*: This is odd, usually everything is in (multiples of) 2 spaces, I think.