Skip to content

Commit 0ecbb3a

Browse files
duncancmtclaude
andcommitted
formal: replace native_decide with decide in cbrt512 numeric certs
Eliminates Lean.trustCompiler axiom from all theorems. All 29 numeric certificates are now fully kernel-verified. No performance regression (CbrtNumericCerts builds in ~1s). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8c9f163 commit 0ecbb3a

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

formal/cbrt/Cbrt512Proof/Cbrt512Proof/CbrtNumericCerts.lean

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,106 +39,106 @@ set_option exponentiation.threshold 1024 in
3939
theorem baseCaseSeed_bounds :
4040
2 ^ 83 ≤ baseCaseSeed ∧ baseCaseSeed < 2 ^ 88 := by
4141
unfold baseCaseSeed
42-
native_decide
42+
decide
4343

4444
set_option exponentiation.threshold 1024 in
4545
theorem pow83_cube_le_pow251 :
4646
(2 ^ 83) * (2 ^ 83) * (2 ^ 83) ≤ 2 ^ 251 := by
47-
native_decide
47+
decide
4848

4949
set_option exponentiation.threshold 1024 in
5050
theorem pow254_le_succ_pow85_sub_one_cube :
5151
2 ^ 254 ≤ ((2 ^ 85 - 1) + 1) * ((2 ^ 85 - 1) + 1) * ((2 ^ 85 - 1) + 1) := by
52-
native_decide
52+
decide
5353

5454
set_option exponentiation.threshold 1024 in
5555
theorem pow85_sub_one_sq_lt_word :
5656
(2 ^ 85 - 1) * (2 ^ 85 - 1) < WORD_MOD := by
5757
unfold WORD_MOD
58-
native_decide
58+
decide
5959

6060
set_option exponentiation.threshold 1024 in
6161
theorem pow85_sub_one_cube_lt_word :
6262
(2 ^ 85 - 1) * (2 ^ 85 - 1) * (2 ^ 85 - 1) < WORD_MOD := by
6363
unfold WORD_MOD
64-
native_decide
64+
decide
6565

6666
set_option exponentiation.threshold 1024 in
6767
theorem octave251_bounds :
6868
octave251Lo * octave251Lo * octave251Lo ≤ 2 ^ 251
6969
2 ^ 252 ≤ (octave251Hi + 1) * (octave251Hi + 1) * (octave251Hi + 1) := by
7070
unfold octave251Lo octave251Hi
71-
native_decide
71+
decide
7272

7373
set_option exponentiation.threshold 1024 in
7474
theorem octave251_lo_two_le : 2 ≤ octave251Lo := by
7575
unfold octave251Lo
76-
native_decide
76+
decide
7777

7878
set_option exponentiation.threshold 1024 in
7979
theorem octave252_bounds :
8080
octave252Lo * octave252Lo * octave252Lo ≤ 2 ^ 252
8181
2 ^ 253 ≤ (octave252Hi + 1) * (octave252Hi + 1) * (octave252Hi + 1) := by
8282
unfold octave252Lo octave252Hi
83-
native_decide
83+
decide
8484

8585
set_option exponentiation.threshold 1024 in
8686
theorem octave252_lo_two_le : 2 ≤ octave252Lo := by
8787
unfold octave252Lo
88-
native_decide
88+
decide
8989

9090
set_option exponentiation.threshold 1024 in
9191
theorem octave253_lo_cube_le_pow253 :
9292
octave253Lo * octave253Lo * octave253Lo ≤ 2 ^ 253 := by
9393
unfold octave253Lo
94-
native_decide
94+
decide
9595

9696
set_option exponentiation.threshold 1024 in
9797
theorem octave253_lo_two_le : 2 ≤ octave253Lo := by
9898
unfold octave253Lo
99-
native_decide
99+
decide
100100

101101
set_option exponentiation.threshold 1024 in
102102
theorem octave251_gap_eq :
103103
max (baseCaseSeed - octave251Lo) (octave251Hi - baseCaseSeed) = octave251Gap := by
104104
unfold baseCaseSeed octave251Lo octave251Hi octave251Gap
105-
native_decide
105+
decide
106106

107107
set_option exponentiation.threshold 1024 in
108108
theorem octave252_gap_eq :
109109
max (baseCaseSeed - octave252Lo) (octave252Hi - baseCaseSeed) = octave252Gap := by
110110
unfold baseCaseSeed octave252Lo octave252Hi octave252Gap
111-
native_decide
111+
decide
112112

113113
set_option exponentiation.threshold 1024 in
114114
theorem octave253_gap_eq :
115115
max (baseCaseSeed - octave253Lo) (M_TOP - baseCaseSeed) = octave253Gap := by
116116
unfold baseCaseSeed octave253Lo M_TOP octave253Gap
117-
native_decide
117+
decide
118118

119119
set_option exponentiation.threshold 1024 in
120120
theorem octave251_d1_formula_eq :
121121
(octave251Gap * octave251Gap * (octave251Hi + 2 * baseCaseSeed) +
122122
3 * octave251Hi * (octave251Hi + 1)) / (3 * (baseCaseSeed * baseCaseSeed)) =
123123
octave251D1 := by
124124
unfold octave251Gap octave251Hi baseCaseSeed octave251D1
125-
native_decide
125+
decide
126126

