Upgrade to Lean 4.35 and add comparator check

- Move to lean-toolchain v4.35.0 and mathlib v4.35.0
- Opt out of the module-system warning with `allowNonModules`
- Adapt to Lean/Mathlib 4.35 changes: drop now-redundant
  `List.filter_congr` blocks and no-op `ring` calls
- Add `Challenge.lean`, `Solution.lean`, and `comparator.json`

`lake comparator` now accepts the solution against the trusted challenge.
This commit is contained in:
andrew committed 2026-11-17 10:28:15 -05:00
1 parent fc8335c380
commit bd5b3c885c
10 files changed
+48 -30

No files matched your search

-3
View File
@@ -195,13 +195,10 @@ theorem evalCountToggled_eq_cnt_toggle {db : DB} {bounds : List Key}
· simp [hlt, hmem]
try ring
· simp [hlt]
try ring
· rw [dite_eq_right hmem, cnt_insert_eq db k hmem e]
by_cases hlt : (k : WithTop Key) < e
· simp [hlt, hmem]
try ring
· simp [hlt]
try ring
/-- **One toggle witness in finite count form.** A database satisfying a system
`S` while violating every constraint in a chosen list `bad` after toggling `k`
-3
View File
@@ -163,9 +163,6 @@ theorem cnt_le_intervalCard_nil (db : DB) (w : WithTop Key) :
(db.keys.filter (fun k => decide (k < ko))).length := by
rw [cnt, List.countP_eq_length_filter]
congr 1
apply List.filter_congr
intro k _
simp [WithTop.coe_lt_coe]
rw [hcnt, intervalCard_eq_encard_keysIn]
exact h1
@@ -63,10 +63,6 @@ theorem countP_lt_eq_add_filter_withTop (l : List Key) (hnd : l.Nodup) {a : Key}
Key)))).length =
(l.filter (fun x : Key => decide (a ≤ x ∧ x < ke))).length := by
congr 1
apply List.filter_congr
intro k _
rw [decide_eq_decide]
simp only [WithTop.coe_le_coe, WithTop.coe_lt_coe]
rw [hcoe, h, hf]
/-- **The begin resolution in the nonclamping negative-offset complete cell.** When the
@@ -983,12 +983,6 @@ theorem filler_count_nonpos_more_nonpos_end {db : DB} {r : RangeRead} {res : Res
(k : WithTop Key)) && decide ((k : WithTop Key) < r.end_.key)) := by
rw [List.countP_eq_length_filter]
congr 1
apply List.filter_congr
intro k _
rw [Bool.decide_and]
rw [show decide (last < k) =
decide ((↑last : WithTop Key) < (↑k : WithTop Key)) from
decide_eq_decide.mpr (WithTop.coe_lt_coe.symm)]
rw [hn', ← hs]
have hanchor_nonneg : 0 ≤ r.end_.anchor db := by
by_contra hneg