File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -181,11 +181,16 @@ theorem mem_split {x : T} {l : List T} : x ∈ l → ∃ s t : List T, l = s ++
181181 have H4 : y :: l = (y :: s) ++ (x :: t) := by rw [H3]; rfl
182182 Exists.intro (y :: s) (Exists.intro t H4)))
183183```
184- The type of all arguments of a declaration should be given,
184+ The type of all arguments of a declaration should be given explicitly ,
185185even if Lean can figure out this type information by itself.
186186This makes it easier to understand the definition when seeing it on a webpage like GitHub.
187187For the same reason, the return type of all declarations should also be given
188188(Lean enforces this only for theorems).
189+ So you should follow the style of ` GoodStatement ` in this example:
190+ ``` lean
191+ def BadStatement (n) := ∃ k, n + k = 3
192+ def GoodStatement (n : ℕ) : Prop := ∃ k : ℕ, n + k = 3
193+ ```
189194
190195A short declaration can be written on a single line:
191196``` lean
You can’t perform that action at this time.
0 commit comments