Fix all Lean build warnings

- Update deprecated lemmas (ite_eq_left/right, ENat casts, List.Sublist, ...)
- Replace push_neg with push Not and resolve unused-variable warnings
- Convert flexible simp/simp_all calls to explicit simp only lists
- Remove unscoped maxHeartbeats options, open scoped Classical, and unused tactics
- Add missing module docstrings and clean up style linter hits
- Wrap over-long lines and flatten the deeply nested
  minimal_conflictRangeClosedForm_total proof

`lake build` now completes with zero warnings.
This commit is contained in:
andrew committed 2026-11-17 10:04:35 -05:00
1 parent a54a5f82f8
commit af318a7d32
51 files changed
+2542 -1357

No files matched your search

@@ -29,7 +29,6 @@ the range must start at `E`.
namespace FormalConflictRange
set_option maxHeartbeats 3200000
/-- The first optional entry of a nonempty list is its head. -/
theorem getElem?_zero_eq_head {l : List Key} (hne : l ≠ []) :
@@ -572,7 +571,8 @@ theorem necessary_gap_of_sentinel_large_A {r : RangeRead} {res : Result}
have hanchorEnd : (r.end_.anchor db_a).toNat = e := by
have hanc : r.end_.anchor db_a = r.end_.offset - 1 := by
unfold Selector.anchor
rw [show List.countP (fun (k : Key) => decide ((↑k : WithTop Key) < r.end_.key)) db_a.keys = 0 from by
rw [show List.countP (fun (k : Key) => decide ((↑k : WithTop Key) < r.end_.key)) db_a.keys =
0 from by
rw [← hE]; exact hcnt0]
ring
rw [hanc]
@@ -659,7 +659,8 @@ theorem necessary_gap_of_sentinel_large_A {r : RangeRead} {res : Result}
have hancEnd_b : (r.end_.anchor db_b).toNat = e := by
have hanc : r.end_.anchor db_b = r.end_.offset - 1 := by
unfold Selector.anchor
rw [show List.countP (fun (k : Key) => decide ((↑k : WithTop Key) < r.end_.key)) db_b.keys = 0 from by
rw [show List.countP (fun (k : Key) => decide ((↑k : WithTop Key) < r.end_.key)) db_b.keys =
0 from by
rw [← hE]; exact hb_cnt0]
ring
rw [hanc]
@@ -712,7 +713,7 @@ the witness key above the head enters the complete window, breaking the reported
prefix. -/
theorem necessary_gap_of_sentinel_large_B {r : RangeRead} {res : Result}
(hread : Readable r res) (hmore : res.more = true) (hrev : r.reverse = true)
(hbeg : r.begin.offset < 0) (hne : res.keys ≠ [])
(_hbeg : r.begin.offset < 0) (hne : res.keys ≠ [])
(hbtop : r.begin.key = (⊤ : WithTop Key))
(hend : 2 ≤ r.end_.offset)
(hEL : r.end_.key < ((res.keys.getLast hne : Key) : WithTop Key))
@@ -1076,7 +1077,7 @@ theorem minimal_closedForm_of_negCross_trunc_rev_residual_top_large_sentinel
topOfLast (res.keys.getLast hne) := by
unfold closedFormNegCrossTruncRevResidualTopLargeSentinel topOfLast
dsimp only
rw [if_pos htight]
rw [ite_eq_left htight]
simp [List.getLast?_eq_some_getLast hne]
rw [hcf]
exact hmin
@@ -1127,7 +1128,7 @@ theorem minimal_closedForm_of_negCross_trunc_rev_residual_top_large_sentinel
⟨r.end_.key, ⊤⟩ := by
unfold closedFormNegCrossTruncRevResidualTopLargeSentinel
dsimp only
rw [if_neg htight]
rw [ite_eq_right htight]
rw [hcf]
exact hmin