127127
set_option exponentiation.threshold 1024 in
128128
theorem octave252_d1_formula_eq :
129129
(octave252Gap * octave252Gap * (octave252Hi + 2 * baseCaseSeed) +
130130
3 * octave252Hi * (octave252Hi + 1)) / (3 * (baseCaseSeed * baseCaseSeed)) =
131131
octave252D1 := by
132132
unfold octave252Gap octave252Hi baseCaseSeed octave252D1
133-
native_decide
133+
decide
134134

135135
set_option exponentiation.threshold 1024 in
136136
theorem octave253_d1_formula_eq :
137137
(octave253Gap * octave253Gap * (M_TOP + 2 * baseCaseSeed) +
138138
3 * M_TOP * (M_TOP + 1)) / (3 * (baseCaseSeed * baseCaseSeed)) =
139139
octave253D1 := by
140140
unfold octave253Gap M_TOP baseCaseSeed octave253D1
141-
native_decide
141+
decide
142142

143143
set_option exponentiation.threshold 1024 in
144144
theorem octave251_chain_bounds :
@@ -153,7 +153,7 @@ theorem octave251_chain_bounds :
153153
(nextD octave251Lo
154154
(nextD octave251Lo (nextD octave251Lo octave251D1)))) ≤ 1 := by
155155
unfold octave251D1 octave251Lo nextD
156-
native_decide
156+
decide
157157

158158
set_option exponentiation.threshold 1024 in
159159
theorem octave252_chain_bounds :
@@ -168,7 +168,7 @@ theorem octave252_chain_bounds :
168168
(nextD octave252Lo
169169
(nextD octave252Lo (nextD octave252Lo octave252D1)))) ≤ 1 := by
170170
unfold octave252D1 octave252Lo nextD
171-
native_decide
171+
decide
172172

173173
set_option exponentiation.threshold 1024 in
174174
theorem octave253_chain_bounds :
@@ -183,12 +183,12 @@ theorem octave253_chain_bounds :
183183
(nextD octave253Lo
184184
(nextD octave253Lo (nextD octave253Lo octave253D1)))) ≤ 1 := by
185185
unfold octave253D1 octave253Lo nextD
186-
native_decide
186+
decide
187187

188188
set_option exponentiation.threshold 1024 in
189189
theorem baseCaseShiftMask_eq_two : evmAnd (evmAnd 2 255) 255 = 2 := by
190190
unfold evmAnd u256 WORD_MOD
191-
native_decide
191+
decide
192192

193193
-- ============================================================================
194194
-- QC certificates
@@ -197,11 +197,11 @@ theorem baseCaseShiftMask_eq_two : evmAnd (evmAnd 2 255) 255 = 2 := by
197197
set_option exponentiation.threshold 1024 in
198198
theorem qc_const_86 : evmAnd (evmAnd 86 255) 255 = 86 := by
199199
unfold evmAnd u256 WORD_MOD
200-
native_decide
200+
decide
201201

202202
set_option exponentiation.threshold 1024 in
203203
theorem mask_86_eq : 77371252455336267181195263 = 2 ^ 86 - 1 := by
204-
native_decide
204+
decide
205205

206206
-- ============================================================================
207207
-- Range certificates
@@ -210,26 +210,26 @@ theorem mask_86_eq : 77371252455336267181195263 = 2 ^ 86 - 1 := by
210210
set_option exponentiation.threshold 1024 in
211211
theorem r_max_cube_lt_wm2 : R_MAX * R_MAX * R_MAX < WORD_MOD * WORD_MOD := by
212212
unfold R_MAX WORD_MOD
213-
native_decide
213+
decide
214214

215215
set_option exponentiation.threshold 1024 in
216216
theorem r_max_is_icbrt_wm2 :
217217
R_MAX * R_MAX * R_MAX ≤ WORD_MOD * WORD_MOD - 1
218218
WORD_MOD * WORD_MOD - 1 < (R_MAX + 1) * (R_MAX + 1) * (R_MAX + 1) := by
219219
unfold R_MAX WORD_MOD
220-
constructor <;> native_decide
220+
constructor <;> decide
221221

222222
set_option exponentiation.threshold 1024 in
223223
theorem m_top_cube_bounds :
224224
M_TOP * M_TOP * M_TOP ≤ 2 ^ 254 - 1
225225
2 ^ 254 ≤ (M_TOP + 1) * (M_TOP + 1) * (M_TOP + 1) := by
226226
unfold M_TOP
227-
constructor <;> native_decide
227+
constructor <;> decide
228228

229229
set_option exponentiation.threshold 1024 in
230230
theorem r_max_ge_r_top : M_TOP * 2 ^ 86 ≤ R_MAX := by
231231
unfold M_TOP R_MAX
232-
native_decide
232+
decide
233233

234234
set_option exponentiation.threshold 1024 in
235235
theorem r_lo_max_at_m_top :
@@ -241,12 +241,12 @@ theorem r_lo_max_at_m_top :
241241
(delta + 1) * (delta + 1) / R ≥ 1
242242
9 ≤ delta := by
243243
unfold M_TOP R_MAX
244-
native_decide
244+
decide
245245

246246
set_option exponentiation.threshold 1024 in
247247
theorem m_top_three_msq_plus_3m_lt_pow171 :
248248
3 * (M_TOP * M_TOP) + 3 * M_TOP < 2 ^ 171 := by
249249
unfold M_TOP
250-
native_decide
250+
decide
251251

252252
end Cbrt512Spec

0 commit comments

Comments
 (0)