Skip to content

Commit cb3dedc

Browse files
committed
feat: library suggestion engine for local theorems
1 parent 1b57b9f commit cb3dedc

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import Lean.LibrarySuggestions.Basic
2+
3+
-- Define some initial local constants
4+
def myLocalDef : Nat := 42
5+
6+
theorem myLocalTheorem : myLocalDef = 42 := rfl
7+
8+
-- Add a theorem in the Lean namespace (should be filtered by isDeniedPremise)
9+
namespace Lean
10+
theorem shouldBeFiltered : True := trivial
11+
end Lean
12+
13+
-- Test the currentFile selector (should only show theorems, not definitions)
14+
set_library_suggestions Lean.LibrarySuggestions.currentFile
15+
16+
-- First test: should show only myLocalTheorem
17+
-- (not myLocalDef since it's a def, not Lean.shouldBeFiltered since it's in Lean namespace)
18+
/--
19+
info: Library suggestions: [myLocalTheorem]
20+
-/
21+
#guard_msgs in
22+
example : True := by
23+
suggestions
24+
trivial
25+
26+
-- Add more local constants (mix of theorems and definitions)
27+
theorem anotherTheorem : True := trivial
28+
29+
def myFunction (x : Nat) : Nat := x + 1
30+
31+
-- Second test: should show only the two theorems (not myFunction)
32+
/--
33+
info: Library suggestions: [anotherTheorem, myLocalTheorem]
34+
-/
35+
#guard_msgs in
36+
example : False → True := by
37+
suggestions
38+
intro h
39+
trivial

0 commit comments

Comments
 (0)