Datasets:
Download lean_project/FormalConjecturesTest/Util/Linters/AMSLinter.lean from nielsr/formal-conjectures: direct link, hf CLI and curl.
- Browser
- Download file 3.18 kB
-
https://huggingface.co/datasets/nielsr/formal-conjectures/resolve/main/lean_project/FormalConjecturesTest/Util/Linters/AMSLinter.lean
- Command line
-
hf download hf://datasets/nielsr/formal-conjectures/lean_project/FormalConjecturesTest/Util/Linters/AMSLinter.lean
-
curl -L -o AMSLinter.lean https://huggingface.co/datasets/nielsr/formal-conjectures/resolve/main/lean_project/FormalConjecturesTest/Util/Linters/AMSLinter.lean
3.18 kB
| /- | |
| Copyright 2025 The Formal Conjectures Authors. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| https://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| See the License for the specific language governing permissions and | |
| limitations under the License. | |
| -/ | |
| module | |
| public meta import FormalConjecturesUtil.Linters.AMSLinter | |
| @[expose] public section | |
| -- Off by default; on here because this file is what tests it. | |
| set_option linter.style.ams_attribute true | |
| namespace AMSLinter | |
| -- Definitions aren't required to have an AMS attribute | |
| def foo : Nat := 1 | |
| /-- | |
| warning: Missing AMS attribute. | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| /-- A highly non-trivial theorem -/ | |
| theorem test_theorem : 1 + 1 = 2 := by | |
| rfl | |
| /-- | |
| warning: Missing AMS attribute. | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| /-- A highly non-trivial theorem with a helpful hypothesis -/ | |
| theorem test_theorem_with_hypothesis (_ : True) : 1 + 1 = 2 := by | |
| rfl | |
| /-- | |
| warning: Missing AMS attribute. | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| /-- A highly non-trivial theorem with two helpful hypotheses -/ | |
| theorem test_theorem_with_hypotheses (_ : True) (_ : False): 1 + 1 = 2 := by | |
| rfl | |
| /-- | |
| warning: Missing AMS attribute. | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| lemma test_lemma : 1 + 1 = 2 := by | |
| rfl | |
| /-- | |
| warning: Missing AMS attribute. | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| example : 1 + 1 = 2 := by | |
| rfl | |
| /-- | |
| warning: The AMS tag should be formatted as AMS 1 3 rather than AMS 1, AMS 3 | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| /-- A highly non-trivial theorem with a helpful hypothesis -/ | |
| @[AMS 1, AMS 3] | |
| theorem test_theorem_with_docstring : 1 + 1 = 2 := by | |
| rfl | |
| /-- A highly non-trivial theorem with a helpful hypothesis -/ | |
| @[AMS 1 3] | |
| example: 1 + 1 = 2 := by | |
| rfl | |
| -- The linter is compatible with theorems having other attributes. | |
| @[simp, AMS 1] | |
| theorem test_1 : 1 + 1 = 2 := by | |
| rfl | |
| -- The order of attributes is irrelevant. | |
| @[AMS 1, simp] | |
| theorem test_3 : 1 + 1 = 2 := by | |
| rfl | |
| /-- | |
| warning: The AMS tags should be ordered as AMS 1 3 | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| @[AMS 3 1] | |
| theorem test_out_of_order : 1 + 1 = 2 := by | |
| rfl | |
| /-- | |
| warning: AMS tags contain duplicates. This should be AMS 3 | |
| Note: This linter can be disabled with `set_option linter.style.ams_attribute false` | |
| -/ | |
| @[AMS 3 3] | |
| theorem test_dup : 1 + 1 = 2 := by | |
| rfl | |
| end AMSLinter | |