use docComment for statement description

This commit is contained in:
Jon Eugster
2023-08-07 01:16:02 +02:00
parent 9ef4122e94
commit 0b14489911
3 changed files with 88 additions and 26 deletions
+28 -4
View File
@@ -7,10 +7,18 @@ Level 1
/- Missing doc -/
-- Shows warning on `foo.bar`:
Statement foo.bar "some text" : 5 ≤ 7 := by
-- Shows info on `foo.bar`:
/-- some text -/
Statement foo.bar : 5 ≤ 7 := by
simp
-- Shows warning on `foo.bar₂`:
Statement foo.bar2 : 3 ≤ 7 := by
simp
NewLemma foo.baz
DisabledTactic tauto
@@ -20,7 +28,8 @@ DisabledTactic tauto
-- test that the command also works inside a namespace
namespace myNamespace
Statement anotherStatement "test" (n : Nat) : n + 0 = n := by
/-- test -/
Statement anotherStatement (n : Nat) : n + 0 = n := by
rfl
end myNamespace
@@ -29,7 +38,8 @@ end myNamespace
LemmaDoc add_zero as "add_zero" in "Nat" "(nothing)"
Statement add_zero "test" (n : Nat) : n + 0 = n := by
/-- test -/
Statement add_zero (n : Nat) : n + 0 = n := by
rfl
Statement (n : Nat) : 0 + n = n := by
@@ -47,3 +57,17 @@ NewLemma add_zero
theorem xy (n : Nat) : n + 0 = n := by
simp
/-! Test that it is possible to add `simp` attribute. -/
/-- Doc comment -/
@[simp]
Statement My.add_comm (n m : Nat) : n + m = m + n := by
rw [Nat.add_comm]
example (n m : Nat) : n + m = m + n := by
simp
#check My.add_comm