forked from siddhartha-gadgil/LeanAide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclienttest.lean
More file actions
199 lines (189 loc) · 4.86 KB
/
Copy pathclienttest.lean
File metadata and controls
199 lines (189 loc) · 4.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
import LeanAideCore
import LeanAideCore.Syntax
import Mathlib
import Lean
import Qq
open LeanAide Lean Meta Elab Parser Tactic
set_option linter.unusedTactic false
open Nat
open Qq
#leanaide_connect -- "http://10.134.13.103:7654"
#eval LeanAidePipe.response <| json% {"task": "echo"}
-- universe u v w u_1 u_2 u_3 u₁ u₂ u₃
-- open scoped Nat
-- @[default_instance]
-- instance : Add ℤ := inferInstance
-- @[default_instance]
-- instance : Semiring ℤ := inferInstance
def egTheorem : Json :=
json% {
"type": "theorem",
"name": "egTheorem",
"claim_label": "egTheorem",
"claim": "There are infinitely many odd numbers.",
"proof": {
"proof_steps": []
}
}
#codegen {
"document": [
{
"type": "Theorem",
"header": "Lemma",
"label": "lem:inverse_one",
"hypothesis": [
{
"type": "let_statement",
"variable_name": "G",
"variable_type": "Type u",
"statement": "G : Type u"
},
{
"type": "assume_statement",
"assumption": "[Group G]"
},
{
"type": "let_statement",
"variable_name": "a",
"variable_type": "G",
"statement": "a : G"
},
{
"type": "assume_statement",
"assumption": "hâ‚ : a = 1"
}
],
"claim": "aâ»Â¹ = 1",
"proof": {
"type": "Proof",
"claim_label": "lem:inverse_one",
"proof_steps": [
[
{
"type": "assert_statement",
"label": "step1",
"claim": "aâ»Â¹ = 1â»Â¹",
"proof_method": "Eq.subst",
"internal_references": [
{
"target_identifier": "hâ‚"
}
],
"results_used": [
{
"statement": "Eq.subst for inv",
"mathlib_identifier": "Eq.subst"
}
]
},
{
"type": "assert_statement",
"label": "step2",
"claim": "1â»Â¹ = 1",
"proof_method": "inv_one",
"internal_references": [
{
"target_identifier": "inv_one"
}
]
},
{
"type": "assert_statement",
"claim": "aâ»Â¹ = 1",
"proof_method": "transitivity",
"results_used": [
{
"statement": "aâ»Â¹ = 1â»Â¹",
"target_identifier": "step1"
},
{
"statement": "1â»Â¹ = 1",
"target_identifier": "step2"
}
]
},
{
"type": "conclude_statement"
}
]
]
}
},
{
"type": "Theorem",
"header": "Theorem",
"label": "thm:inverse_self",
"hypothesis": [
{
"type": "let_statement",
"variable_name": "G",
"variable_type": "Type u",
"statement": "G : Type u"
},
{
"type": "assume_statement",
"assumption": "[Group G]"
},
{
"type": "let_statement",
"variable_name": "e",
"variable_type": "G",
"statement": "e : G"
},
{
"type": "assume_statement",
"assumption": "hâ‚‚ : e = 1"
}
],
"claim": "eâ»Â¹ = e",
"proof": {
"type": "Proof",
"claim_label": "thm:inverse_self",
"proof_steps": [
[
{
"type": "assert_statement",
"label": "step1",
"claim": "eâ»Â¹ = 1",
"proof_method": "by Lemma 1",
"internal_references": [
{
"target_identifier": "lem:inverse_one"
}
]
},
{
"type": "assert_statement",
"label": "step2",
"claim": "1 = e",
"proof_method": "Eq.symm",
"internal_references": [
{
"target_identifier": "hâ‚‚"
}
]
},
{
"type": "assert_statement",
"claim": "eâ»Â¹ = e",
"proof_method": "transitivity",
"results_used": [
{
"statement": "eâ»Â¹ = 1",
"target_identifier": "step1"
},
{
"statement": "1 = e",
"target_identifier": "step2"
}
]
},
{
"type": "conclude_statement"
}
]
]
}
}
]
}